Version19.80.1

This commit is contained in:
Antonio Cañas Vargas 2019-11-28 09:12:34 +01:00
parent faab11e80a
commit a88b9b0884
4 changed files with 56 additions and 64 deletions

View File

@ -490,7 +490,7 @@ 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.80 (2019-11-28)" #define Log_PLATFORM_VERSION "SWAD 19.80.1 (2019-11-28)"
#define CSS_FILE "swad19.78.1.css" #define CSS_FILE "swad19.78.1.css"
#define JS_FILE "swad19.70.js" #define JS_FILE "swad19.70.js"
/* /*
@ -498,6 +498,7 @@ ps2pdf source.ps destination.pdf
// 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.
// TODO: En cada juego, poder listar los resultados en una tabla como la de resultados globales // TODO: En cada juego, poder listar los resultados en una tabla como la de resultados globales
Version 19.80.1: Nov 28, 2019 Changes in test results and match results. (247252 lines)
Version 19.80: Nov 28, 2019 Changes in test results and match results. (247265 lines) Version 19.80: Nov 28, 2019 Changes in test results and match results. (247265 lines)
Version 19.79.2: Nov 27, 2019 Column for grade in matches results. (247232 lines) Version 19.79.2: Nov 27, 2019 Column for grade in matches results. (247232 lines)
Version 19.79.1: Nov 27, 2019 Maximum grade shown in listing of games. (247201 lines) Version 19.79.1: Nov 27, 2019 Maximum grade shown in listing of games. (247201 lines)

View File

@ -471,7 +471,6 @@ static void McR_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther)
static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther,
unsigned NumGamesSelected) unsigned NumGamesSelected)
{ {
extern const char *Txt_out_of_PART_OF_A_SCORE;
extern const char *Txt_Match_result; extern const char *Txt_Match_result;
extern const char *Txt_Hidden_result; extern const char *Txt_Hidden_result;
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
@ -651,20 +650,9 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther,
HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd); HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd);
if (ShowResultThisMatch) if (ShowResultThisMatch)
{ {
if (NumQstsInThisResult) Grade = Tst_ComputeGrade (NumQstsInThisResult,ScoreInThisResult,MaxGrade);
{ Tst_ShowGrade (Grade,MaxGrade);
MaxScore = (double) NumQstsInThisResult;
Grade = ScoreInThisResult * MaxGrade / MaxScore;
}
else
Grade = 0.0;
TotalGrade += Grade; TotalGrade += Grade;
HTM_Double (Grade);
HTM_NBSP ();
HTM_Txt (Txt_out_of_PART_OF_A_SCORE);
HTM_NBSP ();
HTM_Double (MaxGrade);
} }
HTM_TD_End (); HTM_TD_End ();
@ -790,7 +778,6 @@ void McR_ShowOneMchResult (void)
extern const char *Txt_Questions; extern const char *Txt_Questions;
extern const char *Txt_non_blank_QUESTIONS; extern const char *Txt_non_blank_QUESTIONS;
extern const char *Txt_Score; extern const char *Txt_Score;
extern const char *Txt_out_of_PART_OF_A_SCORE;
extern const char *Txt_Tags; extern const char *Txt_Tags;
struct Game Game; struct Game Game;
struct Match Match; struct Match Match;
@ -803,7 +790,6 @@ void McR_ShowOneMchResult (void)
unsigned NumQstsNotBlank; unsigned NumQstsNotBlank;
double MaxScore; double MaxScore;
double TotalScore; double TotalScore;
double Grade;
bool ShowPhoto; bool ShowPhoto;
char PhotoURL[PATH_MAX + 1]; char PhotoURL[PATH_MAX + 1];
bool ItsMe; bool ItsMe;
@ -986,25 +972,9 @@ void McR_ShowOneMchResult (void)
HTM_TD_Begin ("class=\"DAT LT\""); HTM_TD_Begin ("class=\"DAT LT\"");
if (ICanViewScore) if (ICanViewScore)
{ Tst_ShowScoreAndGrade (NumQsts,TotalScore,Game.MaxGrade);
if (NumQsts)
{
MaxScore = (double) NumQsts;
Grade = TotalScore * Game.MaxGrade / MaxScore;
}
else
Grade = 0.0;
HTM_Double (TotalScore);
HTM_Txt (" (");
HTM_Double (Grade);
}
else else
HTM_Txt ("? (?"); // No feedback HTM_Txt ("?"); // No feedback
HTM_NBSP ();
HTM_Txt (Txt_out_of_PART_OF_A_SCORE);
HTM_NBSP ();
HTM_Double (Game.MaxGrade);
HTM_Txt (")");
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
@ -1030,7 +1000,12 @@ void McR_ShowOneMchResult (void)
/***** Write total mark of match result *****/ /***** Write total mark of match result *****/
if (ICanViewScore) if (ICanViewScore)
Tst_ShowTstTotalMark (NumQsts,TotalScore,Game.MaxGrade); {
HTM_DIV_Begin ("class=\"DAT CM\"");
HTM_TxtF ("%s: ",Txt_Score);
Tst_ShowScoreAndGrade (NumQsts,TotalScore,Game.MaxGrade);
HTM_DIV_End ();
}
/***** End box *****/ /***** End box *****/
Box_BoxEnd (); Box_BoxEnd ();

