Version 23.36: Oct 11, 2023 Code refactoring in HTML.

This commit is contained in:
acanas 2023-10-11 22:45:34 +02:00
parent 357bf48299
commit d7b04912a9
36 changed files with 211 additions and 472 deletions

View File

@ -2048,3 +2048,40 @@ void HTM_Percentage (double Percentage)
{ {
HTM_TxtF ("%5.2lf%%",Percentage); HTM_TxtF ("%5.2lf%%",Percentage);
} }
void HTM_TD_Unsigned (unsigned Num)
{
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (Num);
HTM_TD_End ();
}
void HTM_TD_UnsignedLong (unsigned long Num)
{
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_UnsignedLong (Num);
HTM_TD_End ();
}
void HTM_TD_Percentage (unsigned Num,unsigned NumTotal)
{
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumTotal ? (double) Num * 100.0 / (double) NumTotal :
0.0);
HTM_TD_End ();
}
void HTM_TD_Ratio (unsigned Num,unsigned NumTotal)
{
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumTotal ? (double) Num / (double) NumTotal :
0.0);
HTM_TD_End ();
}
void HTM_TD_Double2Decimals (double Num)
{
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (Num);
HTM_TD_End ();
}

View File

@ -242,4 +242,10 @@ void HTM_DoubleFewDigits (double Num);
void HTM_Double2Decimals (double Num); void HTM_Double2Decimals (double Num);
void HTM_Percentage (double Percentage); void HTM_Percentage (double Percentage);
void HTM_TD_Unsigned (unsigned Num);
void HTM_TD_UnsignedLong (unsigned long Num);
void HTM_TD_Percentage (unsigned Num,unsigned NumTotal);
void HTM_TD_Ratio (unsigned Num,unsigned NumTotal);
void HTM_TD_Double2Decimals (double Num);
#endif #endif

View File

@ -328,13 +328,13 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct Usr_
/***** Begin 2nd table row *****/ /***** Begin 2nd table row *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/***** Courses of this user *****/ /***** Courses of this user *****/
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ()); HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
UsrDat->Sex = Usr_SEX_UNKNOWN; UsrDat->Sex = Usr_SEX_UNKNOWN;
Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_TCH); Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_TCH);
Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_NET); Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_NET);
Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_STD); Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_STD);
HTM_TD_End (); HTM_TD_End ();
/***** End 2nd table row *****/ /***** End 2nd table row *****/
HTM_TR_End (); HTM_TR_End ();

View File

