Version19.80.2

This commit is contained in:
Antonio Cañas Vargas 2019-11-28 09:45:32 +01:00
parent a88b9b0884
commit d586abeff7
4 changed files with 64 additions and 24 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.1 (2019-11-28)" #define Log_PLATFORM_VERSION "SWAD 19.80.2 (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.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.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)

View File

@ -494,7 +494,6 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther,
unsigned NumTotalQstsNotBlank = 0; unsigned NumTotalQstsNotBlank = 0;
double ScoreInThisResult; double ScoreInThisResult;
double TotalScoreOfAllResults = 0.0; double TotalScoreOfAllResults = 0.0;
double MaxScore;
double MaxGrade; double MaxGrade;
double Grade; double Grade;
double TotalGrade = 0.0; double TotalGrade = 0.0;
@ -778,6 +777,7 @@ 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_Grade;
extern const char *Txt_Tags; extern const char *Txt_Tags;
struct Game Game; struct Game Game;
struct Match Match; struct Match Match;
@ -788,7 +788,6 @@ void McR_ShowOneMchResult (void)
char *Id; char *Id;
unsigned NumQsts; unsigned NumQsts;
unsigned NumQstsNotBlank; unsigned NumQstsNotBlank;
double MaxScore;
double TotalScore; double TotalScore;
bool ShowPhoto; bool ShowPhoto;
char PhotoURL[PATH_MAX + 1]; char PhotoURL[PATH_MAX + 1];
@ -972,7 +971,23 @@ 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); 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 else
HTM_Txt ("?"); // No feedback HTM_Txt ("?"); // No feedback
HTM_TD_End (); HTM_TD_End ();
@ -1001,9 +1016,12 @@ void McR_ShowOneMchResult (void)
/***** Write total mark of match result *****/ /***** Write total mark of match result *****/
if (ICanViewScore) if (ICanViewScore)
{ {
HTM_DIV_Begin ("class=\"DAT CM\""); HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
HTM_TxtF ("%s: ",Txt_Score); 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 (); HTM_DIV_End ();
} }

View File

@ -513,6 +513,7 @@ void Tst_AssessTest (void)
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_Score;
extern const char *Txt_Grade;
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;
@ -564,12 +565,15 @@ void Tst_AssessTest (void)
Tst_ShowTestResultAfterAssess (TstCod,&NumQstsNotBlank,&TotalScore); Tst_ShowTestResultAfterAssess (TstCod,&NumQstsNotBlank,&TotalScore);
HTM_TABLE_End (); HTM_TABLE_End ();
/***** Write total mark of test *****/ /***** Write total score and grade *****/
if (Gbl.Test.Config.Feedback != Tst_FEEDBACK_NOTHING) 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); 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 (); 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); 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 Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade)
{ {
double MaxScore; double MaxScore;
@ -666,6 +665,10 @@ double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade)
return Grade; return Grade;
} }
/*****************************************************************************/
/****************** Show total grade out of maximum grade ********************/
/*****************************************************************************/
void Tst_ShowGrade (double Grade,double MaxGrade) void Tst_ShowGrade (double Grade,double MaxGrade)
{ {
extern const char *Txt_out_of_PART_OF_A_SCORE; 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_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_Grade;
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
@ -8179,7 +8183,21 @@ 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);
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 else
HTM_Txt ("?"); // No feedback HTM_Txt ("?"); // No feedback
HTM_TD_End (); HTM_TD_End ();
@ -8209,9 +8227,12 @@ void Tst_ShowOneTstResult (void)
/***** Write total mark of test *****/ /***** Write total mark of test *****/
if (ICanViewScore) if (ICanViewScore)
{ {
HTM_DIV_Begin ("class=\"DAT CM\""); HTM_DIV_Begin ("class=\"DAT_N_BOLD CM\"");
HTM_TxtF ("%s: ",Txt_Score); 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 (); HTM_DIV_End ();
} }

View File

@ -141,7 +141,7 @@ void Tst_ShowFormAskTst (void);
void Tst_ShowNewTest (void); void Tst_ShowNewTest (void);
void Tst_AssessTest (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); double Tst_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade);
void Tst_ShowGrade (double Grade,double MaxGrade); void Tst_ShowGrade (double Grade,double MaxGrade);