mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-05 00:05:23 +02:00
Version19.91.2
This commit is contained in:
parent
35afdec6a2
commit
567b992a6d
15
swad_HTML.c
15
swad_HTML.c
|
@ -1770,6 +1770,21 @@ void HTM_Long (long Num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTM_Double (double Num)
|
void HTM_Double (double Num)
|
||||||
|
{
|
||||||
|
char *Str;
|
||||||
|
|
||||||
|
/***** Write from floating point number to string
|
||||||
|
with the correct accuracy *****/
|
||||||
|
Str_DoubleNumToStr (&Str,Num);
|
||||||
|
|
||||||
|
/***** Write number from string to file *****/
|
||||||
|
HTM_Txt (Str);
|
||||||
|
|
||||||
|
/***** Free memory allocated for string *****/
|
||||||
|
free (Str);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HTM_Double2Decimals (double Num)
|
||||||
{
|
{
|
||||||
HTM_TxtF ("%.2lf",Num);
|
HTM_TxtF ("%.2lf",Num);
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,6 +179,7 @@ void HTM_Int (int Num);
|
||||||
void HTM_UnsignedLong (unsigned long Num);
|
void HTM_UnsignedLong (unsigned long Num);
|
||||||
void HTM_Long (long Num);
|
void HTM_Long (long Num);
|
||||||
void HTM_Double (double Num);
|
void HTM_Double (double Num);
|
||||||
|
void HTM_Double2Decimals (double Num);
|
||||||
void HTM_Percentage (double Percentage);
|
void HTM_Percentage (double Percentage);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -490,13 +490,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.91.1 (2019-12-14)"
|
#define Log_PLATFORM_VERSION "SWAD 19.91.2 (2019-12-14)"
|
||||||
#define CSS_FILE "swad19.90.1.css"
|
#define CSS_FILE "swad19.90.1.css"
|
||||||
#define JS_FILE "swad19.91.1.js"
|
#define JS_FILE "swad19.91.1.js"
|
||||||
/*
|
/*
|
||||||
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
|
||||||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||||
|
|
||||||
|
Version 19.91.2: Dec 14, 2019 Code refactoring related to doubles. (248538 lines)
|
||||||
Version 19.91.1: Dec 14, 2019 Changes in match layout. (248533 lines)
|
Version 19.91.1: Dec 14, 2019 Changes in match layout. (248533 lines)
|
||||||
Version 19.91: Dec 13, 2019 Changes in match countdown.
|
Version 19.91: Dec 13, 2019 Changes in match countdown.
|
||||||
Code refactoring in HTML. (248513 lines)
|
Code refactoring in HTML. (248513 lines)
|
||||||
|
|
|
@ -436,11 +436,11 @@ static void Fig_GetAndShowNumUsrsInCrss (Rol_Role_t Role)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s\"",Class);
|
HTM_TD_Begin ("class=\"%s\"",Class);
|
||||||
HTM_Double (NumCrssPerUsr);
|
HTM_Double2Decimals (NumCrssPerUsr);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s\"",Class);
|
HTM_TD_Begin ("class=\"%s\"",Class);
|
||||||
HTM_Double (NumUsrsPerCrs);
|
HTM_Double2Decimals (NumUsrsPerCrs);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -467,11 +467,11 @@ static void Fig_GetAndShowNumUsrsNotBelongingToAnyCrs (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s\"",Class);
|
HTM_TD_Begin ("class=\"%s\"",Class);
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"%s\"",Class);
|
HTM_TD_Begin ("class=\"%s\"",Class);
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -2979,7 +2979,7 @@ static void Fig_GetAndShowAssignmentsStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (NumAssignmentsPerCourse);
|
HTM_Double2Decimals (NumAssignmentsPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
|
@ -3038,7 +3038,7 @@ static void Fig_GetAndShowProjectsStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (NumProjectsPerCourse);
|
HTM_Double2Decimals (NumProjectsPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -3119,7 +3119,7 @@ static void Fig_GetAndShowTestsStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (Stats.AvgQstsPerCourse);
|
HTM_Double2Decimals (Stats.AvgQstsPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
|
@ -3127,15 +3127,15 @@ static void Fig_GetAndShowTestsStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (Stats.AvgHitsPerCourse);
|
HTM_Double2Decimals (Stats.AvgHitsPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (Stats.AvgHitsPerQuestion);
|
HTM_Double2Decimals (Stats.AvgHitsPerQuestion);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (Stats.AvgScorePerQuestion);
|
HTM_Double2Decimals (Stats.AvgScorePerQuestion);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -3168,7 +3168,7 @@ static void Fig_GetAndShowTestsStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (Stats.AvgQstsPerCourse);
|
HTM_Double2Decimals (Stats.AvgQstsPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
|
@ -3176,15 +3176,15 @@ static void Fig_GetAndShowTestsStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (Stats.AvgHitsPerCourse);
|
HTM_Double2Decimals (Stats.AvgHitsPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (Stats.AvgHitsPerQuestion);
|
HTM_Double2Decimals (Stats.AvgHitsPerQuestion);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (Stats.AvgScorePerQuestion);
|
HTM_Double2Decimals (Stats.AvgScorePerQuestion);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -3238,7 +3238,7 @@ static void Fig_GetAndShowGamesStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (NumGamesPerCourse);
|
HTM_Double2Decimals (NumGamesPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -3420,7 +3420,7 @@ static void Fig_GetAndShowTimelineActivityStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (NumUsrs ? (double) NumNotes / (double) NumUsrs :
|
HTM_Double2Decimals (NumUsrs ? (double) NumNotes / (double) NumUsrs :
|
||||||
0.0);
|
0.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -3540,7 +3540,7 @@ static void Fig_GetAndShowTimelineActivityStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (NumUsrs ? (double) NumNotes / (double) NumUsrs :
|
HTM_Double2Decimals (NumUsrs ? (double) NumNotes / (double) NumUsrs :
|
||||||
0.0);
|
0.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -3824,7 +3824,7 @@ static void Fig_GetAndShowFollowStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (Average);
|
HTM_Double2Decimals (Average);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Empty (1);
|
HTM_TD_Empty (1);
|
||||||
|
@ -4100,15 +4100,15 @@ static void Fig_WriteForumTitleAndStats (For_ForumType_t ForumType,
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RT\"");
|
HTM_TD_Begin ("class=\"DAT RT\"");
|
||||||
HTM_Double (NumThrsPerForum);
|
HTM_Double2Decimals (NumThrsPerForum);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RT\"");
|
HTM_TD_Begin ("class=\"DAT RT\"");
|
||||||
HTM_Double (NumPostsPerThread);
|
HTM_Double2Decimals (NumPostsPerThread);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RT\"");
|
HTM_TD_Begin ("class=\"DAT RT\"");
|
||||||
HTM_Double (NumPostsPerForum);
|
HTM_Double2Decimals (NumPostsPerForum);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -4163,15 +4163,15 @@ static void Fig_WriteForumTotalStats (struct Fig_FiguresForum *FiguresForum)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (NumThrsPerForum);
|
HTM_Double2Decimals (NumThrsPerForum);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (NumPostsPerThread);
|
HTM_Double2Decimals (NumPostsPerThread);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM\"");
|
||||||
HTM_Double (NumPostsPerForum);
|
HTM_Double2Decimals (NumPostsPerForum);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -4628,11 +4628,11 @@ static void Fig_GetAndShowSurveysStats (void)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (NumSurveysPerCourse);
|
HTM_Double2Decimals (NumSurveysPerCourse);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Double (NumQstsPerSurvey);
|
HTM_Double2Decimals (NumQstsPerSurvey);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
|
|
|
@ -3140,12 +3140,12 @@ static void Mch_DrawEmptyScoreRow (unsigned NumRow,double MinScore,double MaxSco
|
||||||
HTM_TD_Begin ("class=\"MCH_SCO_SCO\"");
|
HTM_TD_Begin ("class=\"MCH_SCO_SCO\"");
|
||||||
if (NumRow == 0)
|
if (NumRow == 0)
|
||||||
{
|
{
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,MaxScore);
|
HTM_Double (MaxScore);
|
||||||
HTM_NBSP ();
|
HTM_NBSP ();
|
||||||
}
|
}
|
||||||
else if (NumRow == Mch_NUM_ROWS_SCORE - 1)
|
else if (NumRow == Mch_NUM_ROWS_SCORE - 1)
|
||||||
{
|
{
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,MinScore);
|
HTM_Double (MinScore);
|
||||||
HTM_NBSP ();
|
HTM_NBSP ();
|
||||||
}
|
}
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -3214,7 +3214,7 @@ static void Mch_DrawScoreRow (double Score,double MinScore,double MaxScore,
|
||||||
|
|
||||||
/* Write score */
|
/* Write score */
|
||||||
HTM_TD_Begin ("class=\"MCH_SCO_SCO\"");
|
HTM_TD_Begin ("class=\"MCH_SCO_SCO\"");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,Score);
|
HTM_Double (Score);
|
||||||
HTM_NBSP ();
|
HTM_NBSP ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
|
|
@ -850,7 +850,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther,
|
||||||
/* Write score */
|
/* Write score */
|
||||||
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (ShowResultThisMatch)
|
if (ShowResultThisMatch)
|
||||||
HTM_Double (ScoreInThisResult);
|
HTM_Double2Decimals (ScoreInThisResult);
|
||||||
else
|
else
|
||||||
Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results);
|
Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -858,7 +858,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther,
|
||||||
/* Write average score per question */
|
/* Write average score per question */
|
||||||
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (ShowResultThisMatch)
|
if (ShowResultThisMatch)
|
||||||
HTM_Double (NumQstsInThisResult ? ScoreInThisResult /
|
HTM_Double2Decimals (NumQstsInThisResult ? ScoreInThisResult /
|
||||||
(double) NumQstsInThisResult :
|
(double) NumQstsInThisResult :
|
||||||
0.0);
|
0.0);
|
||||||
else
|
else
|
||||||
|
@ -958,18 +958,18 @@ static void McR_ShowMchResultsSummaryRow (unsigned NumResults,
|
||||||
|
|
||||||
/***** Write total score *****/
|
/***** Write total score *****/
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
HTM_Double (TotalScoreOfAllResults);
|
HTM_Double2Decimals (TotalScoreOfAllResults);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Write average score per question *****/
|
/***** Write average score per question *****/
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
HTM_Double (NumTotalQsts ? TotalScoreOfAllResults / (double) NumTotalQsts :
|
HTM_Double2Decimals (NumTotalQsts ? TotalScoreOfAllResults / (double) NumTotalQsts :
|
||||||
0.0);
|
0.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Write total grade *****/
|
/***** Write total grade *****/
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
HTM_Double (TotalGrade);
|
HTM_Double2Decimals (TotalGrade);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Last cell *****/
|
/***** Last cell *****/
|
||||||
|
@ -1187,7 +1187,7 @@ void McR_ShowOneMchResult (void)
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT LT\"");
|
HTM_TD_Begin ("class=\"DAT LT\"");
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
HTM_Double (TotalScore);
|
HTM_Double2Decimals (TotalScore);
|
||||||
else
|
else
|
||||||
HTM_Txt ("?"); // No feedback
|
HTM_Txt ("?"); // No feedback
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -1234,7 +1234,7 @@ void McR_ShowOneMchResult (void)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
|
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
|
||||||
HTM_TxtF ("%s: ",Txt_Score);
|
HTM_TxtF ("%s: ",Txt_Score);
|
||||||
HTM_Double (TotalScore);
|
HTM_Double2Decimals (TotalScore);
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
HTM_TxtF ("%s: ",Txt_Grade);
|
HTM_TxtF ("%s: ",Txt_Grade);
|
||||||
Tst_ComputeAndShowGrade (NumQsts,TotalScore,Game.MaxGrade);
|
Tst_ComputeAndShowGrade (NumQsts,TotalScore,Game.MaxGrade);
|
||||||
|
|
|
@ -601,9 +601,8 @@ static void Prf_ShowNumClicks (const struct UsrData *UsrDat,
|
||||||
if (UsrFigures->NumDays > 0)
|
if (UsrFigures->NumDays > 0)
|
||||||
{
|
{
|
||||||
HTM_TxtF (" %s","(");
|
HTM_TxtF (" %s","(");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,
|
HTM_Double ((double) UsrFigures->NumClicks /
|
||||||
(double) UsrFigures->NumClicks /
|
(double) UsrFigures->NumDays);
|
||||||
(double) UsrFigures->NumDays);
|
|
||||||
HTM_TxtF ("/%s ",Txt_day);
|
HTM_TxtF ("/%s ",Txt_day);
|
||||||
Prf_ShowRanking (Prf_GetRankingNumClicksPerDay (UsrDat->UsrCod),
|
Prf_ShowRanking (Prf_GetRankingNumClicksPerDay (UsrDat->UsrCod),
|
||||||
Prf_GetNumUsrsWithNumClicksPerDay ());
|
Prf_GetNumUsrsWithNumClicksPerDay ());
|
||||||
|
@ -642,9 +641,8 @@ static void Prf_ShowNumFileViews (const struct UsrData *UsrDat,
|
||||||
if (UsrFigures->NumDays > 0)
|
if (UsrFigures->NumDays > 0)
|
||||||
{
|
{
|
||||||
HTM_TxtF (" %s","(");
|
HTM_TxtF (" %s","(");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,
|
HTM_Double ((double) UsrFigures->NumFileViews /
|
||||||
(double) UsrFigures->NumFileViews /
|
(double) UsrFigures->NumDays);
|
||||||
(double) UsrFigures->NumDays);
|
|
||||||
HTM_TxtF ("/%s)",Txt_day);
|
HTM_TxtF ("/%s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -680,9 +678,8 @@ static void Prf_ShowNumSocialPublications (const struct UsrData *UsrDat,
|
||||||
if (UsrFigures->NumDays > 0)
|
if (UsrFigures->NumDays > 0)
|
||||||
{
|
{
|
||||||
HTM_TxtF (" %s","(");
|
HTM_TxtF (" %s","(");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,
|
HTM_Double ((double) UsrFigures->NumSocPub /
|
||||||
(double) UsrFigures->NumSocPub /
|
(double) UsrFigures->NumDays);
|
||||||
(double) UsrFigures->NumDays);
|
|
||||||
HTM_TxtF ("/%s)",Txt_day);
|
HTM_TxtF ("/%s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -718,9 +715,8 @@ static void Prf_ShowNumForumPosts (const struct UsrData *UsrDat,
|
||||||
if (UsrFigures->NumDays > 0)
|
if (UsrFigures->NumDays > 0)
|
||||||
{
|
{
|
||||||
HTM_TxtF (" %s","(");
|
HTM_TxtF (" %s","(");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,
|
HTM_Double ((double) UsrFigures->NumForPst /
|
||||||
(double) UsrFigures->NumForPst /
|
(double) UsrFigures->NumDays);
|
||||||
(double) UsrFigures->NumDays);
|
|
||||||
HTM_TxtF ("/%s)",Txt_day);
|
HTM_TxtF ("/%s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -756,9 +752,8 @@ static void Prf_ShowNumMessagesSent (const struct UsrData *UsrDat,
|
||||||
if (UsrFigures->NumDays > 0)
|
if (UsrFigures->NumDays > 0)
|
||||||
{
|
{
|
||||||
HTM_TxtF (" %s","(");
|
HTM_TxtF (" %s","(");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,
|
HTM_Double ((double) UsrFigures->NumMsgSnt /
|
||||||
(double) UsrFigures->NumMsgSnt /
|
(double) UsrFigures->NumDays);
|
||||||
(double) UsrFigures->NumDays);
|
|
||||||
HTM_TxtF ("/%s)",Txt_day);
|
HTM_TxtF ("/%s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1730,7 +1725,7 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
ItsMe ? "DAT_SMALL_N" :
|
ItsMe ? "DAT_SMALL_N" :
|
||||||
"DAT_SMALL",
|
"DAT_SMALL",
|
||||||
Gbl.RowEvenOdd);
|
Gbl.RowEvenOdd);
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,NumClicksPerDay);
|
HTM_Double (NumClicksPerDay);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,8 @@ static void Rep_ComputeMaxAndTotalHits (struct Rep_Hits *Hits,
|
||||||
static void Rep_DrawBarNumHits (unsigned long HitsNum,unsigned long HitsMax,
|
static void Rep_DrawBarNumHits (unsigned long HitsNum,unsigned long HitsMax,
|
||||||
unsigned MaxBarWidth);
|
unsigned MaxBarWidth);
|
||||||
|
|
||||||
|
static void Rep_WriteDouble (double Num);
|
||||||
|
|
||||||
static void Rep_RemoveUsrReportsFiles (long UsrCod);
|
static void Rep_RemoveUsrReportsFiles (long UsrCod);
|
||||||
static void Rep_RemoveUsrReportsFromDB (long UsrCod);
|
static void Rep_RemoveUsrReportsFromDB (long UsrCod);
|
||||||
|
|
||||||
|
@ -651,9 +653,8 @@ static void Rep_WriteSectionUsrFigures (const struct Rep_Report *Report)
|
||||||
if (Report->UsrFigures.NumDays > 0)
|
if (Report->UsrFigures.NumDays > 0)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Rep," (");
|
fprintf (Gbl.F.Rep," (");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Rep,
|
Rep_WriteDouble ((double) Report->UsrFigures.NumClicks /
|
||||||
(double) Report->UsrFigures.NumClicks /
|
(double) Report->UsrFigures.NumDays);
|
||||||
(double) Report->UsrFigures.NumDays);
|
|
||||||
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -686,9 +687,8 @@ static void Rep_WriteSectionUsrFigures (const struct Rep_Report *Report)
|
||||||
if (Report->UsrFigures.NumDays > 0)
|
if (Report->UsrFigures.NumDays > 0)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Rep," (");
|
fprintf (Gbl.F.Rep," (");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Rep,
|
Rep_WriteDouble ((double) Report->UsrFigures.NumFileViews /
|
||||||
(double) Report->UsrFigures.NumFileViews /
|
(double) Report->UsrFigures.NumDays);
|
||||||
(double) Report->UsrFigures.NumDays);
|
|
||||||
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -707,9 +707,8 @@ static void Rep_WriteSectionUsrFigures (const struct Rep_Report *Report)
|
||||||
if (Report->UsrFigures.NumDays > 0)
|
if (Report->UsrFigures.NumDays > 0)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Rep," (");
|
fprintf (Gbl.F.Rep," (");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Rep,
|
Rep_WriteDouble ((double) Report->UsrFigures.NumForPst /
|
||||||
(double) Report->UsrFigures.NumForPst /
|
(double) Report->UsrFigures.NumDays);
|
||||||
(double) Report->UsrFigures.NumDays);
|
|
||||||
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -728,9 +727,8 @@ static void Rep_WriteSectionUsrFigures (const struct Rep_Report *Report)
|
||||||
if (Report->UsrFigures.NumDays > 0)
|
if (Report->UsrFigures.NumDays > 0)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Rep," (");
|
fprintf (Gbl.F.Rep," (");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Rep,
|
Rep_WriteDouble ((double) Report->UsrFigures.NumMsgSnt /
|
||||||
(double) Report->UsrFigures.NumMsgSnt /
|
(double) Report->UsrFigures.NumDays);
|
||||||
(double) Report->UsrFigures.NumDays);
|
|
||||||
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
fprintf (Gbl.F.Rep," / %s)",Txt_day);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1378,7 +1376,7 @@ static void Rep_DrawBarNumHits (unsigned long HitsNum,unsigned long HitsMax,
|
||||||
|
|
||||||
/***** Write the number of hits *****/
|
/***** Write the number of hits *****/
|
||||||
fprintf (Gbl.F.Rep," ");
|
fprintf (Gbl.F.Rep," ");
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Rep,HitsNum);
|
Rep_WriteDouble (HitsNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1386,6 +1384,25 @@ static void Rep_DrawBarNumHits (unsigned long HitsNum,unsigned long HitsMax,
|
||||||
/********** Remove all user's usage report of a user from database ***********/
|
/********** Remove all user's usage report of a user from database ***********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Rep_WriteDouble (double Num)
|
||||||
|
{
|
||||||
|
char *Str;
|
||||||
|
|
||||||
|
/***** Write from floating point number to string
|
||||||
|
with the correct accuracy *****/
|
||||||
|
Str_DoubleNumToStr (&Str,Num);
|
||||||
|
|
||||||
|
/***** Write number from string to file *****/
|
||||||
|
fputs (Str,Gbl.F.Rep);
|
||||||
|
|
||||||
|
/***** Free memory allocated for string *****/
|
||||||
|
free (Str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********** Remove all user's usage report of a user from database ***********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rep_RemoveUsrUsageReports (long UsrCod)
|
void Rep_RemoveUsrUsageReports (long UsrCod)
|
||||||
{
|
{
|
||||||
/***** Remove all user's usage report files of a user *****/
|
/***** Remove all user's usage report files of a user *****/
|
||||||
|
|
|
@ -1888,7 +1888,7 @@ static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,MYSQL_RES *mysql_res)
|
||||||
BarWidth);
|
BarWidth);
|
||||||
HTM_NBSP ();
|
HTM_NBSP ();
|
||||||
}
|
}
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,Hits.Num);
|
HTM_Double (Hits.Num);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -2338,14 +2338,14 @@ static void Sta_DrawBarColors (Sta_ColorType_t ColorType,double HitsMax)
|
||||||
HTM_TD_Begin ("colspan=\"%u\" class=\"LOG CB\" style=\"width:%upx;\"",
|
HTM_TD_Begin ("colspan=\"%u\" class=\"LOG CB\" style=\"width:%upx;\"",
|
||||||
GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5,
|
GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5,
|
||||||
GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5);
|
GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5);
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,(double) Interval * HitsMax / 5.0);
|
HTM_Double ((double) Interval * HitsMax / 5.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
HTM_TD_Begin ("colspan=\"%u\" class=\"LOG RB\" style=\"width:%upx;\"",
|
HTM_TD_Begin ("colspan=\"%u\" class=\"LOG RB\" style=\"width:%upx;\"",
|
||||||
(GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2,
|
(GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2,
|
||||||
(GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2);
|
(GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH/5)/2);
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,HitsMax);
|
HTM_Double (HitsMax);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -2857,7 +2857,7 @@ static void Sta_WriteAccessHour (unsigned Hour,struct Sta_Hits *Hits,unsigned Co
|
||||||
HTM_TxtF ("%u%%",(unsigned) (((Hits->Num * 100.0) /
|
HTM_TxtF ("%u%%",(unsigned) (((Hits->Num * 100.0) /
|
||||||
Hits->Total) + 0.5));
|
Hits->Total) + 0.5));
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,Hits->Num);
|
HTM_Double (Hits->Num);
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
BarHeight = (unsigned) (((Hits->Num * 500.0) / Hits->Max) + 0.5);
|
BarHeight = (unsigned) (((Hits->Num * 500.0) / Hits->Max) + 0.5);
|
||||||
if (BarHeight == 0)
|
if (BarHeight == 0)
|
||||||
|
@ -3860,7 +3860,7 @@ static void Sta_DrawBarNumHits (char Color,
|
||||||
|
|
||||||
/***** Write the number of hits *****/
|
/***** Write the number of hits *****/
|
||||||
HTM_NBSP ();
|
HTM_NBSP ();
|
||||||
Str_WriteDoubleNumToFile (Gbl.F.Out,HitsNum);
|
HTM_Double (HitsNum);
|
||||||
HTM_TxtF (" (%u",(unsigned) (((HitsNum * 100.0) /
|
HTM_TxtF (" (%u",(unsigned) (((HitsNum * 100.0) /
|
||||||
HitsTotal) + 0.5));
|
HitsTotal) + 0.5));
|
||||||
}
|
}
|
||||||
|
|
|
@ -857,24 +857,6 @@ char Str_ConvertToLowerLetter (char Ch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/*** Write a number in floating point with the correct accuracy to a file ****/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void Str_WriteDoubleNumToFile (FILE *FileDst,double Number)
|
|
||||||
{
|
|
||||||
char *Str;
|
|
||||||
|
|
||||||
/***** Write from floating point number to string *****/
|
|
||||||
Str_DoubleNumToStr (&Str,Number);
|
|
||||||
|
|
||||||
/***** Write number from string to file *****/
|
|
||||||
fprintf (FileDst,"%s",Str);
|
|
||||||
|
|
||||||
/***** Free memory allocated for string *****/
|
|
||||||
free (Str);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/** Write a number in floating point with the correct accuracy to a string ***/
|
/** Write a number in floating point with the correct accuracy to a string ***/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -91,7 +91,6 @@ char *Str_ConvertToLowerText (char *Str);
|
||||||
char Str_ConvertToUpperLetter (char Ch);
|
char Str_ConvertToUpperLetter (char Ch);
|
||||||
char Str_ConvertToLowerLetter (char Ch);
|
char Str_ConvertToLowerLetter (char Ch);
|
||||||
|
|
||||||
void Str_WriteDoubleNumToFile (FILE *FileDst,double Number);
|
|
||||||
void Str_DoubleNumToStr (char **Str,double Number);
|
void Str_DoubleNumToStr (char **Str,double Number);
|
||||||
void Str_ConvertStrFloatCommaToStrFloatPoint (char *Str);
|
void Str_ConvertStrFloatCommaToStrFloatPoint (char *Str);
|
||||||
double Str_GetDoubleFromStr (char *Str);
|
double Str_GetDoubleFromStr (char *Str);
|
||||||
|
|
48
swad_test.c
48
swad_test.c
|
@ -537,7 +537,7 @@ void Tst_AssessTest (void)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
|
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
|
||||||
HTM_TxtF ("%s: ",Txt_Score);
|
HTM_TxtF ("%s: ",Txt_Score);
|
||||||
HTM_Double (TotalScore);
|
HTM_Double2Decimals (TotalScore);
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
HTM_TxtF ("%s: ",Txt_Grade);
|
HTM_TxtF ("%s: ",Txt_Grade);
|
||||||
Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
|
Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
|
||||||
|
@ -639,9 +639,9 @@ double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade)
|
||||||
void Tst_ShowGrade (double Grade,double MaxGrade)
|
void Tst_ShowGrade (double Grade,double MaxGrade)
|
||||||
{
|
{
|
||||||
/***** Write grade over maximum grade *****/
|
/***** Write grade over maximum grade *****/
|
||||||
HTM_Double (Grade);
|
HTM_Double2Decimals (Grade);
|
||||||
HTM_Txt ("/");
|
HTM_Txt ("/");
|
||||||
HTM_Double (MaxGrade);
|
HTM_Double2Decimals (MaxGrade);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2999,7 +2999,7 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
|
||||||
/* Write average score */
|
/* Write average score */
|
||||||
HTM_TD_Begin ("class=\"DAT_SMALL CT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT_SMALL CT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (NumHitsThisQst)
|
if (NumHitsThisQst)
|
||||||
HTM_Double (TotalScoreThisQst / (double) NumHitsThisQst);
|
HTM_Double2Decimals (TotalScoreThisQst / (double) NumHitsThisQst);
|
||||||
else
|
else
|
||||||
HTM_Txt ("N.A.");
|
HTM_Txt ("N.A.");
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -3012,7 +3012,7 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
|
||||||
/* Write average score (not blank) */
|
/* Write average score (not blank) */
|
||||||
HTM_TD_Begin ("class=\"DAT_SMALL CT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT_SMALL CT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (NumHitsNotBlankThisQst)
|
if (NumHitsNotBlankThisQst)
|
||||||
HTM_Double (TotalScoreThisQst / (double) NumHitsNotBlankThisQst);
|
HTM_Double2Decimals (TotalScoreThisQst / (double) NumHitsNotBlankThisQst);
|
||||||
else
|
else
|
||||||
HTM_Txt ("N.A.");
|
HTM_Txt ("N.A.");
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -3633,17 +3633,17 @@ static void Tst_WriteTFAnsAssessTest (struct UsrData *UsrDat,
|
||||||
if (AnsTF == '\0') // If user has omitted the answer
|
if (AnsTF == '\0') // If user has omitted the answer
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
}
|
}
|
||||||
else if (AnsTF == row[1][0]) // If correct
|
else if (AnsTF == row[1][0]) // If correct
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||||
HTM_Double (1.0);
|
HTM_Double2Decimals (1.0);
|
||||||
}
|
}
|
||||||
else // If wrong
|
else // If wrong
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||||
HTM_Double (-1.0);
|
HTM_Double2Decimals (-1.0);
|
||||||
}
|
}
|
||||||
HTM_SPAN_End ();
|
HTM_SPAN_End ();
|
||||||
Tst_WriteScoreEnd ();
|
Tst_WriteScoreEnd ();
|
||||||
|
@ -3905,7 +3905,7 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat,
|
||||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||||
else
|
else
|
||||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||||
HTM_Double (*ScoreThisQst);
|
HTM_Double2Decimals (*ScoreThisQst);
|
||||||
HTM_SPAN_End ();
|
HTM_SPAN_End ();
|
||||||
Tst_WriteScoreEnd ();
|
Tst_WriteScoreEnd ();
|
||||||
}
|
}
|
||||||
|
@ -4421,17 +4421,17 @@ static void Tst_WriteTextAnsAssessTest (struct UsrData *UsrDat,
|
||||||
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
}
|
}
|
||||||
else if (Correct) // If correct
|
else if (Correct) // If correct
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||||
HTM_Double (1.0);
|
HTM_Double2Decimals (1.0);
|
||||||
}
|
}
|
||||||
else // If wrong
|
else // If wrong
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
}
|
}
|
||||||
HTM_SPAN_End ();
|
HTM_SPAN_End ();
|
||||||
Tst_WriteScoreEnd ();
|
Tst_WriteScoreEnd ();
|
||||||
|
@ -4550,17 +4550,17 @@ static void Tst_WriteIntAnsAssessTest (struct UsrData *UsrDat,
|
||||||
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
}
|
}
|
||||||
else if (IntAnswerUsr == IntAnswerCorr) // If correct
|
else if (IntAnswerUsr == IntAnswerCorr) // If correct
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||||
HTM_Double (1.0);
|
HTM_Double2Decimals (1.0);
|
||||||
}
|
}
|
||||||
else // If wrong
|
else // If wrong
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
}
|
}
|
||||||
HTM_SPAN_End ();
|
HTM_SPAN_End ();
|
||||||
Tst_WriteScoreEnd ();
|
Tst_WriteScoreEnd ();
|
||||||
|
@ -4693,18 +4693,18 @@ static void Tst_WriteFloatAnsAssessTest (struct UsrData *UsrDat,
|
||||||
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
if (!Gbl.Test.StrAnswersOneQst[NumQst][0]) // If user has omitted the answer
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
HTM_SPAN_Begin ("class=\"ANS_0\"");
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
}
|
}
|
||||||
else if (FloatAnsUsr >= FloatAnsCorr[0] &&
|
else if (FloatAnsUsr >= FloatAnsCorr[0] &&
|
||||||
FloatAnsUsr <= FloatAnsCorr[1]) // If correct (inside the interval)
|
FloatAnsUsr <= FloatAnsCorr[1]) // If correct (inside the interval)
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
HTM_SPAN_Begin ("class=\"ANS_OK\"");
|
||||||
HTM_Double (1.0);
|
HTM_Double2Decimals (1.0);
|
||||||
}
|
}
|
||||||
else // If wrong (outside the interval)
|
else // If wrong (outside the interval)
|
||||||
{
|
{
|
||||||
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
HTM_SPAN_Begin ("class=\"ANS_BAD\"");
|
||||||
HTM_Double (0.0);
|
HTM_Double2Decimals (0.0);
|
||||||
}
|
}
|
||||||
HTM_SPAN_End ();
|
HTM_SPAN_End ();
|
||||||
Tst_WriteScoreEnd ();
|
Tst_WriteScoreEnd ();
|
||||||
|
@ -7744,13 +7744,13 @@ static void Tst_ShowTstResults (struct UsrData *UsrDat)
|
||||||
/* Write score */
|
/* Write score */
|
||||||
HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd);
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
HTM_Double (ScoreInThisTest);
|
HTM_Double2Decimals (ScoreInThisTest);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/* Write average score per question */
|
/* Write average score per question */
|
||||||
HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd);
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
HTM_Double (NumQstsInThisTest ? ScoreInThisTest /
|
HTM_Double2Decimals (NumQstsInThisTest ? ScoreInThisTest /
|
||||||
(double) NumQstsInThisTest :
|
(double) NumQstsInThisTest :
|
||||||
0.0);
|
0.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -7873,13 +7873,13 @@ static void Tst_ShowTestResultsSummaryRow (bool ItsMe,
|
||||||
/***** Write total score *****/
|
/***** Write total score *****/
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (ICanViewTotalScore)
|
if (ICanViewTotalScore)
|
||||||
HTM_Double (TotalScoreOfAllTests);
|
HTM_Double2Decimals (TotalScoreOfAllTests);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Write average score per question *****/
|
/***** Write average score per question *****/
|
||||||
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (ICanViewTotalScore)
|
if (ICanViewTotalScore)
|
||||||
HTM_Double (NumTotalQsts ? TotalScoreOfAllTests / (double) NumTotalQsts :
|
HTM_Double2Decimals (NumTotalQsts ? TotalScoreOfAllTests / (double) NumTotalQsts :
|
||||||
0.0);
|
0.0);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -8061,7 +8061,7 @@ void Tst_ShowOneTstResult (void)
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT LT\"");
|
HTM_TD_Begin ("class=\"DAT LT\"");
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
HTM_Double (TotalScore);
|
HTM_Double2Decimals (TotalScore);
|
||||||
else
|
else
|
||||||
HTM_Txt ("?"); // No feedback
|
HTM_Txt ("?"); // No feedback
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -8107,7 +8107,7 @@ void Tst_ShowOneTstResult (void)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
|
HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
|
||||||
HTM_TxtF ("%s: ",Txt_Score);
|
HTM_TxtF ("%s: ",Txt_Score);
|
||||||
HTM_Double (TotalScore);
|
HTM_Double2Decimals (TotalScore);
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
HTM_TxtF ("%s: ",Txt_Grade);
|
HTM_TxtF ("%s: ",Txt_Grade);
|
||||||
Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
|
Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user