From 0b8f1357e0966bb818d902527c0a43dedabd52ea Mon Sep 17 00:00:00 2001 From: acanas Date: Tue, 23 Jun 2020 20:28:33 +0200 Subject: [PATCH] Version19.255.1 --- swad_changelog.h | 3 +- swad_exam_result.c | 28 ++++---- swad_match_result.c | 4 +- swad_test_print.c | 89 ++++++++++++++++------- swad_text.c | 168 ++++++++++++++++++++++---------------------- 5 files changed, 165 insertions(+), 127 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index ffea54e7..bfa92416 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -556,7 +556,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.255 (2020-06-23)" +#define Log_PLATFORM_VERSION "SWAD 19.255.1 (2020-06-23)" #define CSS_FILE "swad19.253.css" #define JS_FILE "swad19.254.js" /* @@ -567,6 +567,7 @@ TODO: Fix bug: Cuando se pulsa en ver fichas, y luego en una ficha en "Ver traba TODO: No limitar el número de preguntas en un examen a ExaPrn_MAX_QUESTIONS_PER_EXAM_PRINT, sino asignar PrintedQuestions dinámicamente con malloc TODO: Que al generar un examen sólo se cojan preguntas válidas. Y si ya está generado, al entrar de nuevo, que se vean en rojo. + Version 19.255.1: Jun 23, 2020 Changes in listing of test results. (303655 lines) Version 19.255: Jun 23, 2020 Code refactoring in test results. (303625 lines) Version 19.254.2: Jun 23, 2020 Matches results can only be changed to visible when match is at the end. If teacher goes back in match, the results change antumatically to hidden. (303667 lines) diff --git a/swad_exam_result.c b/swad_exam_result.c index 94853b3e..59de7cb2 100644 --- a/swad_exam_result.c +++ b/swad_exam_result.c @@ -708,9 +708,9 @@ static void ExaRes_ShowHeaderResults (Usr_MeOrOther_t MeOrOther) extern const char *Txt_total; extern const char *Txt_QUESTIONS_valid; extern const char *Txt_QUESTIONS_invalid; - extern const char *Txt_correct_ANSWERS; - extern const char *Txt_wrong_ANSWERS; - extern const char *Txt_blank_ANSWERS; + extern const char *Txt_ANSWERS_correct; + extern const char *Txt_ANSWERS_wrong; + extern const char *Txt_ANSWERS_blank; extern const char *Txt_average; /***** First row *****/ @@ -735,9 +735,9 @@ static void ExaRes_ShowHeaderResults (Usr_MeOrOther_t MeOrOther) HTM_TH (2,1,"RT LINE_LEFT",Txt_total); HTM_TH (2,1,"RT",Txt_QUESTIONS_valid); HTM_TH (2,1,"RT",Txt_QUESTIONS_invalid); - HTM_TH (1,1,"RT LINE_LEFT",Txt_correct_ANSWERS); - HTM_TH (1,3,"CT",Txt_wrong_ANSWERS); - HTM_TH (1,1,"RT",Txt_blank_ANSWERS); + HTM_TH (1,1,"RT LINE_LEFT",Txt_ANSWERS_correct); + HTM_TH (1,3,"CT",Txt_ANSWERS_wrong); + HTM_TH (1,1,"RT",Txt_ANSWERS_blank); HTM_TH (1,1,"RT LINE_LEFT",Txt_total); HTM_TH (1,1,"RT",Txt_average); @@ -1402,9 +1402,9 @@ static void ExaRes_ShowExamResult (const struct Exa_Exam *Exam, extern const char *Txt_QUESTIONS_valid; extern const char *Txt_QUESTIONS_invalid; extern const char *Txt_Valid_answers; - extern const char *Txt_correct_ANSWERS; - extern const char *Txt_wrong_ANSWERS; - extern const char *Txt_blank_ANSWERS; + extern const char *Txt_ANSWERS_correct; + extern const char *Txt_ANSWERS_wrong; + extern const char *Txt_ANSWERS_blank; extern const char *Txt_Score; extern const char *Txt_valid_score; extern const char *Txt_Grade; @@ -1540,11 +1540,11 @@ static void ExaRes_ShowExamResult (const struct Exa_Exam *Exam, "%s(pi=0): %u; " "%s(0<pi<1): %u; " "%s(pi=0): %u", - Txt_correct_ANSWERS,Print->NumQsts.Valid.Correct, - Txt_wrong_ANSWERS ,Print->NumQsts.Valid.Wrong.Negative, - Txt_wrong_ANSWERS ,Print->NumQsts.Valid.Wrong.Zero, - Txt_wrong_ANSWERS ,Print->NumQsts.Valid.Wrong.Positive, - Txt_blank_ANSWERS ,Print->NumQsts.Valid.Blank); + Txt_ANSWERS_correct,Print->NumQsts.Valid.Correct, + Txt_ANSWERS_wrong ,Print->NumQsts.Valid.Wrong.Negative, + Txt_ANSWERS_wrong ,Print->NumQsts.Valid.Wrong.Zero, + Txt_ANSWERS_wrong ,Print->NumQsts.Valid.Wrong.Positive, + Txt_ANSWERS_blank ,Print->NumQsts.Valid.Blank); else Ico_PutIconNotVisible (); HTM_TD_End (); diff --git a/swad_match_result.c b/swad_match_result.c index d42a3a88..a1ed807e 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -741,7 +741,7 @@ static void MchRes_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther) extern const char *Txt_Match; extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME]; extern const char *Txt_Questions; - extern const char *Txt_Non_blank_BR_questions; + extern const char *Txt_ANSWERS_non_blank; extern const char *Txt_Score; extern const char *Txt_Average_BR_score_BR_per_question; extern const char *Txt_Grade; @@ -754,7 +754,7 @@ static void MchRes_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther) HTM_TH (1,1,"LT",Txt_START_END_TIME[Dat_END_TIME ]); HTM_TH (1,1,"LT",Txt_Match); HTM_TH (1,1,"RT",Txt_Questions); - HTM_TH (1,1,"RT",Txt_Non_blank_BR_questions); + HTM_TH (1,1,"RT",Txt_ANSWERS_non_blank); HTM_TH (1,1,"RT",Txt_Score); HTM_TH (1,1,"RT",Txt_Average_BR_score_BR_per_question); HTM_TH (1,1,"RT",Txt_Grade); diff --git a/swad_test_print.c b/swad_test_print.c index f07bed20..070decc9 100644 --- a/swad_test_print.c +++ b/swad_test_print.c @@ -1998,22 +1998,45 @@ static void TstPrn_ShowHeaderPrints (void) extern const char *Txt_User[Usr_NUM_SEXS]; extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME]; extern const char *Txt_Questions; - extern const char *Txt_Non_blank_BR_questions; + extern const char *Txt_Answers; extern const char *Txt_Score; - extern const char *Txt_Average_BR_score_BR_per_question; extern const char *Txt_Grade; + extern const char *Txt_ANSWERS_non_blank; + extern const char *Txt_ANSWERS_blank; + extern const char *Txt_total; + extern const char *Txt_average; + /***** First row *****/ HTM_TR_Begin (NULL); - HTM_TH (1,2,"CT",Txt_User[Usr_SEX_UNKNOWN]); - HTM_TH (1,1,"LT",Txt_START_END_TIME[Dat_START_TIME]); - HTM_TH (1,1,"LT",Txt_START_END_TIME[Dat_END_TIME ]); - HTM_TH (1,1,"RT",Txt_Questions); - HTM_TH (1,1,"RT",Txt_Non_blank_BR_questions); - HTM_TH (1,1,"RT",Txt_Score); - HTM_TH (1,1,"RT",Txt_Average_BR_score_BR_per_question); - HTM_TH (1,1,"RT",Txt_Grade); - HTM_TH_Empty (1); + HTM_TH (3,2,"CT",Txt_User[Usr_SEX_UNKNOWN]); + HTM_TH (3,1,"LT",Txt_START_END_TIME[Dat_START_TIME]); + HTM_TH (3,1,"LT",Txt_START_END_TIME[Dat_END_TIME ]); + HTM_TH (3,1,"RT LINE_LEFT",Txt_Questions); + HTM_TH (1,2,"CT LINE_LEFT",Txt_Answers); + HTM_TH (1,2,"CT LINE_LEFT",Txt_Score); + HTM_TH (3,1,"RT LINE_LEFT",Txt_Grade); + HTM_TH (3,1,"LINE_LEFT",NULL); + + HTM_TR_End (); + + /***** Second row *****/ + HTM_TR_Begin (NULL); + + HTM_TH (1,1,"RT LINE_LEFT",Txt_ANSWERS_non_blank); + HTM_TH (1,1,"RT",Txt_ANSWERS_blank); + HTM_TH (1,1,"RT LINE_LEFT",Txt_total); + HTM_TH (1,1,"RT",Txt_average); + + HTM_TR_End (); + + /***** Third row *****/ + HTM_TR_Begin (NULL); + + HTM_TH (1,1,"RT LINE_LEFT","-1≤pi≤1"); + HTM_TH (1,1,"RT","pi=0"); + HTM_TH (1,1,"RT LINE_LEFT","Σpi"); + HTM_TH (1,1,"RT","-1≤p≤1"); HTM_TR_End (); } @@ -2107,23 +2130,31 @@ static void TstPrn_ShowUsrPrints (struct UsrData *UsrDat) } /* Write number of questions */ - HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); + HTM_TD_Begin ("class=\"%s LINE_LEFT RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); if (ICanView.Result) HTM_Unsigned (Print.NumQsts); else Ico_PutIconNotVisible (); HTM_TD_End (); - /* Write number of questions not blank */ - HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); + /* Write number of non-blank answers */ + HTM_TD_Begin ("class=\"%s LINE_LEFT RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); if (ICanView.Result) HTM_Unsigned (Print.NumQstsNotBlank); else Ico_PutIconNotVisible (); HTM_TD_End (); - /* Write score */ + /* Write number of blank answers */ HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); + if (ICanView.Result) + HTM_Unsigned (Print.NumQsts - Print.NumQstsNotBlank); + else + Ico_PutIconNotVisible (); + HTM_TD_End (); + + /* Write score */ + HTM_TD_Begin ("class=\"%s LINE_LEFT RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); if (ICanView.Score) { HTM_Double2Decimals (Print.Score); @@ -2145,7 +2176,7 @@ static void TstPrn_ShowUsrPrints (struct UsrData *UsrDat) HTM_TD_End (); /* Write grade */ - HTM_TD_Begin ("class=\"%s RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); + HTM_TD_Begin ("class=\"%s LINE_LEFT RT COLOR%u\"",ClassDat,Gbl.RowEvenOdd); if (ICanView.Score) TstPrn_ComputeAndShowGrade (Print.NumQsts,Print.Score,Tst_SCORE_MAX); else @@ -2153,7 +2184,7 @@ static void TstPrn_ShowUsrPrints (struct UsrData *UsrDat) HTM_TD_End (); /* Link to show this test exam */ - HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd); + HTM_TD_Begin ("class=\"LINE_LEFT RT COLOR%u\"",Gbl.RowEvenOdd); if (ICanView.Result) { Frm_StartForm (Gbl.Action.Act == ActSeeMyTstResCrs ? ActSeeOneTstResMe : @@ -2246,25 +2277,31 @@ static void TstPrn_ShowPrintsSummaryRow (bool ItsMe, HTM_TR_Begin (NULL); /***** Row title *****/ - HTM_TD_Begin ("colspan=\"2\" class=\"DAT_N LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); + HTM_TD_Begin ("colspan=\"2\" class=\"DAT_N LINE_TOP LINE_BOTTOM RM COLOR%u\"",Gbl.RowEvenOdd); HTM_TxtColonNBSP (Txt_Visible_tests); HTM_Unsigned (NumPrints); HTM_TD_End (); /***** Write total number of questions *****/ - HTM_TD_Begin ("class=\"DAT_N LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); + HTM_TD_Begin ("class=\"DAT_N LINE_TOP LINE_BOTTOM LINE_LEFT RM COLOR%u\"",Gbl.RowEvenOdd); if (NumPrints) HTM_Unsigned (NumTotalQsts); HTM_TD_End (); - /***** Write total number of questions not blank *****/ - HTM_TD_Begin ("class=\"DAT_N LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); + /***** Write total number of non-blank answers *****/ + HTM_TD_Begin ("class=\"DAT_N LINE_TOP LINE_BOTTOM LINE_LEFT RM COLOR%u\"",Gbl.RowEvenOdd); if (NumPrints) HTM_Unsigned (NumTotalQstsNotBlank); HTM_TD_End (); + /***** Write total number of blank answers *****/ + HTM_TD_Begin ("class=\"DAT_N LINE_TOP LINE_BOTTOM RM COLOR%u\"",Gbl.RowEvenOdd); + if (NumPrints) + HTM_Unsigned (NumTotalQsts - NumTotalQstsNotBlank); + HTM_TD_End (); + /***** Write total score *****/ - HTM_TD_Begin ("class=\"DAT_N LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); + HTM_TD_Begin ("class=\"DAT_N LINE_TOP LINE_BOTTOM LINE_LEFT RM COLOR%u\"",Gbl.RowEvenOdd); if (ICanViewTotalScore) { HTM_Double2Decimals (TotalScoreOfAllTests); @@ -2274,20 +2311,20 @@ static void TstPrn_ShowPrintsSummaryRow (bool ItsMe, HTM_TD_End (); /***** 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 LINE_BOTTOM RM COLOR%u\"",Gbl.RowEvenOdd); if (ICanViewTotalScore) HTM_Double2Decimals (NumTotalQsts ? TotalScoreOfAllTests / (double) NumTotalQsts : 0.0); HTM_TD_End (); - /***** Write score over Tst_SCORE_MAX *****/ - HTM_TD_Begin ("class=\"DAT_N LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); + /***** Write grade over Tst_SCORE_MAX *****/ + HTM_TD_Begin ("class=\"DAT_N LINE_TOP LINE_BOTTOM LINE_LEFT RM COLOR%u\"",Gbl.RowEvenOdd); if (ICanViewTotalScore) TstPrn_ComputeAndShowGrade (NumTotalQsts,TotalScoreOfAllTests,Tst_SCORE_MAX); HTM_TD_End (); /***** Last cell *****/ - HTM_TD_Begin ("class=\"DAT_N LINE_TOP COLOR%u\"",Gbl.RowEvenOdd); + HTM_TD_Begin ("class=\"DAT_N LINE_TOP LINE_BOTTOM LINE_LEFT COLOR%u\"",Gbl.RowEvenOdd); HTM_TD_End (); /***** End row *****/ diff --git a/swad_text.c b/swad_text.c index fda8049f..115e30aa 100644 --- a/swad_text.c +++ b/swad_text.c @@ -2075,6 +2075,90 @@ const char *Txt_Answers = // Answers of test "Respostas"; #endif +const char *Txt_ANSWERS_blank = +#if L==1 // ca + "en blanc"; +#elif L==2 // de + "leere"; +#elif L==3 // en + "blank"; +#elif L==4 // es + "en blanco"; +#elif L==5 // fr + "vides"; +#elif L==6 // gn + "en blanco"; // Okoteve traducción +#elif L==7 // it + "vuote"; +#elif L==8 // pl + "puste"; +#elif L==9 // pt + "em branco"; +#endif + +const char *Txt_ANSWERS_correct = +#if L==1 // ca + "correctes"; +#elif L==2 // de + "richtige"; +#elif L==3 // en + "correct"; +#elif L==4 // es + "correctas"; +#elif L==5 // fr + "bonnes"; +#elif L==6 // gn + "correctas"; // Okoteve traducción +#elif L==7 // it + "corrette"; +#elif L==8 // pl + "prawidłowe"; +#elif L==9 // pt + "corretas"; +#endif + +const char *Txt_ANSWERS_non_blank = +#if L==1 // ca + "contestades"; +#elif L==2 // de + "non-blank"; +#elif L==3 // en + "non-blank"; +#elif L==4 // es + "contestadas"; +#elif L==5 // fr + "non vide"; +#elif L==6 // gn + "contestadas"; // Okoteve traducción +#elif L==7 // it + "risposte"; +#elif L==8 // pl + "niepustych"; +#elif L==9 // pt + "respondidas"; +#endif + +const char *Txt_ANSWERS_wrong = +#if L==1 // ca + "incorrectes"; +#elif L==2 // de + "falsche"; +#elif L==3 // en + "wrong"; +#elif L==4 // es + "erróneas"; +#elif L==5 // fr + "mauvaises"; +#elif L==6 // gn + "erróneas"; // Okoteve traducción +#elif L==7 // it + "sbagliate"; +#elif L==8 // pl + "złe"; +#elif L==9 // pt + "erradas"; +#endif + const char *Txt_Any_action = #if L==1 // ca "Qualsevol acció"; @@ -3107,27 +3191,6 @@ const char *Txt_Before_going_to_any_other_option_you_must_fill_in_your_email_add "você deve preencher seu endereço de email."; #endif -const char *Txt_blank_ANSWERS = -#if L==1 // ca - "en blanc"; -#elif L==2 // de - "leere"; -#elif L==3 // en - "blank"; -#elif L==4 // es - "en blanco"; -#elif L==5 // fr - "vides"; -#elif L==6 // gn - "en blanco"; // Okoteve traducción -#elif L==7 // it - "vuote"; -#elif L==8 // pl - "puste"; -#elif L==9 // pt - "em branco"; -#endif - const char *Txt_Briefcase_of_THE_USER_X_has_been_removed = // Warning: it is very important to include %s in the following sentences #if L==1 // ca "Se ha eliminado el maletín de %s."; // Necessita traduccio @@ -5009,27 +5072,6 @@ const char *Txt_Copy_source = "Origem da copia"; #endif -const char *Txt_correct_ANSWERS = -#if L==1 // ca - "correctes"; -#elif L==2 // de - "richtige"; -#elif L==3 // en - "correct"; -#elif L==4 // es - "correctas"; -#elif L==5 // fr - "bonnes"; -#elif L==6 // gn - "correctas"; // Okoteve traducción -#elif L==7 // it - "corrette"; -#elif L==8 // pl - "prawidłowe"; -#elif L==9 // pt - "corretas"; -#endif - const char *Txt_Could_not_detect_any_face_in_front_position_ = #if L==1 // ca "No s'ha detectat cap rostre en posició frontal."; @@ -27228,27 +27270,6 @@ const char *Txt_nobody_else_can_access_this_content = "ninguém mais pode acessar este conteúdo"; #endif -const char *Txt_Non_blank_BR_questions = -#if L==1 // ca - "Preguntes
contestades"; -#elif L==2 // de - "Non-blank
Fragen"; -#elif L==3 // en - "Non-blank
questions"; -#elif L==4 // es - "Preguntas
contestadas"; -#elif L==5 // fr - "Questions
non vide"; -#elif L==6 // gn - "Preguntas
contestadas"; // Okoteve traducción -#elif L==7 // it - "Domande
risposte"; -#elif L==8 // pl - "Niepustych
pytania"; -#elif L==9 // pt - "Perguntas
respondidas"; -#endif - const char *Txt_Not_applicable = #if L==1 // ca "No aplicable"; @@ -57148,27 +57169,6 @@ const char *Txt_Write_a_message = "Escrever uma mensagem"; #endif -const char *Txt_wrong_ANSWERS = -#if L==1 // ca - "incorrectes"; -#elif L==2 // de - "falsche"; -#elif L==3 // en - "wrong"; -#elif L==4 // es - "erróneas"; -#elif L==5 // fr - "mauvaises"; -#elif L==6 // gn - "erróneas"; // Okoteve traducción -#elif L==7 // it - "sbagliate"; -#elif L==8 // pl - "złe"; -#elif L==9 // pt - "erradas"; -#endif - const char *Txt_Wrong_file_type = #if L==1 // ca "Tipus d'arxiu incorrecte.";