Version19.230.2

This commit is contained in:
acanas 2020-05-15 20:30:46 +02:00
parent 7eba22a5d0
commit f0a74dff92
3 changed files with 71 additions and 24 deletions

View File

@ -548,10 +548,12 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
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 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: 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)

View File

@ -640,8 +640,6 @@ static void ExaPrn_ShowTableWithQstsToFill (struct ExaPrn_Print *Print)
NumQst < Print->NumQsts;
NumQst++)
{
Gbl.RowEvenOdd = NumQst % 2;
/* Create test question */
Tst_QstConstructor (&Question);
Question.QstCod = Print->PrintedQuestions[NumQst].QstCod;
@ -685,23 +683,25 @@ static void ExaPrn_WriteQstAndAnsToFill (struct ExaPrn_Print *Print,
/***** Title for this set *****/
HTM_TR_Begin (NULL);
HTM_TD_Begin ("colspan=\"2\"");
HTM_TD_Begin ("colspan=\"2\" class=\"COLOR%u\"",Gbl.RowEvenOdd);
ExaSet_WriteSetTitle (&CurrentSet);
HTM_TD_End ();
HTM_TR_End ();
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
}
/***** Begin row *****/
HTM_TR_Begin (NULL);
/***** 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_WriteAnswerType (Question->Answer.Type);
HTM_TD_End ();
/***** Stem, media and answers *****/
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
HTM_TD_Begin ("class=\"LT\"");
/* Stem */
Tst_WriteQstStem (Question->Stem,"TEST_EXA",true);

View File

@ -353,10 +353,6 @@ void ExaSet_ReceiveFormSet (void)
struct ExaSet_Set Set;
bool ItsANewSet;
/***** Check if I can edit exams *****/
if (!Exa_CheckIfICanEditExams ())
Lay_NoPermissionExit ();
/***** Reset exams context *****/
Exa_ResetExams (&Exams);
Exa_ResetExam (&Exam);
@ -374,6 +370,10 @@ void ExaSet_ReceiveFormSet (void)
Exa_GetDataOfExamByCod (&Exam);
Exams.ExaCod = Exam.ExaCod;
/***** Check if exam is editable *****/
if (!Exa_CheckIfEditable (&Exam))
Lay_NoPermissionExit ();
/***** If I can edit exams ==> receive set from form *****/
ExaSet_ReceiveSetFieldsFromForm (&Set);
if (ExaSet_CheckSetTitleReceivedFromForm (&Set,Set.Title))
@ -458,6 +458,10 @@ void ExaSet_ChangeSetTitle (void)
/***** Get and check parameters *****/
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
/***** Check if exam is editable *****/
if (!Exa_CheckIfEditable (&Exam))
Lay_NoPermissionExit ();
/***** Receive new title from form *****/
Par_GetParToText ("Title",NewTitle,ExaSet_MAX_BYTES_TITLE);
@ -499,6 +503,10 @@ void ExaSet_ChangeNumQstsToExam (void)
/***** Get and check parameters *****/
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 *****/
NumQstsToPrint = (unsigned) Par_GetParToUnsignedLong ("NumQstsToPrint",
0,
@ -964,7 +972,8 @@ void ExaSet_ListExamSets (struct Exa_Exams *Exams,
DB_FreeMySQLResult (&mysql_res);
/***** Put forms to create/edit a set *****/
ExaSet_PutFormNewSet (Exams,Exam,Set,MaxSetInd);
if (ICanEditSets)
ExaSet_PutFormNewSet (Exams,Exam,Set,MaxSetInd);
/***** End box *****/
Box_BoxEnd ();
@ -1142,29 +1151,49 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams,
/***** Title *****/
HTM_TD_Begin ("class=\"LT COLOR%u\"",Gbl.RowEvenOdd);
HTM_ARTICLE_Begin (Anchor);
Frm_StartFormAnchor (ActChgTitExaSet,Anchor);
ExaSet_PutParamsOneSet (Exams);
HTM_INPUT_TEXT ("Title",ExaSet_MAX_CHARS_TITLE,Set.Title,
HTM_SUBMIT_ON_CHANGE,
"id=\"Title\" required=\"required\""
" class=\"TITLE_DESCRIPTION_WIDTH\"");
Frm_EndForm ();
if (ICanEditSets)
{
Frm_StartFormAnchor (ActChgTitExaSet,Anchor);
ExaSet_PutParamsOneSet (Exams);
HTM_INPUT_TEXT ("Title",ExaSet_MAX_CHARS_TITLE,Set.Title,
HTM_SUBMIT_ON_CHANGE,
"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_TD_End ();
/***** Current number of questions in set *****/
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
HTM_SPAN_Begin ("class=\"EXA_SET_NUM_QSTS\"");
HTM_Unsigned (ExaSet_GetNumQstsInSet (Set.SetCod));
HTM_SPAN_End ();
HTM_TD_End ();
/***** Number of questions to appear in exam print *****/
HTM_TD_Begin ("class=\"RT COLOR%u\"",Gbl.RowEvenOdd);
Frm_StartFormAnchor (ActChgNumQstExaSet,Anchor);
ExaSet_PutParamsOneSet (Exams);
HTM_INPUT_LONG ("NumQstsToPrint",0,UINT_MAX,(long) Set.NumQstsToPrint,
HTM_SUBMIT_ON_CHANGE,false,
"class=\"INPUT_LONG\" required=\"required\"");
Frm_EndForm ();
if (ICanEditSets)
{
Frm_StartFormAnchor (ActChgNumQstExaSet,Anchor);
ExaSet_PutParamsOneSet (Exams);
HTM_INPUT_LONG ("NumQstsToPrint",0,UINT_MAX,(long) Set.NumQstsToPrint,
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 ();
/***** End first row *****/
@ -1740,6 +1769,10 @@ void ExaSet_RequestRemoveSet (void)
/***** Get and check parameters *****/
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
/***** Check if exam is editable *****/
if (!Exa_CheckIfEditable (&Exam))
Lay_NoPermissionExit ();
/***** Show question and button to remove question *****/
Ale_ShowAlertAndButton (ActRemExaSet,NULL,NULL,
ExaSet_PutParamsOneSet,&Exams,
@ -1771,6 +1804,10 @@ void ExaSet_RemoveSet (void)
/***** Get and check parameters *****/
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
/***** Check if exam is editable *****/
if (!Exa_CheckIfEditable (&Exam))
Lay_NoPermissionExit ();
/***** Remove the set from all the tables *****/
/* 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 *****/
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
/***** Check if exam is editable *****/
if (!Exa_CheckIfEditable (&Exam))
Lay_NoPermissionExit ();
/***** Get set index *****/
SetIndBottom = ExaSet_GetSetIndFromSetCod (Exam.ExaCod,Set.SetCod);
@ -1869,6 +1910,10 @@ void ExaSet_MoveDownSet (void)
/***** Get and check parameters *****/
ExaSet_GetAndCheckParameters (&Exams,&Exam,&Set);
/***** Check if exam is editable *****/
if (!Exa_CheckIfEditable (&Exam))
Lay_NoPermissionExit ();
/***** Get set index *****/
SetIndTop = ExaSet_GetSetIndFromSetCod (Exam.ExaCod,Set.SetCod);