mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-01 06:15:31 +02:00
Version19.230.2
This commit is contained in:
parent
7eba22a5d0
commit
f0a74dff92
|
@ -548,10 +548,12 @@ 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.230.1 (2020-05-15)"
|
#define Log_PLATFORM_VERSION "SWAD 19.230.2 (2020-05-15)"
|
||||||
#define CSS_FILE "swad19.230.1.css"
|
#define CSS_FILE "swad19.230.1.css"
|
||||||
#define JS_FILE "swad19.223.js"
|
#define JS_FILE "swad19.223.js"
|
||||||
/*
|
/*
|
||||||
|
Version 19.230.2: May 15, 2020 Changes in layout of exam prints.
|
||||||
|
Changes in edition of sets of questions. (301026 lines)
|
||||||
Version 19.230.1: May 15, 2020 Media in exams are shown occupying 50% instead of 100%. (300985 lines)
|
Version 19.230.1: May 15, 2020 Media in exams are shown occupying 50% instead of 100%. (300985 lines)
|
||||||
Version 19.230: May 15, 2020 Code refactoring and bug fixing in exams. (300984 lines)
|
Version 19.230: May 15, 2020 Code refactoring and bug fixing in exams. (300984 lines)
|
||||||
Version 19.229.2: May 14, 2020 Some messages translated in exam results. (301070 lines)
|
Version 19.229.2: May 14, 2020 Some messages translated in exam results. (301070 lines)
|
||||||
|
|
|
@ -640,8 +640,6 @@ static void ExaPrn_ShowTableWithQstsToFill (struct ExaPrn_Print *Print)
|
||||||
NumQst < Print->NumQsts;
|
NumQst < Print->NumQsts;
|
||||||
NumQst++)
|
NumQst++)
|
||||||
{
|
{
|
||||||
Gbl.RowEvenOdd = NumQst % 2;
|
|
||||||
|
|
||||||
/* Create test question */
|
/* Create test question */
|
||||||
Tst_QstConstructor (&Question);
|
Tst_QstConstructor (&Question);
|
||||||
Question.QstCod = Print->PrintedQuestions[NumQst].QstCod;
|
Question.QstCod = Print->PrintedQuestions[NumQst].QstCod;
|
||||||
|
@ -685,23 +683,25 @@ static void ExaPrn_WriteQstAndAnsToFill (struct ExaPrn_Print *Print,
|
||||||
|
|
||||||
/***** Title for this set *****/
|
/***** Title for this set *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
HTM_TD_Begin ("colspan=\"2\"");
|
HTM_TD_Begin ("colspan=\"2\" class=\"COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
ExaSet_WriteSetTitle (&CurrentSet);
|
ExaSet_WriteSetTitle (&CurrentSet);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
|
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Begin row *****/
|
/***** Begin row *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/***** Number of question and answer type *****/
|
/***** Number of question and answer type *****/
|
||||||
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"RT\"");
|
||||||
Tst_WriteNumQst (NumQst + 1);
|
Tst_WriteNumQst (NumQst + 1);
|
||||||
Tst_WriteAnswerType (Question->Answer.Type);
|
Tst_WriteAnswerType (Question->Answer.Type);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Stem, media and answers *****/
|
/***** Stem, media and answers *****/
|
||||||
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
|
|
||||||
/* Stem */
|
/* Stem */
|
||||||
Tst_WriteQstStem (Question->Stem,"TEST_EXA",true);
|
Tst_WriteQstStem (Question->Stem,"TEST_EXA",true);
|
||||||
|
|
|
@ -353,10 +353,6 @@ void ExaSet_ReceiveFormSet (void)
|
||||||
struct ExaSet_Set Set;
|
struct ExaSet_Set Set;
|
||||||
bool ItsANewSet;
|
bool ItsANewSet;
|
||||||
|
|
||||||
/***** Check if I can edit exams *****/
|
|
||||||
if (!Exa_CheckIfICanEditExams ())
|
|
||||||
Lay_NoPermissionExit ();
|
|
||||||
|
|
||||||
/***** Reset exams context *****/
|
/***** Reset exams context *****/
|
||||||
Exa_ResetExams (&Exams);
|
Exa_ResetExams (&Exams);
|
||||||
Exa_ResetExam (&Exam);
|
Exa_ResetExam (&Exam);
|
||||||
|
@ -374,6 +370,10 @@ void ExaSet_ReceiveFormSet (void)
|
||||||
Exa_GetDataOfExamByCod (&Exam);
|
Exa_GetDataOfExamByCod (&Exam);
|
||||||
Exams.ExaCod = Exam.ExaCod;
|
Exams.ExaCod = Exam.ExaCod;
|
||||||
|
|
||||||
|
/***** Check if exam is editable *****/
|
||||||
|
if (!Exa_CheckIfEditable (&Exam))
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** If I can edit exams ==> receive set from form *****/
|
/***** If I can edit exams ==> receive set from form *****/
|
||||||
ExaSet_ReceiveSetFieldsFromForm (&Set);
|
ExaSet_ReceiveSetFieldsFromForm (&Set);
|
||||||
if (ExaSet_CheckSetTitleReceivedFromForm (&Set,Set.Title))
|
if (ExaSet_CheckSetTitleReceivedFromForm (&Set,Set.Title))
|
||||||
|
@ -458,6 +458,10 @@ void ExaSet_ChangeSetTitle (void)
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
||||||
|
|
||||||
|
/***** Check if exam is editable *****/
|
||||||
|
if (!Exa_CheckIfEditable (&Exam))
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Receive new title from form *****/
|
/***** Receive new title from form *****/
|
||||||
Par_GetParToText ("Title",NewTitle,ExaSet_MAX_BYTES_TITLE);
|
Par_GetParToText ("Title",NewTitle,ExaSet_MAX_BYTES_TITLE);
|
||||||
|
|
||||||
|
@ -499,6 +503,10 @@ void ExaSet_ChangeNumQstsToExam (void)
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
||||||
|
|
||||||
|
/***** Check if exam is editable *****/
|
||||||
|
if (!Exa_CheckIfEditable (&Exam))
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Get number of questions in set to appear in exam print *****/
|
/***** Get number of questions in set to appear in exam print *****/
|
||||||
NumQstsToPrint = (unsigned) Par_GetParToUnsignedLong ("NumQstsToPrint",
|
NumQstsToPrint = (unsigned) Par_GetParToUnsignedLong ("NumQstsToPrint",
|
||||||
0,
|
0,
|
||||||
|
@ -964,7 +972,8 @@ void ExaSet_ListExamSets (struct Exa_Exams *Exams,
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
/***** Put forms to create/edit a set *****/
|
/***** Put forms to create/edit a set *****/
|
||||||
ExaSet_PutFormNewSet (Exams,Exam,Set,MaxSetInd);
|
if (ICanEditSets)
|
||||||
|
ExaSet_PutFormNewSet (Exams,Exam,Set,MaxSetInd);
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
@ -1142,29 +1151,49 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams,
|
||||||
/***** Title *****/
|
/***** Title *****/
|
||||||
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
HTM_ARTICLE_Begin (Anchor);
|
HTM_ARTICLE_Begin (Anchor);
|
||||||
Frm_StartFormAnchor (ActChgTitExaSet,Anchor);
|
if (ICanEditSets)
|
||||||
ExaSet_PutParamsOneSet (Exams);
|
{
|
||||||
HTM_INPUT_TEXT ("Title",ExaSet_MAX_CHARS_TITLE,Set.Title,
|
Frm_StartFormAnchor (ActChgTitExaSet,Anchor);
|
||||||
HTM_SUBMIT_ON_CHANGE,
|
ExaSet_PutParamsOneSet (Exams);
|
||||||
"id=\"Title\" required=\"required\""
|
HTM_INPUT_TEXT ("Title",ExaSet_MAX_CHARS_TITLE,Set.Title,
|
||||||
" class=\"TITLE_DESCRIPTION_WIDTH\"");
|
HTM_SUBMIT_ON_CHANGE,
|
||||||
Frm_EndForm ();
|
"id=\"Title\" required=\"required\""
|
||||||
|
" class=\"TITLE_DESCRIPTION_WIDTH\"");
|
||||||
|
Frm_EndForm ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HTM_SPAN_Begin ("class=\"EXA_SET_TITLE\"");
|
||||||
|
HTM_Txt (Set.Title);
|
||||||
|
HTM_SPAN_End ();
|
||||||
|
}
|
||||||
HTM_ARTICLE_End ();
|
HTM_ARTICLE_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Current number of questions in set *****/
|
/***** Current number of questions in set *****/
|
||||||
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
|
HTM_SPAN_Begin ("class=\"EXA_SET_NUM_QSTS\"");
|
||||||
HTM_Unsigned (ExaSet_GetNumQstsInSet (Set.SetCod));
|
HTM_Unsigned (ExaSet_GetNumQstsInSet (Set.SetCod));
|
||||||
|
HTM_SPAN_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Number of questions to appear in exam print *****/
|
/***** Number of questions to appear in exam print *****/
|
||||||
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
|
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
|
||||||
Frm_StartFormAnchor (ActChgNumQstExaSet,Anchor);
|
if (ICanEditSets)
|
||||||
ExaSet_PutParamsOneSet (Exams);
|
{
|
||||||
HTM_INPUT_LONG ("NumQstsToPrint",0,UINT_MAX,(long) Set.NumQstsToPrint,
|
Frm_StartFormAnchor (ActChgNumQstExaSet,Anchor);
|
||||||
HTM_SUBMIT_ON_CHANGE,false,
|
ExaSet_PutParamsOneSet (Exams);
|
||||||
"class=\"INPUT_LONG\" required=\"required\"");
|
HTM_INPUT_LONG ("NumQstsToPrint",0,UINT_MAX,(long) Set.NumQstsToPrint,
|
||||||
Frm_EndForm ();
|
HTM_SUBMIT_ON_CHANGE,false,
|
||||||
|
"class=\"INPUT_LONG\" required=\"required\"");
|
||||||
|
Frm_EndForm ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HTM_SPAN_Begin ("class=\"EXA_SET_NUM_QSTS\"");
|
||||||
|
HTM_Unsigned (Set.NumQstsToPrint);
|
||||||
|
HTM_SPAN_End ();
|
||||||
|
}
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** End first row *****/
|
/***** End first row *****/
|
||||||
|
@ -1740,6 +1769,10 @@ void ExaSet_RequestRemoveSet (void)
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
||||||
|
|
||||||
|
/***** Check if exam is editable *****/
|
||||||
|
if (!Exa_CheckIfEditable (&Exam))
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Show question and button to remove question *****/
|
/***** Show question and button to remove question *****/
|
||||||
Ale_ShowAlertAndButton (ActRemExaSet,NULL,NULL,
|
Ale_ShowAlertAndButton (ActRemExaSet,NULL,NULL,
|
||||||
ExaSet_PutParamsOneSet,&Exams,
|
ExaSet_PutParamsOneSet,&Exams,
|
||||||
|
@ -1771,6 +1804,10 @@ void ExaSet_RemoveSet (void)
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
||||||
|
|
||||||
|
/***** Check if exam is editable *****/
|
||||||
|
if (!Exa_CheckIfEditable (&Exam))
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Remove the set from all the tables *****/
|
/***** Remove the set from all the tables *****/
|
||||||
/* Remove questions associated to set */
|
/* Remove questions associated to set */
|
||||||
DB_QueryDELETE ("can not remove questions associated to set",
|
DB_QueryDELETE ("can not remove questions associated to set",
|
||||||
|
@ -1825,6 +1862,10 @@ void ExaSet_MoveUpSet (void)
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
||||||
|
|
||||||
|
/***** Check if exam is editable *****/
|
||||||
|
if (!Exa_CheckIfEditable (&Exam))
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Get set index *****/
|
/***** Get set index *****/
|
||||||
SetIndBottom = ExaSet_GetSetIndFromSetCod (Exam.ExaCod,Set.SetCod);
|
SetIndBottom = ExaSet_GetSetIndFromSetCod (Exam.ExaCod,Set.SetCod);
|
||||||
|
|
||||||
|
@ -1869,6 +1910,10 @@ void ExaSet_MoveDownSet (void)
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
|
||||||
|
|
||||||
|
/***** Check if exam is editable *****/
|
||||||
|
if (!Exa_CheckIfEditable (&Exam))
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Get set index *****/
|
/***** Get set index *****/
|
||||||
SetIndTop = ExaSet_GetSetIndFromSetCod (Exam.ExaCod,Set.SetCod);
|
SetIndTop = ExaSet_GetSetIndFromSetCod (Exam.ExaCod,Set.SetCod);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user