View File

@ -512,6 +512,7 @@ void Tst_AssessTest (void)
extern const char *Hlp_ASSESSMENT_Tests; extern const char *Hlp_ASSESSMENT_Tests;
extern const char *Txt_Test_result; extern const char *Txt_Test_result;
extern const char *Txt_Test_No_X_that_you_make_in_this_course; extern const char *Txt_Test_No_X_that_you_make_in_this_course;
extern const char *Txt_Score;
extern const char *Txt_The_test_X_has_already_been_assessed_previously; extern const char *Txt_The_test_X_has_already_been_assessed_previously;
extern const char *Txt_There_was_an_error_in_assessing_the_test_X; extern const char *Txt_There_was_an_error_in_assessing_the_test_X;
unsigned NumTst; unsigned NumTst;
@ -565,7 +566,12 @@ void Tst_AssessTest (void)
/***** Write total mark of test *****/ /***** Write total mark of test *****/
if (Gbl.Test.Config.Feedback != Tst_FEEDBACK_NOTHING) if (Gbl.Test.Config.Feedback != Tst_FEEDBACK_NOTHING)
Tst_ShowTstTotalMark (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); {
HTM_DIV_Begin ("class=\"DAT CM\"");
HTM_TxtF ("%s: ",Txt_Score);
Tst_ShowScoreAndGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
HTM_DIV_End ();
}
/***** End box *****/ /***** End box *****/
Box_BoxEnd (); Box_BoxEnd ();
@ -626,16 +632,29 @@ static void Tst_GetQuestionsAndAnswersFromForm (void)
} }
/*****************************************************************************/ /*****************************************************************************/
/************************** Show total mark of a test ************************/ /********* Show total score (and total grade out of maximum grade) ***********/
/*****************************************************************************/ /*****************************************************************************/
void Tst_ShowTstTotalMark (unsigned NumQsts,double Score,double MaxGrade) void Tst_ShowScoreAndGrade (unsigned NumQsts,double Score,double MaxGrade)
{
/***** Write total score ****/
HTM_Double (Score);
/***** Separator *****/
HTM_NBSP ();
/***** Compute and write grade over maximum grade *****/
HTM_Txt ("(");
Tst_ShowGrade (Tst_ComputeGrade (NumQsts,Score,MaxGrade),MaxGrade);
HTM_Txt (")");
}
double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade)
{ {
extern const char *Txt_Score;
extern const char *Txt_out_of_PART_OF_A_SCORE;
double MaxScore; double MaxScore;
double Grade; double Grade;
/***** Compute grade *****/
if (NumQsts) if (NumQsts)
{ {
MaxScore = (double) NumQsts; MaxScore = (double) NumQsts;
@ -644,22 +663,19 @@ void Tst_ShowTstTotalMark (unsigned NumQsts,double Score,double MaxGrade)
else else
Grade = 0.0; Grade = 0.0;
/***** Write total score ****/ return Grade;
HTM_DIV_Begin ("class=\"DAT CM\""); }
HTM_TxtF ("%s: ",Txt_Score);
HTM_SPAN_Begin ("class=\"%s\"", void Tst_ShowGrade (double Grade,double MaxGrade)
(Grade >= MaxGrade / 2.0) ? "ANS_OK" : {
"ANS_BAD"); extern const char *Txt_out_of_PART_OF_A_SCORE;
HTM_Double (Score);
HTM_Txt (" ("); /***** Write grade over maximum grade *****/
HTM_Double (Grade); HTM_Double (Grade);
HTM_NBSP (); HTM_NBSP ();
HTM_Txt (Txt_out_of_PART_OF_A_SCORE); HTM_Txt (Txt_out_of_PART_OF_A_SCORE);
HTM_NBSP (); HTM_NBSP ();
HTM_Double (MaxGrade); HTM_Double (MaxGrade);
HTM_Txt (")");
HTM_SPAN_End ();
HTM_DIV_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -8014,7 +8030,6 @@ void Tst_ShowOneTstResult (void)
extern const char *Txt_Questions; extern const char *Txt_Questions;
extern const char *Txt_non_blank_QUESTIONS; extern const char *Txt_non_blank_QUESTIONS;
extern const char *Txt_Score; extern const char *Txt_Score;
extern const char *Txt_out_of_PART_OF_A_SCORE;
extern const char *Txt_Tags; extern const char *Txt_Tags;
long TstCod; long TstCod;
time_t TstTimeUTC = 0; // Test result UTC date-time, initialized to avoid warning time_t TstTimeUTC = 0; // Test result UTC date-time, initialized to avoid warning
@ -8164,16 +8179,9 @@ void Tst_ShowOneTstResult (void)
HTM_TD_Begin ("class=\"DAT LT\""); HTM_TD_Begin ("class=\"DAT LT\"");
if (ICanViewScore) if (ICanViewScore)
{ Tst_ShowScoreAndGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
HTM_Double (TotalScore);
HTM_Txt (" (");
HTM_Double (Gbl.Test.NumQsts ? TotalScore * Tst_SCORE_MAX /
(double) Gbl.Test.NumQsts :
0.0);
}
else else
HTM_Txt ("? (?"); // No feedback HTM_Txt ("?"); // No feedback
HTM_TxtF (" %s %u)",Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX);
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
@ -8200,7 +8208,12 @@ void Tst_ShowOneTstResult (void)
/***** Write total mark of test *****/ /***** Write total mark of test *****/
if (ICanViewScore) if (ICanViewScore)
Tst_ShowTstTotalMark (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); {
HTM_DIV_Begin ("class=\"DAT CM\"");
HTM_TxtF ("%s: ",Txt_Score);
Tst_ShowScoreAndGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
HTM_DIV_End ();
}
/***** End box *****/ /***** End box *****/
Box_BoxEnd (); Box_BoxEnd ();

View File

@ -140,7 +140,10 @@ struct Tst_Stats
void Tst_ShowFormAskTst (void); void Tst_ShowFormAskTst (void);
void Tst_ShowNewTest (void); void Tst_ShowNewTest (void);
void Tst_AssessTest (void); void Tst_AssessTest (void);
void Tst_ShowTstTotalMark (unsigned NumQsts,double Score,double MaxGrade);
void Tst_ShowScoreAndGrade (unsigned NumQsts,double Score,double MaxGrade);
double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade);
void Tst_ShowGrade (double Grade,double MaxGrade);
void Tst_ShowTagList (unsigned NumTags,MYSQL_RES *mysql_res); void Tst_ShowTagList (unsigned NumTags,MYSQL_RES *mysql_res);