From f5ba3878476e6f309f3673b6736581631323b65a Mon Sep 17 00:00:00 2001 From: acanas Date: Sat, 30 May 2020 20:25:19 +0200 Subject: [PATCH] Version19.248.4 --- swad_changelog.h | 3 ++- swad_test.c | 34 ++++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index d50e50c03..cb6b3ad09 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -556,10 +556,11 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.248.2 (2020-05-25)" +#define Log_PLATFORM_VERSION "SWAD 19.248.4 (2020-05-25)" #define CSS_FILE "swad19.238.2.css" #define JS_FILE "swad19.246.1.js" /* + Version 19.248.4: May 30, 2020 Code refactoring in selection of questions. (302867 lines) Version 19.248.3: May 30, 2020 Selection of all questions to add to a game. (302863 lines) Version 19.248.2: May 30, 2020 Selection of all questions to add to a set. Suggested by Nuria Torres Rosell. (302854 lines) Version 19.248.1: May 30, 2020 Exam session results can not be marked as visible if end of time is not in the past. (302825 lines) diff --git a/swad_test.c b/swad_test.c index 85cf56a67..0b52e0ba0 100644 --- a/swad_test.c +++ b/swad_test.c @@ -176,6 +176,7 @@ static void Tst_ListOneOrMoreQuestionsForSelectionForSet (struct Exa_Exams *Exam static void Tst_ListOneOrMoreQuestionsForSelectionForGame (struct Gam_Games *Games, unsigned NumQsts, MYSQL_RES *mysql_res); +static void Tst_PutCheckboxToSelectAllQuestions (void); static void Tst_WriteQuestionRowForSelection (unsigned NumQst, struct Tst_Question *Question); @@ -2597,9 +2598,7 @@ static void Tst_ListOneOrMoreQuestionsForSelectionForSet (struct Exa_Exams *Exam MYSQL_RES *mysql_res) { extern const char *Hlp_ASSESSMENT_Exams_questions; - extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *Txt_Questions; - extern const char *Txt_All_questions; extern const char *Txt_No_INDEX; extern const char *Txt_Code; extern const char *Txt_Date; @@ -2622,11 +2621,7 @@ static void Tst_ListOneOrMoreQuestionsForSelectionForSet (struct Exa_Exams *Exam ExaSet_PutParamsOneSet (Exams); /***** Select all questions *****/ - HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_INPUT_CHECKBOX ("AllQsts",HTM_DONT_SUBMIT_ON_CHANGE, - "value=\"Y\" onclick=\"togglecheckChildren(this,'QstCods');\""); - HTM_TxtF (" %s",Txt_All_questions); - HTM_LABEL_End (); + Tst_PutCheckboxToSelectAllQuestions (); /***** Write the heading *****/ HTM_TABLE_BeginWideMarginPadding (5); @@ -2688,9 +2683,7 @@ static void Tst_ListOneOrMoreQuestionsForSelectionForGame (struct Gam_Games *Gam MYSQL_RES *mysql_res) { extern const char *Hlp_ASSESSMENT_Games_questions; - extern const char *The_ClassFormInBox[The_NUM_THEMES]; extern const char *Txt_Questions; - extern const char *Txt_All_questions; extern const char *Txt_No_INDEX; extern const char *Txt_Code; extern const char *Txt_Date; @@ -2713,11 +2706,7 @@ static void Tst_ListOneOrMoreQuestionsForSelectionForGame (struct Gam_Games *Gam Gam_PutParams (Games); /***** Select all questions *****/ - HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); - HTM_INPUT_CHECKBOX ("AllQsts",HTM_DONT_SUBMIT_ON_CHANGE, - "value=\"Y\" onclick=\"togglecheckChildren(this,'QstCods');\""); - HTM_TxtF (" %s",Txt_All_questions); - HTM_LABEL_End (); + Tst_PutCheckboxToSelectAllQuestions (); /***** Write the heading *****/ HTM_TABLE_BeginWideMarginPadding (5); @@ -2770,6 +2759,23 @@ static void Tst_ListOneOrMoreQuestionsForSelectionForGame (struct Gam_Games *Gam Box_BoxEnd (); } +/*****************************************************************************/ +/************** Select all questions to add them to set/game *****************/ +/*****************************************************************************/ + +static void Tst_PutCheckboxToSelectAllQuestions (void) + { + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_All_questions; + + /***** Checkbox to select all listed questions *****/ + HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]); + HTM_INPUT_CHECKBOX ("AllQsts",HTM_DONT_SUBMIT_ON_CHANGE, + "value=\"Y\" onclick=\"togglecheckChildren(this,'QstCods');\""); + HTM_TxtF (" %s",Txt_All_questions); + HTM_LABEL_End (); + } + /*****************************************************************************/ /********************** Write question row for selection *********************/ /*****************************************************************************/