mirror of https://github.com/acanas/swad-core.git
Version 22.107.3: May 06, 2023 Changes in edition of exam.
This commit is contained in:
parent
9962b9b2f0
commit
3ee4a1b136
|
@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr
|
||||||
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
|
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 22.107.2 (2023-05-05)"
|
#define Log_PLATFORM_VERSION "SWAD 22.107.3 (2023-05-06)"
|
||||||
#define CSS_FILE "swad22.107.css"
|
#define CSS_FILE "swad22.107.css"
|
||||||
#define JS_FILE "swad22.49.js"
|
#define JS_FILE "swad22.49.js"
|
||||||
/*
|
/*
|
||||||
|
Version 22.107.3: May 06, 2023 Changes in edition of exam. (338045 lines)
|
||||||
Version 22.107.2: May 05, 2023 Removed unused action in exam sets. (338044 lines)
|
Version 22.107.2: May 05, 2023 Removed unused action in exam sets. (338044 lines)
|
||||||
Version 22.107.1: May 05, 2023 Changes in list of users to follow. (338105 lines)
|
Version 22.107.1: May 05, 2023 Changes in list of users to follow. (338105 lines)
|
||||||
Version 22.107: May 05, 2023 Changes in layout institutional links and connected users. (338108 lines)
|
Version 22.107: May 05, 2023 Changes in layout institutional links and connected users. (338108 lines)
|
||||||
|
|
183
swad_exam.c
183
swad_exam.c
|
@ -138,6 +138,9 @@ static void Exa_RemoveAllMedFilesFromAnsOfAllQstsFromCrs (long CrsCod);
|
||||||
|
|
||||||
static void Exa_HideUnhideExam (bool Hide);
|
static void Exa_HideUnhideExam (bool Hide);
|
||||||
|
|
||||||
|
static void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
||||||
|
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
||||||
|
Exa_ExistingNewExam_t ExistingNewExam);
|
||||||
static void Exa_ReceiveExamFieldsFromForm (struct Exa_Exam *Exam,
|
static void Exa_ReceiveExamFieldsFromForm (struct Exa_Exam *Exam,
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1]);
|
char Txt[Cns_MAX_BYTES_TEXT + 1]);
|
||||||
static bool Exa_CheckExamFieldsReceivedFromForm (const struct Exa_Exam *Exam);
|
static bool Exa_CheckExamFieldsReceivedFromForm (const struct Exa_Exam *Exam);
|
||||||
|
@ -1259,6 +1262,19 @@ void Exa_PutFormsOneExam (struct Exa_Exams *Exams,
|
||||||
struct ExaSet_Set *Set,
|
struct ExaSet_Set *Set,
|
||||||
Exa_ExistingNewExam_t ExistingNewExam)
|
Exa_ExistingNewExam_t ExistingNewExam)
|
||||||
{
|
{
|
||||||
|
extern const char *Hlp_ASSESSMENT_Exams_edit_exam;
|
||||||
|
extern const char *Hlp_ASSESSMENT_Exams_new_exam;
|
||||||
|
extern const char *Txt_Exam;
|
||||||
|
static void (*FunctionToDrawContextualIcons[]) (void *Args) =
|
||||||
|
{
|
||||||
|
[Exa_EXISTING_EXAM] = Exa_PutIconsEditingOneExam,
|
||||||
|
[Exa_NEW_EXAM ] = NULL,
|
||||||
|
};
|
||||||
|
static const char **HelpLink[] =
|
||||||
|
{
|
||||||
|
[Exa_EXISTING_EXAM] = &Hlp_ASSESSMENT_Exams_edit_exam,
|
||||||
|
[Exa_NEW_EXAM ] = &Hlp_ASSESSMENT_Exams_new_exam,
|
||||||
|
};
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||||
|
|
||||||
/***** Initialize text / get text from database *****/
|
/***** Initialize text / get text from database *****/
|
||||||
|
@ -1272,45 +1288,47 @@ void Exa_PutFormsOneExam (struct Exa_Exams *Exams,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Put form to create/edit an exam *****/
|
/***** Begin box *****/
|
||||||
Exa_PutFormEditionExam (Exams,Txt,ExistingNewExam);
|
Box_BoxBegin (NULL,
|
||||||
|
Exams->Exam.Title[0] ? Exams->Exam.Title :
|
||||||
|
Txt_Exam,
|
||||||
|
FunctionToDrawContextualIcons[ExistingNewExam],Exams,
|
||||||
|
*HelpLink[ExistingNewExam],Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Show other lists *****/
|
/***** Put form to create/edit an exam *****/
|
||||||
switch (ExistingNewExam)
|
Exa_PutFormEditionExam (Exams,Txt,ExistingNewExam);
|
||||||
{
|
|
||||||
case Exa_EXISTING_EXAM:
|
/***** Show other lists *****/
|
||||||
/* Show list of sets */
|
switch (ExistingNewExam)
|
||||||
ExaSet_ListExamSets (Exams,Set);
|
{
|
||||||
break;
|
case Exa_EXISTING_EXAM:
|
||||||
case Exa_NEW_EXAM:
|
/* Show list of sets */
|
||||||
/* Show exams again */
|
ExaSet_ListExamSets (Exams,Set);
|
||||||
Exa_ListAllExams (Exams);
|
break;
|
||||||
break;
|
case Exa_NEW_EXAM:
|
||||||
}
|
/* Show exams again */
|
||||||
|
Exa_ListAllExams (Exams);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** End box ****/
|
||||||
|
Box_BoxEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************* Put a form to create/edit an exam **********************/
|
/********************* Put a form to create/edit an exam **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
static void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
||||||
Exa_ExistingNewExam_t ExistingNewExam)
|
Exa_ExistingNewExam_t ExistingNewExam)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Exams_edit_exam;
|
|
||||||
extern const char *Hlp_ASSESSMENT_Exams_new_exam;
|
|
||||||
extern const char *Txt_Exam;
|
|
||||||
extern const char *Txt_Title;
|
extern const char *Txt_Title;
|
||||||
extern const char *Txt_Maximum_grade;
|
extern const char *Txt_Maximum_grade;
|
||||||
extern const char *Txt_Result_visibility;
|
extern const char *Txt_Result_visibility;
|
||||||
extern const char *Txt_Description;
|
extern const char *Txt_Description;
|
||||||
extern const char *Txt_Save_changes;
|
extern const char *Txt_Save_changes;
|
||||||
extern const char *Txt_Create_exam;
|
extern const char *Txt_Create_exam;
|
||||||
static void (*FunctionToDrawContextualIcons[]) (void *Args) =
|
|
||||||
{
|
|
||||||
[Exa_EXISTING_EXAM] = Exa_PutIconsEditingOneExam,
|
|
||||||
[Exa_NEW_EXAM ] = NULL,
|
|
||||||
};
|
|
||||||
static Act_Action_t NextAction[] =
|
static Act_Action_t NextAction[] =
|
||||||
{
|
{
|
||||||
[Exa_EXISTING_EXAM] = ActChgExa,
|
[Exa_EXISTING_EXAM] = ActChgExa,
|
||||||
|
@ -1321,80 +1339,68 @@ void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
||||||
[Exa_EXISTING_EXAM] = Btn_CONFIRM_BUTTON,
|
[Exa_EXISTING_EXAM] = Btn_CONFIRM_BUTTON,
|
||||||
[Exa_NEW_EXAM ] = Btn_CREATE_BUTTON,
|
[Exa_NEW_EXAM ] = Btn_CREATE_BUTTON,
|
||||||
};
|
};
|
||||||
const char *HelpLink[] =
|
|
||||||
{
|
|
||||||
[Exa_EXISTING_EXAM] = Hlp_ASSESSMENT_Exams_edit_exam,
|
|
||||||
[Exa_NEW_EXAM ] = Hlp_ASSESSMENT_Exams_new_exam,
|
|
||||||
};
|
|
||||||
const char *TxtButton[] =
|
const char *TxtButton[] =
|
||||||
{
|
{
|
||||||
[Exa_EXISTING_EXAM] = Txt_Save_changes,
|
[Exa_EXISTING_EXAM] = Txt_Save_changes,
|
||||||
[Exa_NEW_EXAM ] = Txt_Create_exam,
|
[Exa_NEW_EXAM ] = Txt_Create_exam,
|
||||||
};
|
};
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin form *****/
|
||||||
Box_BoxBegin (NULL,
|
Frm_BeginForm (NextAction[ExistingNewExam]);
|
||||||
Exams->Exam.Title[0] ? Exams->Exam.Title :
|
Exa_PutPars (Exams);
|
||||||
Txt_Exam,
|
|
||||||
FunctionToDrawContextualIcons[ExistingNewExam],Exams,
|
|
||||||
HelpLink[ExistingNewExam],Box_NOT_CLOSABLE);
|
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin table *****/
|
||||||
Frm_BeginForm (NextAction[ExistingNewExam]);
|
HTM_TABLE_BeginWidePadding (2);
|
||||||
Exa_PutPars (Exams);
|
|
||||||
|
|
||||||
/***** Begin table *****/
|
/***** Exam title *****/
|
||||||
HTM_TABLE_BeginWidePadding (2);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/***** Exam title *****/
|
/* Label */
|
||||||
HTM_TR_Begin (NULL);
|
Frm_LabelColumn ("RT","Title",Txt_Title);
|
||||||
|
|
||||||
/* Label */
|
/* Data */
|
||||||
Frm_LabelColumn ("RT","Title",Txt_Title);
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
|
HTM_INPUT_TEXT ("Title",Exa_MAX_CHARS_TITLE,Exams->Exam.Title,
|
||||||
|
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||||
|
"id=\"Title\""
|
||||||
|
" class=\"TITLE_DESCRIPTION_WIDTH INPUT_%s\""
|
||||||
|
" required=\"required\"",
|
||||||
|
The_GetSuffix ());
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
/* Data */
|
HTM_TR_End ();
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
|
||||||
HTM_INPUT_TEXT ("Title",Exa_MAX_CHARS_TITLE,Exams->Exam.Title,
|
|
||||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
|
||||||
"id=\"Title\""
|
|
||||||
" class=\"TITLE_DESCRIPTION_WIDTH INPUT_%s\""
|
|
||||||
" required=\"required\"",
|
|
||||||
The_GetSuffix ());
|
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
HTM_TR_End ();
|
/***** Maximum grade *****/
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/***** Maximum grade *****/
|
HTM_TD_Begin ("class=\"RM FORM_IN_%s\"",The_GetSuffix ());
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TxtColon (Txt_Maximum_grade);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"RM FORM_IN_%s\"",The_GetSuffix ());
|
HTM_TD_Begin ("class=\"LM\"");
|
||||||
HTM_TxtColon (Txt_Maximum_grade);
|
HTM_INPUT_FLOAT ("MaxGrade",0.0,DBL_MAX,0.01,Exams->Exam.MaxGrade,
|
||||||
HTM_TD_End ();
|
HTM_DONT_SUBMIT_ON_CHANGE,false,
|
||||||
|
" class=\"INPUT_%s\" required=\"required\"",
|
||||||
|
The_GetSuffix ());
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LM\"");
|
HTM_TR_End ();
|
||||||
HTM_INPUT_FLOAT ("MaxGrade",0.0,DBL_MAX,0.01,Exams->Exam.MaxGrade,
|
|
||||||
HTM_DONT_SUBMIT_ON_CHANGE,false,
|
|
||||||
" class=\"INPUT_%s\" required=\"required\"",
|
|
||||||
The_GetSuffix ());
|
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
HTM_TR_End ();
|
/***** Visibility of results *****/
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/***** Visibility of results *****/
|
HTM_TD_Begin ("class=\"RT FORM_IN_%s\"",The_GetSuffix ());
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TxtColon (Txt_Result_visibility);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"RT FORM_IN_%s\"",The_GetSuffix ());
|
HTM_TD_Begin ("class=\"LB\"");
|
||||||
HTM_TxtColon (Txt_Result_visibility);
|
TstVis_PutVisibilityCheckboxes (Exams->Exam.Visibility);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LB\"");
|
HTM_TR_End ();
|
||||||
TstVis_PutVisibilityCheckboxes (Exams->Exam.Visibility);
|
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
HTM_TR_End ();
|
/***** Exam text *****/
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
/***** Exam text *****/
|
|
||||||
HTM_TR_Begin (NULL);
|
|
||||||
|
|
||||||
/* Label */
|
/* Label */
|
||||||
Frm_LabelColumn ("RT","Txt",Txt_Description);
|
Frm_LabelColumn ("RT","Txt",Txt_Description);
|
||||||
|
@ -1408,20 +1414,17 @@ void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
||||||
HTM_TEXTAREA_End ();
|
HTM_TEXTAREA_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** End table ****/
|
/***** End table ****/
|
||||||
HTM_TABLE_End ();
|
HTM_TABLE_End ();
|
||||||
|
|
||||||
/***** Send button *****/
|
/***** Send button *****/
|
||||||
Btn_PutButton (Button[ExistingNewExam],
|
Btn_PutButton (Button[ExistingNewExam],
|
||||||
TxtButton[ExistingNewExam]);
|
TxtButton[ExistingNewExam]);
|
||||||
|
|
||||||
/***** End form *****/
|
/***** End form *****/
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
/***** End box ****/
|
|
||||||
Box_BoxEnd ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -71,9 +71,6 @@ void Exa_ReqCreatOrEditExam (void);
|
||||||
void Exa_PutFormsOneExam (struct Exa_Exams *Exams,
|
void Exa_PutFormsOneExam (struct Exa_Exams *Exams,
|
||||||
struct ExaSet_Set *Set,
|
struct ExaSet_Set *Set,
|
||||||
Exa_ExistingNewExam_t ExistingNewExam);
|
Exa_ExistingNewExam_t ExistingNewExam);
|
||||||
void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
|
||||||
Exa_ExistingNewExam_t ExistingNewExam);
|
|
||||||
|
|
||||||
void Exa_ReceiveFormExam (void);
|
void Exa_ReceiveFormExam (void);
|
||||||
|
|
||||||
|
|
|
@ -508,19 +508,19 @@ void ExaSet_ListExamSets (struct Exa_Exams *Exams,
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
Hlp_ASSESSMENT_Exams_question_sets,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Exams_question_sets,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Show table with sets *****/
|
/***** Show table with sets *****/
|
||||||
if (NumSets)
|
if (NumSets)
|
||||||
ExaSet_ListOneOrMoreSetsForEdition (Exams,
|
ExaSet_ListOneOrMoreSetsForEdition (Exams,
|
||||||
MaxSetInd,
|
MaxSetInd,
|
||||||
NumSets,mysql_res,
|
NumSets,mysql_res,
|
||||||
ICanEditSets);
|
ICanEditSets);
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
/***** Put forms to create/edit a set *****/
|
/***** Put forms to create/edit a set *****/
|
||||||
if (ICanEditSets)
|
if (ICanEditSets)
|
||||||
ExaSet_PutFormNewSet (Exams,Set,MaxSetInd);
|
ExaSet_PutFormNewSet (Exams,Set,MaxSetInd);
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
|
|
@ -1796,25 +1796,25 @@ const char *Hlp_ASSESSMENT_Exams_new_exam =
|
||||||
|
|
||||||
const char *Hlp_ASSESSMENT_Exams_question_sets =
|
const char *Hlp_ASSESSMENT_Exams_question_sets =
|
||||||
#if L==1
|
#if L==1
|
||||||
"ASSESSMENT.Exams.es#conjunto-de-preguntas";
|
"ASSESSMENT.Exams.es#conjuntos-de-preguntas";
|
||||||
#elif L==2
|
#elif L==2
|
||||||
"ASSESSMENT.Exams.en#question-set";
|
"ASSESSMENT.Exams.en#question-sets";
|
||||||
#elif L==3
|
#elif L==3
|
||||||
"ASSESSMENT.Exams.en#question-set";
|
"ASSESSMENT.Exams.en#question-sets";
|
||||||
#elif L==4
|
#elif L==4
|
||||||
"ASSESSMENT.Exams.es#conjunto-de-preguntas";
|
"ASSESSMENT.Exams.es#conjuntos-de-preguntas";
|
||||||
#elif L==5
|
#elif L==5
|
||||||
"ASSESSMENT.Exams.en#question-set";
|
"ASSESSMENT.Exams.en#question-sets";
|
||||||
#elif L==6
|
#elif L==6
|
||||||
"ASSESSMENT.Exams.es#conjunto-de-preguntas";
|
"ASSESSMENT.Exams.es#conjuntos-de-preguntas";
|
||||||
#elif L==7
|
#elif L==7
|
||||||
"ASSESSMENT.Exams.en#question-set";
|
"ASSESSMENT.Exams.en#question-sets";
|
||||||
#elif L==8
|
#elif L==8
|
||||||
"ASSESSMENT.Exams.en#question-set";
|
"ASSESSMENT.Exams.en#question-sets";
|
||||||
#elif L==9
|
#elif L==9
|
||||||
"ASSESSMENT.Exams.en#question-set";
|
"ASSESSMENT.Exams.en#question-sets";
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"ASSESSMENT.Exams.en#question-set";
|
"ASSESSMENT.Exams.en#question-sets";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *Hlp_ASSESSMENT_Exams_sessions =
|
const char *Hlp_ASSESSMENT_Exams_sessions =
|
||||||
|
|
Loading…
Reference in New Issue