@ -1601,27 +1601,10 @@ void Agd_GetAndShowAgendasStats (void)
/***** Write number of users who have chosen each language *****/ /***** Write number of users who have chosen each language *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumEvents);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs);
HTM_Unsigned (NumEvents); HTM_TD_Percentage (NumUsrs,NumUsrsTotal);
HTM_TD_End (); HTM_TD_Ratio (NumEvents,NumUsrs);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumUsrs);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs * 100.0 /
(double) NumUsrsTotal :
0);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumUsrs ? (double) NumEvents /
(double) NumUsrs :
0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -1778,14 +1778,13 @@ void Asg_GetAndShowAssignmentsStats (void)
extern const char *Txt_Number_of_BR_notifications; extern const char *Txt_Number_of_BR_notifications;
unsigned NumAssignments; unsigned NumAssignments;
unsigned NumNotif; unsigned NumNotif;
unsigned NumCoursesWithAssignments = 0; unsigned NumCoursesWithAssignments;
double NumAssignmentsPerCourse = 0.0;
/***** Get the number of assignments from this location *****/ /***** Get the number of assignments from this location *****/
if ((NumAssignments = Asg_GetNumAssignments (Gbl.Scope.Current,&NumNotif))) if ((NumAssignments = Asg_GetNumAssignments (Gbl.Scope.Current,&NumNotif)))
if ((NumCoursesWithAssignments = Asg_DB_GetNumCoursesWithAssignments (Gbl.Scope.Current)) != 0) NumCoursesWithAssignments = Asg_DB_GetNumCoursesWithAssignments (Gbl.Scope.Current);
NumAssignmentsPerCourse = (double) NumAssignments / else
(double) NumCoursesWithAssignments; NumCoursesWithAssignments = 0;
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_ASSIGNMENTS], Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_ASSIGNMENTS],
@ -1802,23 +1801,10 @@ void Asg_GetAndShowAssignmentsStats (void)
/***** Write number of assignments *****/ /***** Write number of assignments *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumAssignments);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCoursesWithAssignments);
HTM_Unsigned (NumAssignments); HTM_TD_Ratio (NumAssignments,NumCoursesWithAssignments);
HTM_TD_End (); HTM_TD_Unsigned (NumNotif);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumCoursesWithAssignments);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumAssignmentsPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumNotif);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -10218,13 +10218,8 @@ void Brw_GetAndShowOERsStats (void)
HTM_Txt (Txt_LICENSES[License]); HTM_Txt (Txt_LICENSES[License]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_UnsignedLong (NumFiles[0]);
HTM_UnsignedLong (NumFiles[0]); HTM_TD_UnsignedLong (NumFiles[1]);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_UnsignedLong (NumFiles[1]);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -394,15 +394,8 @@ void Cal_GetAndShowNumUsrsPerFirstDayOfWeek (void)
free (Icon); free (Icon);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[FirstDayOfWeek]);
HTM_Unsigned (NumUsrs[FirstDayOfWeek]); HTM_TD_Percentage (NumUsrs[FirstDayOfWeek],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[FirstDayOfWeek] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -875,19 +875,13 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
HTM_TD_End (); HTM_TD_End ();
/* Number of users who claim to belong to this center */ /* Number of users who claim to belong to this center */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrsCtr);
HTM_Unsigned (NumUsrsCtr);
HTM_TD_End ();
/* Number of degrees */ /* Number of degrees */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumDegs);
HTM_Unsigned (NumDegs);
HTM_TD_End ();
/* Number of users in courses of this center */ /* Number of users in courses of this center */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrsInCrssOfCtr);
HTM_Unsigned (NumUsrsInCrssOfCtr);
HTM_TD_End ();
/* Center requester */ /* Center requester */
UsrDat.UsrCod = Ctr->RequesterUsrCod; UsrDat.UsrCod = Ctr->RequesterUsrCod;
@ -992,8 +986,7 @@ void Ctr_RemoveCenter (void)
Hie_FlushCacheNumUsrsWhoClaimToBelongTo (Hie_CTR); Hie_FlushCacheNumUsrsWhoClaimToBelongTo (Hie_CTR);
/***** Write message to show the change made *****/ /***** Write message to show the change made *****/
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_Center_X_removed,
Txt_Center_X_removed,
Ctr_EditingCtr->FullName); Ctr_EditingCtr->FullName);
Ctr_EditingCtr->HieCod = -1L; // To not showing button to go to center Ctr_EditingCtr->HieCod = -1L; // To not showing button to go to center
@ -1027,8 +1020,7 @@ void Ctr_ChangeCtrPlc (void)
/***** Create alert to show the change made /***** Create alert to show the change made
and put button to go to center changed *****/ and put button to go to center changed *****/
Ale_CreateAlert (Ale_SUCCESS,NULL, Ale_CreateAlert (Ale_SUCCESS,NULL,Txt_The_place_of_the_center_has_changed);
Txt_The_place_of_the_center_has_changed);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1310,19 +1302,13 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
HTM_TD_End (); HTM_TD_End ();
/***** Number of users who claim to belong to this center *****/ /***** Number of users who claim to belong to this center *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Number of degrees *****/ /***** Number of degrees *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Number of users in courses of this center *****/ /***** Number of users in courses of this center *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Center requester *****/ /***** Center requester *****/
HTM_TD_Begin ("class=\"DAT_%s INPUT_REQUESTER LT\"", HTM_TD_Begin ("class=\"DAT_%s INPUT_REQUESTER LT\"",

View File

@ -633,10 +633,11 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod') "can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/ */
#define Log_PLATFORM_VERSION "SWAD 23.35.2 (2023-10-11)" #define Log_PLATFORM_VERSION "SWAD 23.36 (2023-10-11)"
#define CSS_FILE "swad23.35.1.css" #define CSS_FILE "swad23.35.1.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
Version 23.36: Oct 11, 2023 Code refactoring in HTML. (335342 lines)
Version 23.35.2: Oct 11, 2023 Fixed bugs in short/full names. (335550 lines) Version 23.35.2: Oct 11, 2023 Fixed bugs in short/full names. (335550 lines)
Version 23.35.1: Oct 11, 2023 Changes in CSS related to short/full names. (335550 lines) Version 23.35.1: Oct 11, 2023 Changes in CSS related to short/full names. (335550 lines)
Version 23.35: Oct 10, 2023 Fixed bugs in short/full names. (335549 lines) Version 23.35: Oct 10, 2023 Fixed bugs in short/full names. (335549 lines)

View File

@ -222,15 +222,8 @@ void Coo_GetAndShowNumUsrsPerCookies (void)
*Accepted[RefAcc].Title,"ICOx16"); *Accepted[RefAcc].Title,"ICOx16");
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[RefAcc]);
HTM_Unsigned (NumUsrs[RefAcc]); HTM_TD_Percentage (NumUsrs[RefAcc],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[RefAcc] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -241,94 +241,68 @@ void Cty_ListCountries2 (void)
/***** Write users and institutions in other countries *****/ /***** Write users and institutions in other countries *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Empty (1);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ());
HTM_Txt (Txt_Other_countries); HTM_Txt (Txt_Other_countries);
HTM_TD_End (); HTM_TD_End ();
/* Number of users who claim to belong to another country */ /* Number of users who claim to belong to another country */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Cty_GetCachedNumUsrsWhoClaimToBelongToAnotherCty ());
HTM_Unsigned (Cty_GetCachedNumUsrsWhoClaimToBelongToAnotherCty ());
HTM_TD_End ();
/* Number of institutions in other countries */ /* Number of institutions in other countries */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_INS, // Number of institutions...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_INS, // Number of institutions... Hie_CTY,0)); // ...in other countries
Hie_CTY,0)); // ...in other countries
HTM_TD_End ();
/* Number of centers in other countries */ /* Number of centers in other countries */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers... Hie_CTY,0)); // ...in other countries
Hie_CTY,0)); // ...in other countries
HTM_TD_End ();
/* Number of degrees in other countries */ /* Number of degrees in other countries */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_DEG, // Number of degrees...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_DEG, // Number of degrees... Hie_CTY,0)); // ...in other countries
Hie_CTY,0)); // ...in other countries
HTM_TD_End ();
/* Number of courses in other countries */ /* Number of courses in other countries */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CRS, // Number of courses...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CRS, // Number of courses... Hie_CTY,0)); // ...in other countries
Hie_CTY,0)); // ...in other countries
HTM_TD_End ();
/* Number of users in courses of other countries */ /* Number of users in courses of other countries */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Enr_GetCachedNumUsrsInCrss (Hie_CTY,0,
HTM_Unsigned (Enr_GetCachedNumUsrsInCrss (Hie_CTY,0, 1 << Rol_STD |
1 << Rol_STD | 1 << Rol_NET |
1 << Rol_NET | 1 << Rol_TCH)); // Any user
1 << Rol_TCH)); // Any user
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** Write users and institutions with unknown country *****/ /***** Write users and institutions with unknown country *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Empty (1);
HTM_TD_End ();
HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ());
HTM_Txt (Txt_Country_unspecified); HTM_Txt (Txt_Country_unspecified);
HTM_TD_End (); HTM_TD_End ();
/* Number of users who do not claim to belong to any country */ /* Number of users who do not claim to belong to any country */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Cty_GetCachedNumUsrsWhoDontClaimToBelongToAnyCty ());
HTM_Unsigned (Cty_GetCachedNumUsrsWhoDontClaimToBelongToAnyCty ());
HTM_TD_End ();
/* Number of institutions with unknown country */ /* Number of institutions with unknown country */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_INS, // Number of institutions...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_INS, // Number of institutions...
Hie_CTY,-1L)); // ...with unknown country Hie_CTY,-1L)); // ...with unknown country
HTM_TD_End ();
/* Number of centers with unknown country */ /* Number of centers with unknown country */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CTR, // Number of centers...
Hie_CTY,-1L)); // ...with unknown country Hie_CTY,-1L)); // ...with unknown country
HTM_TD_End ();
/* Number of degrees with unknown country */ /* Number of degrees with unknown country */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_DEG, // Number of degrees...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_DEG, // Number of degrees...
Hie_CTY,-1L)); // ...with unknown country Hie_CTY,-1L)); // ...with unknown country
HTM_TD_End ();
/* Number of courses with unknown country */ /* Number of courses with unknown country */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CRS, // Number of courses...
HTM_Unsigned (Hie_GetCachedNumNodesInHieLvl (Hie_CRS, // Number of courses...
Hie_CTY,-1L)); // ...with unknown country Hie_CTY,-1L)); // ...with unknown country
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -1022,15 +1022,11 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
ICanEdit); // Put form? ICanEdit); // Put form?
/* Current number of teachers in this course */ /* Current number of teachers in this course */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[Rol_TCH] +
HTM_Unsigned (NumUsrs[Rol_TCH] +
NumUsrs[Rol_NET]); NumUsrs[Rol_NET]);
HTM_TD_End ();
/* Current number of students in this course */ /* Current number of students in this course */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[Rol_STD]);
HTM_Unsigned (NumUsrs[Rol_STD]);
HTM_TD_End ();
/* Course requester */ /* Course requester */
UsrDat.UsrCod = Crs->RequesterUsrCod; UsrDat.UsrCod = Crs->RequesterUsrCod;
@ -1133,14 +1129,10 @@ static void Crs_PutFormToCreateCourse (void)
Nam_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Current number of teachers in this course *****/ /***** Current number of teachers in this course *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Current number of students in this course *****/ /***** Current number of students in this course *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Course requester *****/ /***** Course requester *****/
HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",The_GetSuffix ());

