diff --git a/swad_changelog.h b/swad_changelog.h index ddf3a09e..db90fe9a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -490,7 +490,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.80.1 (2019-11-28)" +#define Log_PLATFORM_VERSION "SWAD 19.80.2 (2019-11-28)" #define CSS_FILE "swad19.78.1.css" #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: En cada juego, poder listar los resultados en una tabla como la de resultados globales + Version 19.80.2: Nov 28, 2019 Changes in test results and match results. (247285 lines) 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.79.2: Nov 27, 2019 Column for grade in matches results. (247232 lines) diff --git a/swad_match_result.c b/swad_match_result.c index 482cb7fd..b55db190 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -494,7 +494,6 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, unsigned NumTotalQstsNotBlank = 0; double ScoreInThisResult; double TotalScoreOfAllResults = 0.0; - double MaxScore; double MaxGrade; double Grade; double TotalGrade = 0.0; @@ -778,6 +777,7 @@ void McR_ShowOneMchResult (void) extern const char *Txt_Questions; extern const char *Txt_non_blank_QUESTIONS; extern const char *Txt_Score; + extern const char *Txt_Grade; extern const char *Txt_Tags; struct Game Game; struct Match Match; @@ -788,7 +788,6 @@ void McR_ShowOneMchResult (void) char *Id; unsigned NumQsts; unsigned NumQstsNotBlank; - double MaxScore; double TotalScore; bool ShowPhoto; char PhotoURL[PATH_MAX + 1]; @@ -972,7 +971,23 @@ void McR_ShowOneMchResult (void) HTM_TD_Begin ("class=\"DAT LT\""); if (ICanViewScore) - Tst_ShowScoreAndGrade (NumQsts,TotalScore,Game.MaxGrade); + HTM_Double (TotalScore); + else + HTM_Txt ("?"); // No feedback + HTM_TD_End (); + + HTM_TR_End (); + + /* Grade */ + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"DAT_N RT\""); + HTM_TxtF ("%s:",Txt_Grade); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"DAT LT\""); + if (ICanViewScore) + Tst_ComputeAndShowGrade (NumQsts,TotalScore,Game.MaxGrade); else HTM_Txt ("?"); // No feedback HTM_TD_End (); @@ -1001,9 +1016,12 @@ void McR_ShowOneMchResult (void) /***** Write total mark of match result *****/ if (ICanViewScore) { - HTM_DIV_Begin ("class=\"DAT CM\""); + HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\""); HTM_TxtF ("%s: ",Txt_Score); - Tst_ShowScoreAndGrade (NumQsts,TotalScore,Game.MaxGrade); + HTM_Double (TotalScore); + HTM_BR (); + HTM_TxtF ("%s: ",Txt_Grade); + Tst_ComputeAndShowGrade (NumQsts,TotalScore,Game.MaxGrade); HTM_DIV_End (); } diff --git a/swad_test.c b/swad_test.c index 08aec8b1..fc176343 100644 --- a/swad_test.c +++ b/swad_test.c @@ -513,6 +513,7 @@ void Tst_AssessTest (void) extern const char *Txt_Test_result; extern const char *Txt_Test_No_X_that_you_make_in_this_course; extern const char *Txt_Score; + extern const char *Txt_Grade; 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; unsigned NumTst; @@ -564,12 +565,15 @@ void Tst_AssessTest (void) Tst_ShowTestResultAfterAssess (TstCod,&NumQstsNotBlank,&TotalScore); HTM_TABLE_End (); - /***** Write total mark of test *****/ + /***** Write total score and grade *****/ if (Gbl.Test.Config.Feedback != Tst_FEEDBACK_NOTHING) { - HTM_DIV_Begin ("class=\"DAT CM\""); + HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\""); HTM_TxtF ("%s: ",Txt_Score); - Tst_ShowScoreAndGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); + HTM_Double (TotalScore); + HTM_BR (); + HTM_TxtF ("%s: ",Txt_Grade); + Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); HTM_DIV_End (); } @@ -632,23 +636,18 @@ static void Tst_GetQuestionsAndAnswersFromForm (void) } /*****************************************************************************/ -/********* Show total score (and total grade out of maximum grade) ***********/ +/************ Compute and show total grade out of maximum grade **************/ /*****************************************************************************/ -void Tst_ShowScoreAndGrade (unsigned NumQsts,double Score,double MaxGrade) +void Tst_ComputeAndShowGrade (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 (")"); } +/*****************************************************************************/ +/**************** Compute total grade out of maximum grade *******************/ +/*****************************************************************************/ + double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade) { double MaxScore; @@ -666,6 +665,10 @@ double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade) return Grade; } +/*****************************************************************************/ +/****************** Show total grade out of maximum grade ********************/ +/*****************************************************************************/ + void Tst_ShowGrade (double Grade,double MaxGrade) { extern const char *Txt_out_of_PART_OF_A_SCORE; @@ -8030,6 +8033,7 @@ void Tst_ShowOneTstResult (void) extern const char *Txt_Questions; extern const char *Txt_non_blank_QUESTIONS; extern const char *Txt_Score; + extern const char *Txt_Grade; extern const char *Txt_Tags; long TstCod; time_t TstTimeUTC = 0; // Test result UTC date-time, initialized to avoid warning @@ -8179,7 +8183,21 @@ void Tst_ShowOneTstResult (void) HTM_TD_Begin ("class=\"DAT LT\""); if (ICanViewScore) - Tst_ShowScoreAndGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); + HTM_Double (TotalScore); + else + HTM_Txt ("?"); // No feedback + HTM_TD_End (); + + /* Grade */ + HTM_TR_Begin (NULL); + + HTM_TD_Begin ("class=\"DAT_N RT\""); + HTM_TxtF ("%s:",Txt_Grade); + HTM_TD_End (); + + HTM_TD_Begin ("class=\"DAT LT\""); + if (ICanViewScore) + Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); else HTM_Txt ("?"); // No feedback HTM_TD_End (); @@ -8209,9 +8227,12 @@ void Tst_ShowOneTstResult (void) /***** Write total mark of test *****/ if (ICanViewScore) { - HTM_DIV_Begin ("class=\"DAT CM\""); + HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\""); HTM_TxtF ("%s: ",Txt_Score); - Tst_ShowScoreAndGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); + HTM_Double (TotalScore); + HTM_BR (); + HTM_TxtF ("%s: ",Txt_Grade); + Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX); HTM_DIV_End (); } diff --git a/swad_test.h b/swad_test.h index f9be6de6..67402fe1 100644 --- a/swad_test.h +++ b/swad_test.h @@ -141,7 +141,7 @@ void Tst_ShowFormAskTst (void); void Tst_ShowNewTest (void); void Tst_AssessTest (void); -void Tst_ShowScoreAndGrade (unsigned NumQsts,double Score,double MaxGrade); +void Tst_ComputeAndShowGrade (unsigned NumQsts,double Score,double MaxGrade); double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade); void Tst_ShowGrade (double Grade,double MaxGrade);