From 0863d9ea5e597c97260c5fa8a35bed8ae9e30de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 19 Nov 2016 16:46:43 +0100 Subject: [PATCH] Version 16.64.21 --- swad_changelog.h | 3 ++- swad_database.c | 24 ++++++++++++------------ swad_test.c | 17 +++++++++++------ swad_test.h | 4 +++- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 8addae6e1..70eefe9e9 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -170,13 +170,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.64.20 (2016-11-19)" +#define Log_PLATFORM_VERSION "SWAD 16.64.21 (2016-11-19)" #define CSS_FILE "swad16.60.1.css" #define JS_FILE "swad16.46.1.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* + Version 16.64.21: Nov 19, 2016 Input fields required in form to configure tests. (207324 lines) Version 16.64.20: Nov 19, 2016 Input field required in new link form. (207316 lines) Version 16.64.19: Nov 19, 2016 Input field required in new folder form. (207314 lines) Version 16.64.18: Nov 19, 2016 Input field required in search form. (207312 lines) diff --git a/swad_database.c b/swad_database.c index 517d84826..64c493f83 100644 --- a/swad_database.c +++ b/swad_database.c @@ -2276,18 +2276,18 @@ mysql> DESCRIBE tst_answers; /***** Table tst_config *****/ /* mysql> DESCRIBE tst_config; -+---------------------+--------------------------------------------------------------+------+-----+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+---------------------+--------------------------------------------------------------+------+-----+---------+-------+ -| CrsCod | int(11) | NO | PRI | -1 | | -| Pluggable | enum('N','Y') | NO | | N | | -| Min | int(11) | NO | | NULL | | -| Def | int(11) | NO | | NULL | | -| Max | int(11) | NO | | NULL | | -| MinTimeNxtTstPerQst | int(11) | NO | | 0 | | -| Feedback | enum('nothing','total_result','each_result','each_good_bad') | NO | | NULL | | -+---------------------+--------------------------------------------------------------+------+-----+---------+-------+ -7 rows in set (0.00 sec) ++---------------------+------------------------------------------------------------------------------+------+-----+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------------------+------------------------------------------------------------------------------+------+-----+---------+-------+ +| CrsCod | int(11) | NO | PRI | -1 | | +| Pluggable | enum('unknown','N','Y') | NO | | unknown | | +| Min | int(11) | NO | | NULL | | +| Def | int(11) | NO | | NULL | | +| Max | int(11) | NO | | NULL | | +| MinTimeNxtTstPerQst | int(11) | NO | | 0 | | +| Feedback | enum('nothing','total_result','each_result','each_good_bad','full_feedback') | NO | | NULL | | ++---------------------+------------------------------------------------------------------------------+------+-----+---------+-------+ +7 rows in set (0,00 sec) */ DB_CreateTable ("CREATE TABLE IF NOT EXISTS tst_config (" "CrsCod INT NOT NULL DEFAULT -1," diff --git a/swad_test.c b/swad_test.c index e15122bec..01f50ac56 100644 --- a/swad_test.c +++ b/swad_test.c @@ -1866,7 +1866,8 @@ static void Tst_ShowFormConfigTst (void) "" "" "" + " size=\"3\" maxlength=\"3\" value=\"%u\"" + " required=\"required\" />" "" "", Txt_minimum,Gbl.Test.Config.Min); @@ -1878,7 +1879,8 @@ static void Tst_ShowFormConfigTst (void) "" "" "" + " size=\"3\" maxlength=\"3\" value=\"%u\"" + " required=\"required\" />" "" "", Txt_default,Gbl.Test.Config.Def); @@ -1890,7 +1892,8 @@ static void Tst_ShowFormConfigTst (void) "" "" "" + " size=\"3\" maxlength=\"3\" value=\"%u\"" + " required=\"required\" />" "" "" "" @@ -1905,7 +1908,8 @@ static void Tst_ShowFormConfigTst (void) "" "" "" + " size=\"7\" maxlength=\"7\" value=\"%lu\"" + " required=\"required\" />" "" "", The_ClassForm[Gbl.Prefs.Theme], @@ -2139,14 +2143,15 @@ void Tst_ReceiveConfigTst (void) Gbl.Test.Config.FeedbackType = Tst_GetFeedbackTypeFromForm (); /***** Update database *****/ - sprintf (Query,"REPLACE INTO tst_config (CrsCod,Pluggable,Min,Def,Max,MinTimeNxtTstPerQst,Feedback)" + sprintf (Query,"REPLACE INTO tst_config" + " (CrsCod,Pluggable,Min,Def,Max,MinTimeNxtTstPerQst,Feedback)" " VALUES ('%ld','%s','%u','%u','%u','%lu','%s')", Gbl.CurrentCrs.Crs.CrsCod, Tst_PluggableDB[Gbl.Test.Config.Pluggable], Gbl.Test.Config.Min,Gbl.Test.Config.Def,Gbl.Test.Config.Max, Gbl.Test.Config.MinTimeNxtTstPerQst, Tst_FeedbackDB[Gbl.Test.Config.FeedbackType]); - DB_QueryREPLACE (Query,"can not save configuration of test"); + DB_QueryREPLACE (Query,"can not save configuration of tests"); /***** Show confirmation message *****/ Lay_ShowAlert (Lay_SUCCESS,Txt_The_test_configuration_has_been_updated); diff --git a/swad_test.h b/swad_test.h index 5ab001804..fdc22f2b9 100644 --- a/swad_test.h +++ b/swad_test.h @@ -74,7 +74,9 @@ typedef enum struct Tst_Config { Tst_Pluggable_t Pluggable; - unsigned Min,Def,Max; + unsigned Min; // Minimum number of questions + unsigned Def; // Default number of questions + unsigned Max; // Maximum number of questions unsigned long MinTimeNxtTstPerQst; Tst_Feedback_t FeedbackType; };