View File

@ -455,14 +455,10 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
HTM_TD_End (); HTM_TD_End ();
/* Number of courses in this degree */ /* Number of courses in this degree */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCrss);
HTM_Unsigned (NumCrss);
HTM_TD_End ();
/* Number of users in courses of this degree */ /* Number of users in courses of this degree */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrsInCrssOfDeg);
HTM_Unsigned (NumUsrsInCrssOfDeg);
HTM_TD_End ();
/* Degree requester */ /* Degree requester */
UsrDat.UsrCod = Deg->RequesterUsrCod; UsrDat.UsrCod = Deg->RequesterUsrCod;
@ -577,14 +573,10 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
HTM_TD_End (); HTM_TD_End ();
/***** Number of courses in this degree *****/ /***** Number of courses in this degree *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Number of users in courses of this degree *****/ /***** Number of users in courses of this degree *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Degree requester *****/ /***** Degree requester *****/
HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",

View File

@ -432,9 +432,7 @@ static void DegTyp_ListDegreeTypesForEdition (const struct DegTyp_DegTypes *DegT
HTM_TD_End (); HTM_TD_End ();
/* Number of degrees of this type */ /* Number of degrees of this type */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (DegTypes->Lst[NumDegTyp].NumDegs);
HTM_Unsigned (DegTypes->Lst[NumDegTyp].NumDegs);
HTM_TD_End ();
/* End table row */ /* End table row */
HTM_TR_End (); HTM_TR_End ();
@ -486,9 +484,7 @@ static void DegTyp_PutFormToCreateDegreeType (void)
HTM_TD_End (); HTM_TD_End ();
/***** Number of degrees of this degree type ****/ /***** Number of degrees of this degree type ****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** End table row *****/ /***** End table row *****/
HTM_TR_End (); HTM_TR_End ();

View File

@ -196,9 +196,7 @@ void Dpt_SeeAllDepts (void)
HTM_A_End (); HTM_A_End ();
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Departments.Lst[NumDpt].NumTchs);
HTM_Unsigned (Departments.Lst[NumDpt].NumTchs);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }
@ -220,9 +218,7 @@ void Dpt_SeeAllDepts (void)
HTM_Txt (Txt_Other_departments); HTM_Txt (Txt_Other_departments);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumTchsInsInOtherDpts);
HTM_Unsigned (NumTchsInsInOtherDpts);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
@ -235,9 +231,7 @@ void Dpt_SeeAllDepts (void)
HTM_Txt (Txt_Department_unspecified); HTM_Txt (Txt_Department_unspecified);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumTchsInsWithNoDpt);
HTM_Unsigned (NumTchsInsWithNoDpt);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
@ -553,9 +547,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
HTM_TD_End (); HTM_TD_End ();
/* Number of teachers */ /* Number of teachers */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Dpt->NumTchs);
HTM_Unsigned (Dpt->NumTchs);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }
@ -852,9 +844,7 @@ static void Dpt_PutFormToCreateDepartment (void)
HTM_TD_End (); HTM_TD_End ();
/***** Number of teachers *****/ /***** Number of teachers *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -1583,13 +1583,13 @@ void Exa_GetAndShowExamsStats (void)
extern const char *Txt_Number_of_BR_courses_with_BR_exams; extern const char *Txt_Number_of_BR_courses_with_BR_exams;
extern const char *Txt_Average_number_BR_of_exams_BR_per_course; extern const char *Txt_Average_number_BR_of_exams_BR_per_course;
unsigned NumExams; unsigned NumExams;
unsigned NumCoursesWithExams = 0; unsigned NumCoursesWithExams;
double NumExamsPerCourse = 0.0;
/***** Get the number of exams from this location *****/ /***** Get the number of exams from this location *****/
if ((NumExams = Exa_DB_GetNumExams (Gbl.Scope.Current))) if ((NumExams = Exa_DB_GetNumExams (Gbl.Scope.Current)))
if ((NumCoursesWithExams = Exa_DB_GetNumCoursesWithExams (Gbl.Scope.Current)) != 0) NumCoursesWithExams = Exa_DB_GetNumCoursesWithExams (Gbl.Scope.Current);
NumExamsPerCourse = (double) NumExams / (double) NumCoursesWithExams; else
NumCoursesWithExams = 0;
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_EXAMS], Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_EXAMS],
@ -1605,19 +1605,9 @@ void Exa_GetAndShowExamsStats (void)
/***** Write number of exams *****/ /***** Write number of exams *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumExams);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCoursesWithExams);
HTM_Unsigned (NumExams); HTM_TD_Ratio (NumExams,NumCoursesWithExams);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumCoursesWithExams);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumExamsPerCourse);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -1217,15 +1217,8 @@ void Fol_GetAndShowFollowStats (void)
Txt_Followers); Txt_Followers);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs);
HTM_Unsigned (NumUsrs); HTM_TD_Percentage (NumUsrs,NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }
@ -1244,9 +1237,7 @@ void Fol_GetAndShowFollowStats (void)
HTM_Txt (Txt_FollowPerFollow[Fol]); HTM_Txt (Txt_FollowPerFollow[Fol]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Double2Decimals (Average);
HTM_Double2Decimals (Average);
HTM_TD_End ();
HTM_TD_Empty (1); HTM_TD_Empty (1);

View File

@ -2243,13 +2243,13 @@ void Gam_GetAndShowGamesStats (void)
extern const char *Txt_Number_of_BR_courses_with_BR_games; extern const char *Txt_Number_of_BR_courses_with_BR_games;
extern const char *Txt_Average_number_BR_of_games_BR_per_course; extern const char *Txt_Average_number_BR_of_games_BR_per_course;
unsigned NumGames; unsigned NumGames;
unsigned NumCoursesWithGames = 0; unsigned NumCoursesWithGames;
double NumGamesPerCourse = 0.0;
/***** Get the number of games from this location *****/ /***** Get the number of games from this location *****/
if ((NumGames = Gam_DB_GetNumGames (Gbl.Scope.Current))) if ((NumGames = Gam_DB_GetNumGames (Gbl.Scope.Current)))
if ((NumCoursesWithGames = Gam_DB_GetNumCoursesWithGames (Gbl.Scope.Current)) != 0) NumCoursesWithGames = Gam_DB_GetNumCoursesWithGames (Gbl.Scope.Current);
NumGamesPerCourse = (double) NumGames / (double) NumCoursesWithGames; else
NumCoursesWithGames = 0;
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_GAMES], Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_GAMES],
@ -2265,19 +2265,9 @@ void Gam_GetAndShowGamesStats (void)
/***** Write number of games *****/ /***** Write number of games *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumGames);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCoursesWithGames);
HTM_Unsigned (NumGames); HTM_TD_Ratio (NumGames,NumCoursesWithGames);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumCoursesWithGames);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumGamesPerCourse);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -618,15 +618,8 @@ void Ico_GetAndShowNumUsrsPerIconSet (void)
free (URL); free (URL);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[IconSet]);
HTM_Unsigned (NumUsrs[IconSet]); HTM_TD_Percentage (NumUsrs[IconSet],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[IconSet] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -982,19 +982,13 @@ static void Ins_ListInstitutionsForEdition (void)
HTM_TD_End (); HTM_TD_End ();
/* Number of users who claim to belong to this institution */ /* Number of users who claim to belong to this institution */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrsIns);
HTM_Unsigned (NumUsrsIns);
HTM_TD_End ();
/* Number of centers */ /* Number of centers */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCtrs);
HTM_Unsigned (NumCtrs);
HTM_TD_End ();
/* Number of users in courses of this institution */ /* Number of users in courses of this institution */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrsInCrssOfIns);
HTM_Unsigned (NumUsrsInCrssOfIns);
HTM_TD_End ();
/* Institution requester */ /* Institution requester */
HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",
@ -1372,28 +1366,20 @@ static void Ins_PutFormToCreateInstitution (void)
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
HTM_INPUT_URL ("WWW",Ins_EditingIns->WWW,HTM_DONT_SUBMIT_ON_CHANGE, HTM_INPUT_URL ("WWW",Ins_EditingIns->WWW,HTM_DONT_SUBMIT_ON_CHANGE,
"class=\"INPUT_WWW_NARROW INPUT_%s\"" "class=\"INPUT_WWW_NARROW INPUT_%s\""
" required=\"required\"", " required=\"required\"",The_GetSuffix ());
The_GetSuffix ());
HTM_TD_End (); HTM_TD_End ();
/***** Number of users who claim to belong to this institution ****/ /***** Number of users who claim to belong to this institution ****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Number of centers *****/ /***** Number of centers *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Number of users in courses of this institution ****/ /***** Number of users in courses of this institution ****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
/***** Institution requester *****/ /***** Institution requester *****/
HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",The_GetSuffix ());
The_GetSuffix ());
Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED); Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED);
HTM_TD_End (); HTM_TD_End ();

