mirror of https://github.com/acanas/swad-core.git
Version19.156.3
This commit is contained in:
parent
ede01923f7
commit
62f596e0de
|
@ -13251,10 +13251,10 @@ INSERT INTO log SELECT * FROM log_full WHERE YEAR(ClickTime) = 2011; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE YEAR(ClickTime) = 2012; Hecho
|
INSERT INTO log SELECT * FROM log_full WHERE YEAR(ClickTime) = 2012; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE YEAR(ClickTime) = 2013; Hecho
|
INSERT INTO log SELECT * FROM log_full WHERE YEAR(ClickTime) = 2013; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140101' AND ClickTime<'20140201'; Hecho
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140101' AND ClickTime<'20140201'; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140201' AND ClickTime<'20140301';
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140201' AND ClickTime<'20140301'; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140301' AND ClickTime<'20140401';
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140301' AND ClickTime<'20140401'; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140401' AND ClickTime<'20140501';
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140401' AND ClickTime<'20140501'; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140501' AND ClickTime<'20140601';
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140501' AND ClickTime<'20140601'; Hecho
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140601' AND ClickTime<'20140701';
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140601' AND ClickTime<'20140701';
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140701' AND ClickTime<'20140801';
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140701' AND ClickTime<'20140801';
|
||||||
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140801' AND ClickTime<'20140901';
|
INSERT INTO log SELECT * FROM log_full WHERE ClickTime>='20140801' AND ClickTime<'20140901';
|
||||||
|
|
|
@ -497,7 +497,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.156.2 (2020-03-29)"
|
#define Log_PLATFORM_VERSION "SWAD 19.156.3 (2020-03-29)"
|
||||||
#define CSS_FILE "swad19.146.css"
|
#define CSS_FILE "swad19.146.css"
|
||||||
#define JS_FILE "swad19.153.js"
|
#define JS_FILE "swad19.153.js"
|
||||||
/*
|
/*
|
||||||
|
@ -528,6 +528,8 @@ Param
|
||||||
El examen se muestra en pantalla tomándolo del examen en la base de datos, no del formulario.
|
El examen se muestra en pantalla tomándolo del examen en la base de datos, no del formulario.
|
||||||
Cuando el alumno pulsa en "He terminado" se le pregunta si está seguro y se vuelve a mostrar el examen cogiéndolo de la base de datos.
|
Cuando el alumno pulsa en "He terminado" se le pregunta si está seguro y se vuelve a mostrar el examen cogiéndolo de la base de datos.
|
||||||
|
|
||||||
|
Version 19.156.4: Mar 29, 2020 Test exam is stored in database when it's generated. (? lines)
|
||||||
|
Version 19.156.3: Mar 29, 2020 Code refactoring in tests. (284585 lines)
|
||||||
Version 19.156.2: Mar 29, 2020 Test exam with start date and end date. (284568 lines)
|
Version 19.156.2: Mar 29, 2020 Test exam with start date and end date. (284568 lines)
|
||||||
Version 19.156.1: Mar 29, 2020 List of test exams with start date and end date. (284557 lines)
|
Version 19.156.1: Mar 29, 2020 List of test exams with start date and end date. (284557 lines)
|
||||||
Version 19.156: Mar 28, 2020 New action to confirm assessment of test exam.
|
Version 19.156: Mar 28, 2020 New action to confirm assessment of test exam.
|
||||||
|
|
87
swad_test.c
87
swad_test.c
|
@ -129,6 +129,8 @@ static void Tst_FreeTagsList (struct Tst_Tags *Tags);
|
||||||
|
|
||||||
static void Tst_ShowFormRequestTest (struct Tst_Test *Test);
|
static void Tst_ShowFormRequestTest (struct Tst_Test *Test);
|
||||||
|
|
||||||
|
static void Tst_PutCheckBoxAllowTeachers (bool AllowTeachers);
|
||||||
|
|
||||||
static void Tst_GetQuestionsAndAnswersFromForm (struct TsR_Result *Result);
|
static void Tst_GetQuestionsAndAnswersFromForm (struct TsR_Result *Result);
|
||||||
static bool Tst_CheckIfNextTstAllowed (void);
|
static bool Tst_CheckIfNextTstAllowed (void);
|
||||||
static void Tst_SetTstStatus (unsigned NumTst,Tst_Status_t TstStatus);
|
static void Tst_SetTstStatus (unsigned NumTst,Tst_Status_t TstStatus);
|
||||||
|
@ -475,10 +477,8 @@ static void Tst_ShowFormRequestTest (struct Tst_Test *Test)
|
||||||
void Tst_ShowNewTest (void)
|
void Tst_ShowNewTest (void)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Tests;
|
extern const char *Hlp_ASSESSMENT_Tests;
|
||||||
extern const char *The_ClassFormInBox[The_NUM_THEMES];
|
|
||||||
extern const char *Txt_No_questions_found_matching_your_search_criteria;
|
extern const char *Txt_No_questions_found_matching_your_search_criteria;
|
||||||
extern const char *Txt_Test;
|
extern const char *Txt_Test;
|
||||||
extern const char *Txt_Allow_teachers_to_consult_this_test;
|
|
||||||
extern const char *Txt_Done_assess_test;
|
extern const char *Txt_Done_assess_test;
|
||||||
struct Tst_Test Test;
|
struct Tst_Test Test;
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
|
@ -497,12 +497,7 @@ void Tst_ShowNewTest (void)
|
||||||
{
|
{
|
||||||
/***** Get questions *****/
|
/***** Get questions *****/
|
||||||
Tst_GetQuestionsForTest (&Test,&mysql_res);
|
Tst_GetQuestionsForTest (&Test,&mysql_res);
|
||||||
if (Test.NumQsts == 0) // Query database
|
if (Test.NumQsts)
|
||||||
{
|
|
||||||
Ale_ShowAlert (Ale_INFO,Txt_No_questions_found_matching_your_search_criteria);
|
|
||||||
Tst_ShowFormRequestTest (&Test); // Show the form again
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/***** Get and update number of hits *****/
|
/***** Get and update number of hits *****/
|
||||||
NumAccessesTst = Tst_GetNumAccessesTst () + 1;
|
NumAccessesTst = Tst_GetNumAccessesTst () + 1;
|
||||||
|
@ -524,19 +519,10 @@ void Tst_ShowNewTest (void)
|
||||||
Par_PutHiddenParamUnsigned (NULL,"NumQst",Test.NumQsts);
|
Par_PutHiddenParamUnsigned (NULL,"NumQst",Test.NumQsts);
|
||||||
|
|
||||||
/***** List the questions *****/
|
/***** List the questions *****/
|
||||||
HTM_TABLE_BeginWideMarginPadding (10);
|
|
||||||
Tst_ShowTestQuestionsWhenSeeing (Test.NumQsts,mysql_res);
|
Tst_ShowTestQuestionsWhenSeeing (Test.NumQsts,mysql_res);
|
||||||
HTM_TABLE_End ();
|
|
||||||
|
|
||||||
/***** Test result will be saved? *****/
|
/***** Test result will be saved? *****/
|
||||||
HTM_DIV_Begin ("class=\"CM\"");
|
Tst_PutCheckBoxAllowTeachers (true);
|
||||||
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
|
||||||
HTM_INPUT_CHECKBOX ("AllowTchs",HTM_DONT_SUBMIT_ON_CHANGE,
|
|
||||||
"value=\"Y\""
|
|
||||||
" checked=\"checked\""); // By default, teachers can see test result
|
|
||||||
HTM_TxtF (" %s",Txt_Allow_teachers_to_consult_this_test);
|
|
||||||
HTM_LABEL_End ();
|
|
||||||
HTM_DIV_End ();
|
|
||||||
|
|
||||||
/***** End form *****/
|
/***** End form *****/
|
||||||
Btn_PutConfirmButton (Txt_Done_assess_test);
|
Btn_PutConfirmButton (Txt_Done_assess_test);
|
||||||
|
@ -552,6 +538,11 @@ void Tst_ShowNewTest (void)
|
||||||
if (Gbl.Usrs.Me.Role.Logged == Rol_STD)
|
if (Gbl.Usrs.Me.Role.Logged == Rol_STD)
|
||||||
Tst_UpdateLastAccTst (Test.NumQsts);
|
Tst_UpdateLastAccTst (Test.NumQsts);
|
||||||
}
|
}
|
||||||
|
else // No questions found
|
||||||
|
{
|
||||||
|
Ale_ShowAlert (Ale_INFO,Txt_No_questions_found_matching_your_search_criteria);
|
||||||
|
Tst_ShowFormRequestTest (&Test); // Show the form again
|
||||||
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
@ -564,6 +555,27 @@ void Tst_ShowNewTest (void)
|
||||||
Tst_TstDestructor (&Test);
|
Tst_TstDestructor (&Test);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************ Put checkbox to allow teachers to see test result **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Tst_PutCheckBoxAllowTeachers (bool AllowTeachers)
|
||||||
|
{
|
||||||
|
extern const char *The_ClassFormInBox[The_NUM_THEMES];
|
||||||
|
extern const char *Txt_Allow_teachers_to_consult_this_test;
|
||||||
|
|
||||||
|
/***** Test result will be available for teachers? *****/
|
||||||
|
HTM_DIV_Begin ("class=\"CM\"");
|
||||||
|
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
|
||||||
|
HTM_INPUT_CHECKBOX ("AllowTchs",HTM_DONT_SUBMIT_ON_CHANGE,
|
||||||
|
"value=\"Y\"%s",
|
||||||
|
AllowTeachers ? " checked=\"checked\"" : // Teachers can see test result
|
||||||
|
"");
|
||||||
|
HTM_TxtF (" %s",Txt_Allow_teachers_to_consult_this_test);
|
||||||
|
HTM_LABEL_End ();
|
||||||
|
HTM_DIV_End ();
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************* Request the assessment of a test **********************/
|
/********************* Request the assessment of a test **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -962,26 +974,35 @@ static void Tst_ShowTestQuestionsWhenSeeing (unsigned NumQsts,
|
||||||
struct Tst_Question Question;
|
struct Tst_Question Question;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
|
||||||
/***** Write rows *****/
|
if (NumQsts)
|
||||||
for (NumQst = 0;
|
|
||||||
NumQst < NumQsts;
|
|
||||||
NumQst++)
|
|
||||||
{
|
{
|
||||||
Gbl.RowEvenOdd = NumQst % 2;
|
/***** Begin table *****/
|
||||||
|
HTM_TABLE_BeginWideMarginPadding (10);
|
||||||
|
|
||||||
/* Create test question */
|
/***** Write one row for each question *****/
|
||||||
Tst_QstConstructor (&Question);
|
for (NumQst = 0;
|
||||||
|
NumQst < NumQsts;
|
||||||
|
NumQst++)
|
||||||
|
{
|
||||||
|
Gbl.RowEvenOdd = NumQst % 2;
|
||||||
|
|
||||||
/* Get question code (row[0]) */
|
/* Create test question */
|
||||||
row = mysql_fetch_row (mysql_res);
|
Tst_QstConstructor (&Question);
|
||||||
if ((Question.QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
|
||||||
Lay_ShowErrorAndExit ("Wrong code of question.");
|
|
||||||
|
|
||||||
/* Show question */
|
/* Get question code (row[0]) */
|
||||||
Tst_ShowOneTestQuestionWhenSeeing (NumQst,&Question);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
if ((Question.QstCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||||
|
Lay_ShowErrorAndExit ("Wrong code of question.");
|
||||||
|
|
||||||
/* Destroy test question */
|
/* Show question */
|
||||||
Tst_QstDestructor (&Question);
|
Tst_ShowOneTestQuestionWhenSeeing (NumQst,&Question);
|
||||||
|
|
||||||
|
/* Destroy test question */
|
||||||
|
Tst_QstDestructor (&Question);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** End table *****/
|
||||||
|
HTM_TABLE_End ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue