Version 16.64.21

This commit is contained in:
Antonio Cañas Vargas 2016-11-19 16:46:43 +01:00
parent 8d92afa50a
commit 0863d9ea5e
4 changed files with 28 additions and 20 deletions

View File

@ -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)

View File

@ -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,"

View File

@ -1866,7 +1866,8 @@ static void Tst_ShowFormConfigTst (void)
"</td>"
"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"NumQstMin\""
" size=\"3\" maxlength=\"3\" value=\"%u\" />"
" size=\"3\" maxlength=\"3\" value=\"%u\""
" required=\"required\" />"
"</td>"
"</tr>",
Txt_minimum,Gbl.Test.Config.Min);
@ -1878,7 +1879,8 @@ static void Tst_ShowFormConfigTst (void)
"</td>"
"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"NumQstDef\""
" size=\"3\" maxlength=\"3\" value=\"%u\" />"
" size=\"3\" maxlength=\"3\" value=\"%u\""
" required=\"required\" />"
"</td>"
"</tr>",
Txt_default,Gbl.Test.Config.Def);
@ -1890,7 +1892,8 @@ static void Tst_ShowFormConfigTst (void)
"</td>"
"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"NumQstMax\""
" size=\"3\" maxlength=\"3\" value=\"%u\" />"
" size=\"3\" maxlength=\"3\" value=\"%u\""
" required=\"required\" />"
"</td>"
"</tr>"
"</table>"
@ -1905,7 +1908,8 @@ static void Tst_ShowFormConfigTst (void)
"</td>"
"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"MinTimeNxtTstPerQst\""
" size=\"7\" maxlength=\"7\" value=\"%lu\" />"
" size=\"7\" maxlength=\"7\" value=\"%lu\""
" required=\"required\" />"
"</td>"
"</tr>",
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);

View File

@ -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;
};