View File

@ -305,15 +305,8 @@ void Lan_GetAndShowNumUsrsPerLanguage (void)
HTM_Txt (Txt_STR_LANG_NAME[Lan]); HTM_Txt (Txt_STR_LANG_NAME[Lan]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[Lan]);
HTM_Unsigned (NumUsrs[Lan]); HTM_TD_Percentage (NumUsrs[Lan],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Lan] * 100.0 /
(double) NumUsrsTotal :
0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -1782,15 +1782,8 @@ void Lay_GetAndShowNumUsrsPerSideColumns (void)
free (Icon); free (Icon);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[SideCols]);
HTM_Unsigned (NumUsrs[SideCols]); HTM_TD_Percentage (NumUsrs[SideCols],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[SideCols] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -504,9 +504,7 @@ static void Mai_ListMailDomainsForEdition (const struct Mai_Mails *Mails)
HTM_TD_End (); HTM_TD_End ();
/* Number of users */ /* Number of users */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Mai->NumUsrs);
HTM_Unsigned (Mai->NumUsrs);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }
@ -716,9 +714,7 @@ static void Mai_PutFormToCreateMailDomain (void)
HTM_TD_End (); HTM_TD_End ();
/* Number of users */ /* Number of users */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -458,15 +458,8 @@ void Mnu_GetAndShowNumUsrsPerMenu (void)
Txt_MENU_NAMES[Menu],"ICOx20"); Txt_MENU_NAMES[Menu],"ICOx20");
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[Menu]);
HTM_Unsigned (NumUsrs[Menu]); HTM_TD_Percentage (NumUsrs[Menu],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Menu] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -819,7 +819,7 @@ void Msg_RecMsgFromUsr (void)
while (*Ptr) while (*Ptr)
{ {
Par_GetNextStrUntilSeparParMult (&Ptr,UsrDstData.EnUsrCod, Par_GetNextStrUntilSeparParMult (&Ptr,UsrDstData.EnUsrCod,
Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64); Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDstData); Usr_GetUsrCodFromEncryptedUsrCod (&UsrDstData);
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDstData, // Get recipient's data from database if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDstData, // Get recipient's data from database
Usr_DONT_GET_PREFS, Usr_DONT_GET_PREFS,

View File

@ -218,15 +218,8 @@ void PhoSha_GetAndShowNumUsrsPerPhotoShape (void)
Ico_GetPreffix (Ico_BLACK),The_GetSuffix ()); Ico_GetPreffix (Ico_BLACK),The_GetSuffix ());
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[Shape]);
HTM_Unsigned (NumUsrs[Shape]); HTM_TD_Percentage (NumUsrs[Shape],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Shape] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -213,12 +213,10 @@ void Plc_SeeAllPlaces (void)
HTM_Txt (Txt_Place_unspecified); HTM_Txt (Txt_Place_unspecified);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Hie_GetNumNodesInHieLvl (Hie_CTR, // Number of centers...
HTM_Unsigned (Hie_GetNumNodesInHieLvl (Hie_CTR, // Number of centers...
Hie_INS, // ...in institution Hie_INS, // ...in institution
Gbl.Hierarchy.Node[Hie_INS].HieCod) - Gbl.Hierarchy.Node[Hie_INS].HieCod) -
NumCtrsWithPlc); NumCtrsWithPlc);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
@ -492,9 +490,7 @@ static void Plc_ListPlacesForEdition (const struct Plc_Places *Places)
true); // Put form true); // Put form
/* Number of centers */ /* Number of centers */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Plc->NumCtrs);
HTM_Unsigned (Plc->NumCtrs);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }
@ -635,8 +631,7 @@ static void Plc_RenamePlace (Nam_ShrtOrFullName_t ShrtOrFull)
Ale_CreateAlertYouCanNotLeaveFieldEmpty (); Ale_CreateAlertYouCanNotLeaveFieldEmpty ();
/***** Update place name *****/ /***** Update place name *****/
Str_Copy (CurrentName[ShrtOrFull],NewName, Str_Copy (CurrentName[ShrtOrFull],NewName,Nam_MaxBytes[ShrtOrFull]);
Nam_MaxBytes[ShrtOrFull]);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -685,9 +680,7 @@ static void Plc_PutFormToCreatePlace (void)
Nam_NewShortAndFullNames (Names); Nam_NewShortAndFullNames (Names);
/***** Number of centers *****/ /***** Number of centers *****/
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (0);
HTM_Unsigned (0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -372,15 +372,8 @@ static void Pri_GetAndShowNumUsrsPerPrivacyForAnObject (const char *TxtObject,
HTM_Txt (Txt_PRIVACY_OPTIONS[Visibility]); HTM_Txt (Txt_PRIVACY_OPTIONS[Visibility]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[Visibility]);
HTM_Unsigned (NumUsrs[Visibility]); HTM_TD_Percentage (NumUsrs[Visibility],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Visibility] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -2224,14 +2224,13 @@ void Prg_GetAndShowCourseProgramStats (void)
extern const char *Txt_Number_of_BR_courses_with_BR_program_items; extern const char *Txt_Number_of_BR_courses_with_BR_program_items;
extern const char *Txt_Average_number_BR_of_items_BR_per_course; extern const char *Txt_Average_number_BR_of_items_BR_per_course;
unsigned NumItems; unsigned NumItems;
unsigned NumCoursesWithItems = 0; unsigned NumCoursesWithItems;
double NumItemsPerCourse = 0.0;
/***** Get the number of program items from this location *****/ /***** Get the number of program items from this location *****/
if ((NumItems = Prg_DB_GetNumItems (Gbl.Scope.Current))) if ((NumItems = Prg_DB_GetNumItems (Gbl.Scope.Current)))
if ((NumCoursesWithItems = Prg_DB_GetNumCoursesWithItems (Gbl.Scope.Current)) != 0) NumCoursesWithItems = Prg_DB_GetNumCoursesWithItems (Gbl.Scope.Current);
NumItemsPerCourse = (double) NumItems / else
(double) NumCoursesWithItems; NumCoursesWithItems = 0;
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_COURSE_PROGRAMS], Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_COURSE_PROGRAMS],
@ -2247,19 +2246,9 @@ void Prg_GetAndShowCourseProgramStats (void)
/***** Write number of assignments *****/ /***** Write number of assignments *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumItems);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCoursesWithItems);
HTM_Unsigned (NumItems); HTM_TD_Ratio (NumItems,NumCoursesWithItems);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumCoursesWithItems);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumItemsPerCourse);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -4720,14 +4720,13 @@ void Prj_GetAndShowProjectsStats (void)
extern const char *Txt_Number_of_BR_courses_with_BR_projects; extern const char *Txt_Number_of_BR_courses_with_BR_projects;
extern const char *Txt_Average_number_BR_of_projects_BR_per_course; extern const char *Txt_Average_number_BR_of_projects_BR_per_course;
unsigned NumProjects; unsigned NumProjects;
unsigned NumCoursesWithProjects = 0; unsigned NumCoursesWithProjects;
double NumProjectsPerCourse = 0.0;
/***** Get the number of projects from this location *****/ /***** Get the number of projects from this location *****/
if ((NumProjects = Prj_DB_GetNumProjects (Gbl.Scope.Current))) if ((NumProjects = Prj_DB_GetNumProjects (Gbl.Scope.Current)))
if ((NumCoursesWithProjects = Prj_DB_GetNumCoursesWithProjects (Gbl.Scope.Current)) != 0) NumCoursesWithProjects = Prj_DB_GetNumCoursesWithProjects (Gbl.Scope.Current);
NumProjectsPerCourse = (double) NumProjects / else
(double) NumCoursesWithProjects; NumCoursesWithProjects = 0;
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_PROJECTS], Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_PROJECTS],
@ -4743,19 +4742,9 @@ void Prj_GetAndShowProjectsStats (void)
/***** Write number of projects *****/ /***** Write number of projects *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumProjects);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCoursesWithProjects);
HTM_Unsigned (NumProjects); HTM_TD_Ratio (NumProjects,NumCoursesWithProjects);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumCoursesWithProjects);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumProjectsPerCourse);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -1121,18 +1121,20 @@ void Rub_GetAndShowRubricsStats (void)
extern const char *Txt_Average_number_BR_of_rubrics_BR_per_course; extern const char *Txt_Average_number_BR_of_rubrics_BR_per_course;
extern const char *Txt_Average_number_BR_of_criteria_BR_per_rubric; extern const char *Txt_Average_number_BR_of_criteria_BR_per_rubric;
unsigned NumRubrics; unsigned NumRubrics;
unsigned NumCoursesWithRubrics = 0; unsigned NumCoursesWithRubrics;
double NumRubricsPerCourse = 0.0; double NumCriteriaPerRubric;
double NumCriteriaPerRubric = 0.0;
/***** Get the number of rubrics from this location *****/ /***** Get the number of rubrics from this location *****/
if ((NumRubrics = Rub_DB_GetNumRubrics (Gbl.Scope.Current))) if ((NumRubrics = Rub_DB_GetNumRubrics (Gbl.Scope.Current)))
{ {
if ((NumCoursesWithRubrics = Rub_DB_GetNumCoursesWithRubrics (Gbl.Scope.Current)) != 0) NumCoursesWithRubrics = Rub_DB_GetNumCoursesWithRubrics (Gbl.Scope.Current);
NumRubricsPerCourse = (double) NumRubrics /
(double) NumCoursesWithRubrics;
NumCriteriaPerRubric = Rub_DB_GetNumCriteriaPerRubric (Gbl.Scope.Current); NumCriteriaPerRubric = Rub_DB_GetNumCriteriaPerRubric (Gbl.Scope.Current);
} }
else
{
NumCoursesWithRubrics = 0;
NumCriteriaPerRubric = 0.0;
}
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_RUBRICS], Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_RUBRICS],
@ -1149,23 +1151,10 @@ void Rub_GetAndShowRubricsStats (void)
/***** Write number of rubrics *****/ /***** Write number of rubrics *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumRubrics);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCoursesWithRubrics);
HTM_Unsigned (NumRubrics); HTM_TD_Ratio (NumRubrics,NumCoursesWithRubrics);
HTM_TD_End (); HTM_TD_Double2Decimals (NumCriteriaPerRubric);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumCoursesWithRubrics);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumRubricsPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumCriteriaPerRubric);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -3297,18 +3297,20 @@ void Svy_GetAndShowSurveysStats (void)
extern const char *Txt_Number_of_BR_notifications; extern const char *Txt_Number_of_BR_notifications;
unsigned NumSurveys; unsigned NumSurveys;
unsigned NumNotif; unsigned NumNotif;
unsigned NumCoursesWithSurveys = 0; unsigned NumCoursesWithSurveys;
double NumSurveysPerCourse = 0.0; double NumQstsPerSurvey;
double NumQstsPerSurvey = 0.0;
/***** Get the number of surveys and the average number of questions per survey from this location *****/ /***** Get the number of surveys and the average number of questions per survey from this location *****/
if ((NumSurveys = Svy_GetNumCrsSurveys (Gbl.Scope.Current,&NumNotif))) if ((NumSurveys = Svy_GetNumCrsSurveys (Gbl.Scope.Current,&NumNotif)))
{ {
if ((NumCoursesWithSurveys = Svy_DB_GetNumCrssWithCrsSurveys (Gbl.Scope.Current)) != 0) NumCoursesWithSurveys = Svy_DB_GetNumCrssWithCrsSurveys (Gbl.Scope.Current);
NumSurveysPerCourse = (double) NumSurveys /
(double) NumCoursesWithSurveys;
NumQstsPerSurvey = Svy_DB_GetNumQstsPerCrsSurvey (Gbl.Scope.Current); NumQstsPerSurvey = Svy_DB_GetNumQstsPerCrsSurvey (Gbl.Scope.Current);
} }
else
{
NumCoursesWithSurveys = 0;
NumQstsPerSurvey = 0.0;
}
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_SURVEYS], Box_BoxTableBegin (NULL,Txt_FIGURE_TYPES[Fig_SURVEYS],
@ -3326,27 +3328,11 @@ void Svy_GetAndShowSurveysStats (void)
/***** Write number of surveys *****/ /***** Write number of surveys *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TD_Unsigned (NumSurveys);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumCoursesWithSurveys);
HTM_Unsigned (NumSurveys); HTM_TD_Ratio (NumSurveys,NumCoursesWithSurveys);
HTM_TD_End (); HTM_TD_Double2Decimals (NumQstsPerSurvey);
HTM_TD_Unsigned (NumNotif);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumCoursesWithSurveys);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumSurveysPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumQstsPerSurvey);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumNotif);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
/***** End table and box *****/ /***** End table and box *****/

View File

@ -786,9 +786,7 @@ void Tst_GetAndShowTestsStats (void)
HTM_Txt (Txt_TST_STR_ANSWER_TYPES[AnsType]); HTM_Txt (Txt_TST_STR_ANSWER_TYPES[AnsType]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Stats.NumCoursesWithQuestions);
HTM_Unsigned (Stats.NumCoursesWithQuestions);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_TxtF ("%u (%.1lf%%)", HTM_TxtF ("%u (%.1lf%%)",
@ -798,29 +796,12 @@ void Tst_GetAndShowTestsStats (void)
0.0); 0.0);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (Stats.NumQsts);
HTM_Unsigned (Stats.NumQsts); HTM_TD_Double2Decimals (Stats.AvgQstsPerCourse);
HTM_TD_End (); HTM_TD_UnsignedLong (Stats.NumHits);
HTM_TD_Double2Decimals (Stats.AvgHitsPerCourse);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Double2Decimals (Stats.AvgHitsPerQuestion);
HTM_Double2Decimals (Stats.AvgQstsPerCourse); HTM_TD_Double2Decimals (Stats.AvgScorePerQuestion);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_UnsignedLong (Stats.NumHits);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (Stats.AvgHitsPerCourse);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (Stats.AvgHitsPerQuestion);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (Stats.AvgScorePerQuestion);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -326,15 +326,8 @@ void The_GetAndShowNumUsrsPerTheme (void)
free (URL); free (URL);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumUsrs[Theme]);
HTM_Unsigned (NumUsrs[Theme]); HTM_TD_Percentage (NumUsrs[Theme],NumUsrsTotal);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs[Theme] * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -605,26 +605,10 @@ void Tml_GetAndShowTimelineActivityStats (void)
HTM_Txt (Txt_TIMELINE_NOTE[NoteType]); HTM_Txt (Txt_TIMELINE_NOTE[NoteType]);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Unsigned (NumNotes);
HTM_Unsigned (NumNotes); HTM_TD_Unsigned (NumUsrs);
HTM_TD_End (); HTM_TD_Percentage (NumUsrs,NumUsrsTotal);
HTM_TD_Ratio (NumNotes,NumUsrs);
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (NumUsrs);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Percentage (NumUsrsTotal ? (double) NumUsrs * 100.0 /
(double) NumUsrsTotal :
0.0);
HTM_TD_End ();
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Double2Decimals (NumUsrs ? (double) NumNotes /
(double) NumUsrs :
0.0);
HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
} }

View File

@ -3118,7 +3118,7 @@ void Usr_GetListsSelectedEncryptedUsrsCods (struct Usr_SelectedUsrs *SelectedUsr
if (Gbl.Session.IsOpen) // If the session is open, get parameter from DB if (Gbl.Session.IsOpen) // If the session is open, get parameter from DB
{ {
Ses_DB_GetPar (ParName,SelectedUsrs->List[Rol_UNK], Ses_DB_GetPar (ParName,SelectedUsrs->List[Rol_UNK],
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
Str_ChangeFormat (Str_FROM_FORM,Str_TO_TEXT,SelectedUsrs->List[Rol_UNK], Str_ChangeFormat (Str_FROM_FORM,Str_TO_TEXT,SelectedUsrs->List[Rol_UNK],
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS, Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS,
Str_REMOVE_SPACES); Str_REMOVE_SPACES);