mirror of https://github.com/acanas/swad-core.git
Version19.80
This commit is contained in:
parent
88ebee65df
commit
faab11e80a
|
@ -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.79.2 (2019-11-27)"
|
#define Log_PLATFORM_VERSION "SWAD 19.80 (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: 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)
|
||||||
Version 19.79: Nov 27, 2019 Storing maximum grade in a game into database. (247197 lines)
|
Version 19.79: Nov 27, 2019 Storing maximum grade in a game into database. (247197 lines)
|
||||||
|
|
|
@ -861,6 +861,8 @@ void Gam_GetDataOfGameByCod (struct Game *Game)
|
||||||
|
|
||||||
/* Get maximum grade (row[4]) */
|
/* Get maximum grade (row[4]) */
|
||||||
Game->MaxGrade = Str_GetDoubleFromStr (row[4]);
|
Game->MaxGrade = Str_GetDoubleFromStr (row[4]);
|
||||||
|
if (Game->MaxGrade < 0.0) // Only positive values allowed
|
||||||
|
Game->MaxGrade = 0.0;
|
||||||
|
|
||||||
/* Get the title of the game (row[5]) */
|
/* Get the title of the game (row[5]) */
|
||||||
Str_Copy (Game->Title,row[5],
|
Str_Copy (Game->Title,row[5],
|
||||||
|
@ -1262,7 +1264,7 @@ static void Gam_PutFormsEditionGame (struct Game *Game,bool ItsANewGame)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LM\"");
|
HTM_TD_Begin ("class=\"LM\"");
|
||||||
HTM_INPUT_FLOAT ("MaxGrade",(double) 0.0,(double) DBL_MAX,(double) 0.01,Game->MaxGrade,false,
|
HTM_INPUT_FLOAT ("MaxGrade",0.0,0.0,0.01,Game->MaxGrade,false,
|
||||||
"required=\"required\"");
|
"required=\"required\"");
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -1329,6 +1331,8 @@ void Gam_RecFormGame (void)
|
||||||
/***** Get maximum grade *****/
|
/***** Get maximum grade *****/
|
||||||
Par_GetParToText ("MaxGrade",MaxGradeStr,sizeof (MaxGradeStr) - 1);
|
Par_GetParToText ("MaxGrade",MaxGradeStr,sizeof (MaxGradeStr) - 1);
|
||||||
Game.MaxGrade = Str_GetDoubleFromStr (MaxGradeStr);
|
Game.MaxGrade = Str_GetDoubleFromStr (MaxGradeStr);
|
||||||
|
if (Game.MaxGrade < 0.0) // Only positive values allowed
|
||||||
|
Game.MaxGrade = 0.0;
|
||||||
|
|
||||||
/***** Get game text and insert links *****/
|
/***** Get game text and insert links *****/
|
||||||
Par_GetParToHTML ("Txt",Txt,Cns_MAX_BYTES_TEXT); // Store in HTML format (not rigorous)
|
Par_GetParToHTML ("Txt",Txt,Cns_MAX_BYTES_TEXT); // Store in HTML format (not rigorous)
|
||||||
|
|
|
@ -458,7 +458,7 @@ static void McR_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther)
|
||||||
HTM_TH (1,1,"RT",Txt_Non_blank_BR_questions);
|
HTM_TH (1,1,"RT",Txt_Non_blank_BR_questions);
|
||||||
HTM_TH (1,1,"RT",Txt_Total_BR_score);
|
HTM_TH (1,1,"RT",Txt_Total_BR_score);
|
||||||
HTM_TH (1,1,"RT",Txt_Average_BR_score_BR_per_question_BR_from_0_to_1);
|
HTM_TH (1,1,"RT",Txt_Average_BR_score_BR_per_question_BR_from_0_to_1);
|
||||||
HTM_TH (1,1,"RT",Txt_Grade);
|
HTM_TH (1,1,"CT",Txt_Grade);
|
||||||
HTM_TH_Empty (1);
|
HTM_TH_Empty (1);
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -471,6 +471,7 @@ 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;
|
||||||
|
@ -657,8 +658,13 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Grade = 0.0;
|
Grade = 0.0;
|
||||||
HTM_Double (Grade);
|
|
||||||
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 ();
|
||||||
|
|
||||||
|
@ -757,7 +763,7 @@ static void McR_ShowMchResultsSummaryRow (bool ShowSummaryResults,
|
||||||
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 CM COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
if (ShowSummaryResults)
|
if (ShowSummaryResults)
|
||||||
HTM_Double (TotalGrade);
|
HTM_Double (TotalGrade);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -795,7 +801,9 @@ void McR_ShowOneMchResult (void)
|
||||||
char *Id;
|
char *Id;
|
||||||
unsigned NumQsts;
|
unsigned NumQsts;
|
||||||
unsigned NumQstsNotBlank;
|
unsigned NumQstsNotBlank;
|
||||||
|
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;
|
||||||
|
@ -979,14 +987,24 @@ void McR_ShowOneMchResult (void)
|
||||||
HTM_TD_Begin ("class=\"DAT LT\"");
|
HTM_TD_Begin ("class=\"DAT LT\"");
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
{
|
{
|
||||||
|
if (NumQsts)
|
||||||
|
{
|
||||||
|
MaxScore = (double) NumQsts;
|
||||||
|
Grade = TotalScore * Game.MaxGrade / MaxScore;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Grade = 0.0;
|
||||||
HTM_Double (TotalScore);
|
HTM_Double (TotalScore);
|
||||||
HTM_Txt (" (");
|
HTM_Txt (" (");
|
||||||
HTM_Double (NumQsts ? TotalScore * Tst_SCORE_MAX / (double) NumQsts :
|
HTM_Double (Grade);
|
||||||
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_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 ();
|
||||||
|
@ -1012,7 +1030,7 @@ void McR_ShowOneMchResult (void)
|
||||||
|
|
||||||
/***** Write total mark of match result *****/
|
/***** Write total mark of match result *****/
|
||||||
if (ICanViewScore)
|
if (ICanViewScore)
|
||||||
Tst_ShowTstTotalMark (NumQsts,TotalScore);
|
Tst_ShowTstTotalMark (NumQsts,TotalScore,Game.MaxGrade);
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
|
34
swad_test.c
34
swad_test.c
|
@ -565,7 +565,7 @@ 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_ShowTstTotalMark (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
@ -629,23 +629,35 @@ static void Tst_GetQuestionsAndAnswersFromForm (void)
|
||||||
/************************** Show total mark of a test ************************/
|
/************************** Show total mark of a test ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Tst_ShowTstTotalMark (unsigned NumQsts,double TotalScore)
|
void Tst_ShowTstTotalMark (unsigned NumQsts,double Score,double MaxGrade)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Score;
|
extern const char *Txt_Score;
|
||||||
extern const char *Txt_out_of_PART_OF_A_SCORE;
|
extern const char *Txt_out_of_PART_OF_A_SCORE;
|
||||||
double TotalScoreOverSCORE_MAX = TotalScore * Tst_SCORE_MAX / (double) NumQsts;
|
double MaxScore;
|
||||||
|
double Grade;
|
||||||
|
|
||||||
/***** Write total mark ****/
|
if (NumQsts)
|
||||||
|
{
|
||||||
|
MaxScore = (double) NumQsts;
|
||||||
|
Grade = Score * MaxGrade / MaxScore;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Grade = 0.0;
|
||||||
|
|
||||||
|
/***** Write total score ****/
|
||||||
HTM_DIV_Begin ("class=\"DAT CM\"");
|
HTM_DIV_Begin ("class=\"DAT CM\"");
|
||||||
HTM_TxtF ("%s: ",Txt_Score);
|
HTM_TxtF ("%s: ",Txt_Score);
|
||||||
HTM_SPAN_Begin ("class=\"%s\"",
|
HTM_SPAN_Begin ("class=\"%s\"",
|
||||||
(TotalScoreOverSCORE_MAX >=
|
(Grade >= MaxGrade / 2.0) ? "ANS_OK" :
|
||||||
(double) TotalScoreOverSCORE_MAX / 2.0) ? "ANS_OK" :
|
"ANS_BAD");
|
||||||
"ANS_BAD");
|
HTM_Double (Score);
|
||||||
HTM_Double (TotalScore);
|
|
||||||
HTM_Txt (" (");
|
HTM_Txt (" (");
|
||||||
HTM_Double (TotalScoreOverSCORE_MAX);
|
HTM_Double (Grade);
|
||||||
HTM_TxtF (" %s %u)",Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX);
|
HTM_NBSP ();
|
||||||
|
HTM_Txt (Txt_out_of_PART_OF_A_SCORE);
|
||||||
|
HTM_NBSP ();
|
||||||
|
HTM_Double (MaxGrade);
|
||||||
|
HTM_Txt (")");
|
||||||
HTM_SPAN_End ();
|
HTM_SPAN_End ();
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
}
|
}
|
||||||
|
@ -8188,7 +8200,7 @@ 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_ShowTstTotalMark (Gbl.Test.NumQsts,TotalScore,Tst_SCORE_MAX);
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
|
|
@ -140,7 +140,7 @@ 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 TotalScore);
|
void Tst_ShowTstTotalMark (unsigned NumQsts,double Score,double MaxGrade);
|
||||||
|
|
||||||
void Tst_ShowTagList (unsigned NumTags,MYSQL_RES *mysql_res);
|
void Tst_ShowTagList (unsigned NumTags,MYSQL_RES *mysql_res);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue