mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-14 12:44:09 +02:00
Version 22.102.3: Apr 21, 2023 Changes in exams.
This commit is contained in:
parent
9354070348
commit
2c04f87d61
|
@ -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.
|
||||
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.102.2 (2023-04-21)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.102.3 (2023-04-21)"
|
||||
#define CSS_FILE "swad22.95.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 22.102.3: Apr 21, 2023 Changes in exams. (337538 lines)
|
||||
Version 22.102.2: Apr 21, 2023 Changes in games. (337454 lines)
|
||||
Version 22.102.1: Apr 21, 2023 Changes in rubrics. (337378 lines)
|
||||
Version 22.102: Apr 21, 2023 Rubrics in project. Not finished. (337360 lines)
|
||||
|
|
109
swad_exam.c
109
swad_exam.c
|
@ -117,7 +117,8 @@ static void Exa_PutParsToCreateNewExam (void *Exams);
|
|||
|
||||
static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam);
|
||||
|
||||
static void Exa_PutIconsOneExam (void *Exams);
|
||||
static void Exa_PutIconsViewingOneExam (void *Exams);
|
||||
static void Exa_PutIconsEditingOneExam (void *Exams);
|
||||
static void Exa_WriteAuthor (struct Exa_Exam *Exam);
|
||||
|
||||
static void Exa_PutParExamOrder (Exa_Order_t SelectedOrder);
|
||||
|
@ -427,7 +428,7 @@ void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
|||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,Exams->Exam.Title[0] ? Exams->Exam.Title :
|
||||
Txt_Exam,
|
||||
Exa_PutIconsOneExam,Exams,
|
||||
Exa_PutIconsViewingOneExam,Exams,
|
||||
Hlp_ASSESSMENT_Exams,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Show exam *****/
|
||||
|
@ -604,10 +605,10 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************ Put icon to show results of sessions in an exam ****************/
|
||||
/***************** Put icons when viewing/editing an exam ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Exa_PutIconsOneExam (void *Exams)
|
||||
static void Exa_PutIconsViewingOneExam (void *Exams)
|
||||
{
|
||||
char *Anchor;
|
||||
|
||||
|
@ -624,6 +625,14 @@ static void Exa_PutIconsOneExam (void *Exams)
|
|||
}
|
||||
}
|
||||
|
||||
static void Exa_PutIconsEditingOneExam (void *Exams)
|
||||
{
|
||||
if (Exams)
|
||||
/***** Icon to view exam *****/
|
||||
Ico_PutContextualIconToView (ActSeeOneExa,NULL,
|
||||
Exa_PutPars,Exams);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*********************** Write the author of an exam ************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -1248,26 +1257,36 @@ void Exa_ReqCreatOrEditExam (void)
|
|||
|
||||
void Exa_PutFormsOneExam (struct Exa_Exams *Exams,
|
||||
struct ExaSet_Set *Set,
|
||||
bool ItsANewExam)
|
||||
Exa_ExistingNewExam_t ExistingNewExam)
|
||||
{
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||
|
||||
/***** Initialize text / get text from database *****/
|
||||
if (ItsANewExam)
|
||||
Txt[0] = '\0';
|
||||
else
|
||||
switch (ExistingNewExam)
|
||||
{
|
||||
case Exa_EXISTING_EXAM:
|
||||
Exa_DB_GetExamTxt (Exams->Exam.ExaCod,Txt);
|
||||
break;
|
||||
case Exa_NEW_EXAM:
|
||||
Txt[0] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
/***** Put form to create/edit an exam *****/
|
||||
Exa_PutFormEditionExam (Exams,Txt,ItsANewExam);
|
||||
Exa_PutFormEditionExam (Exams,Txt,ExistingNewExam);
|
||||
|
||||
/***** Show other lists *****/
|
||||
if (ItsANewExam)
|
||||
/* Show exams again */
|
||||
Exa_ListAllExams (Exams);
|
||||
else
|
||||
switch (ExistingNewExam)
|
||||
{
|
||||
case Exa_EXISTING_EXAM:
|
||||
/* Show list of sets */
|
||||
ExaSet_ListExamSets (Exams,Set);
|
||||
break;
|
||||
case Exa_NEW_EXAM:
|
||||
/* Show exams again */
|
||||
Exa_ListAllExams (Exams);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -1276,28 +1295,56 @@ void Exa_PutFormsOneExam (struct Exa_Exams *Exams,
|
|||
|
||||
void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
||||
bool ItsANewExam)
|
||||
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_Maximum_grade;
|
||||
extern const char *Txt_Result_visibility;
|
||||
extern const char *Txt_Description;
|
||||
extern const char *Txt_Create_exam;
|
||||
extern const char *Txt_Save_changes;
|
||||
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[] =
|
||||
{
|
||||
[Exa_EXISTING_EXAM] = ActChgExa,
|
||||
[Exa_NEW_EXAM ] = ActNewExa,
|
||||
};
|
||||
static Btn_Button_t Button[] =
|
||||
{
|
||||
[Exa_EXISTING_EXAM] = Btn_CONFIRM_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[] =
|
||||
{
|
||||
[Exa_EXISTING_EXAM] = Txt_Save_changes,
|
||||
[Exa_NEW_EXAM ] = Txt_Create_exam,
|
||||
};
|
||||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (ItsANewExam ? ActNewExa :
|
||||
ActChgExa);
|
||||
Exa_PutPars (Exams);
|
||||
|
||||
/***** Begin box and table *****/
|
||||
Box_BoxTableBegin (NULL,
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,
|
||||
Exams->Exam.Title[0] ? Exams->Exam.Title :
|
||||
Txt_Exam,
|
||||
NULL,NULL,
|
||||
Hlp_ASSESSMENT_Exams_edit_exam,Box_NOT_CLOSABLE,2);
|
||||
FunctionToDrawContextualIcons[ExistingNewExam],Exams,
|
||||
HelpLink[ExistingNewExam],Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Begin form *****/
|
||||
Frm_BeginForm (NextAction[ExistingNewExam]);
|
||||
Exa_PutPars (Exams);
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_BeginWidePadding (2);
|
||||
|
||||
/***** Exam title *****/
|
||||
HTM_TR_Begin (NULL);
|
||||
|
@ -1362,14 +1409,18 @@ void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
|||
|
||||
HTM_TR_End ();
|
||||
|
||||
/***** End table, send button and end box *****/
|
||||
if (ItsANewExam)
|
||||
Box_BoxTableWithButtonEnd (Btn_CREATE_BUTTON,Txt_Create_exam);
|
||||
else
|
||||
Box_BoxTableWithButtonEnd (Btn_CONFIRM_BUTTON,Txt_Save_changes);
|
||||
/***** End table ****/
|
||||
HTM_TABLE_End ();
|
||||
|
||||
/***** Send button *****/
|
||||
Btn_PutButton (Button[ExistingNewExam],
|
||||
TxtButton[ExistingNewExam]);
|
||||
|
||||
/***** End form *****/
|
||||
Frm_EndForm ();
|
||||
|
||||
/***** End box ****/
|
||||
Box_BoxEnd ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -70,10 +70,10 @@ void Exa_UnhideExam (void);
|
|||
void Exa_ReqCreatOrEditExam (void);
|
||||
void Exa_PutFormsOneExam (struct Exa_Exams *Exams,
|
||||
struct ExaSet_Set *Set,
|
||||
bool ItsANewExam);
|
||||
Exa_ExistingNewExam_t ExistingNewExam);
|
||||
void Exa_PutFormEditionExam (struct Exa_Exams *Exams,
|
||||
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
||||
bool ItsANewExam);
|
||||
Exa_ExistingNewExam_t ExistingNewExam);
|
||||
|
||||
void Exa_ReceiveFormExam (void);
|
||||
|
||||
|
|
|
@ -470,8 +470,7 @@ void ExaSet_ReqCreatOrEditSet (void)
|
|||
}
|
||||
|
||||
/***** Put form to edit the exam created or updated *****/
|
||||
Exa_PutFormEditionExam (&Exams,Txt,
|
||||
false); // No new exam
|
||||
Exa_PutFormEditionExam (&Exams,Txt,Exa_EXISTING_EXAM);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -62,6 +62,12 @@ typedef enum
|
|||
Exa_CHECK_EXA_COD,
|
||||
} Exa_CheckExaCod_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Exa_EXISTING_EXAM,
|
||||
Exa_NEW_EXAM,
|
||||
} Exa_ExistingNewExam_t;
|
||||
|
||||
struct Exa_ExamSelected
|
||||
{
|
||||
long ExaCod; // Exam code
|
||||
|
|
|
@ -686,7 +686,7 @@ static void Gam_PutIconsEditingOneGame (void *Games)
|
|||
{
|
||||
if (Games)
|
||||
/***** Icon to view game *****/
|
||||
Ico_PutContextualIconToView (ActSeeOneGam,NULL,
|
||||
Ico_PutContextualIconToView (ActLstOneGam,NULL,
|
||||
Gam_PutPars,Games);
|
||||
}
|
||||
|
||||
|
@ -1301,6 +1301,11 @@ static void Gam_PutFormsEditionGame (struct Gam_Games *Games,
|
|||
extern const char *Txt_Description;
|
||||
extern const char *Txt_Save_changes;
|
||||
extern const char *Txt_Create_game;
|
||||
static void (*FunctionToDrawContextualIcons[]) (void *Args) =
|
||||
{
|
||||
[Gam_EXISTING_GAME] = Gam_PutIconsEditingOneGame,
|
||||
[Gam_NEW_GAME ] = NULL,
|
||||
};
|
||||
static Act_Action_t NextAction[] =
|
||||
{
|
||||
[Gam_EXISTING_GAME] = ActChgGam,
|
||||
|
@ -1326,7 +1331,7 @@ static void Gam_PutFormsEditionGame (struct Gam_Games *Games,
|
|||
Box_BoxBegin (NULL,
|
||||
Games->Game.Title[0] ? Games->Game.Title :
|
||||
Txt_Game,
|
||||
Gam_PutIconsEditingOneGame,Games,
|
||||
FunctionToDrawContextualIcons[ExistingNewGame],Games,
|
||||
HelpLink[ExistingNewGame],Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Begin form *****/
|
||||
|
|
|
@ -1771,6 +1771,29 @@ const char *Hlp_ASSESSMENT_Exams_edit_exam =
|
|||
"ASSESSMENT.Exams.en#edit-exam";
|
||||
#endif
|
||||
|
||||
const char *Hlp_ASSESSMENT_Exams_new_exam =
|
||||
#if L==1
|
||||
"ASSESSMENT.Exams.es#nuevo-examen";
|
||||
#elif L==2
|
||||
"ASSESSMENT.Exams.en#new-exam";
|
||||
#elif L==3
|
||||
"ASSESSMENT.Exams.en#new-exam";
|
||||
#elif L==4
|
||||
"ASSESSMENT.Exams.es#nuevo-examen";
|
||||
#elif L==5
|
||||
"ASSESSMENT.Exams.en#new-exam";
|
||||
#elif L==6
|
||||
"ASSESSMENT.Exams.es#nuevo-examen";
|
||||
#elif L==7
|
||||
"ASSESSMENT.Exams.en#new-exam";
|
||||
#elif L==8
|
||||
"ASSESSMENT.Exams.en#new-exam";
|
||||
#elif L==9
|
||||
"ASSESSMENT.Exams.en#new-exam";
|
||||
#elif L==10 // tr
|
||||
"ASSESSMENT.Exams.en#new-exam";
|
||||
#endif
|
||||
|
||||
const char *Hlp_ASSESSMENT_Exams_question_sets =
|
||||
#if L==1
|
||||
"ASSESSMENT.Exams.es#conjunto-de-preguntas";
|
||||
|
|
|
@ -802,6 +802,11 @@ void Rub_PutFormEditionRubric (struct Rub_Rubrics *Rubrics,
|
|||
extern const char *Txt_Description;
|
||||
extern const char *Txt_Create_rubric;
|
||||
extern const char *Txt_Save_changes;
|
||||
static void (*FunctionToDrawContextualIcons[]) (void *Args) =
|
||||
{
|
||||
[Rub_EXISTING_RUBRIC] = Rub_PutIconsEditingOneRubric,
|
||||
[Rub_NEW_RUBRIC ] = NULL,
|
||||
};
|
||||
static Act_Action_t NextAction[] =
|
||||
{
|
||||
[Rub_EXISTING_RUBRIC] = ActChgRub,
|
||||
|
@ -827,7 +832,7 @@ void Rub_PutFormEditionRubric (struct Rub_Rubrics *Rubrics,
|
|||
Box_BoxBegin (NULL,
|
||||
Rubrics->Rubric.Title[0] ? Rubrics->Rubric.Title :
|
||||
Txt_Rubric,
|
||||
Rub_PutIconsEditingOneRubric,Rubrics,
|
||||
FunctionToDrawContextualIcons[ExistingNewRubric],Rubrics,
|
||||
HelpLink[ExistingNewRubric],Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Begin form *****/
|
||||
|
|
Loading…
Reference in New Issue
Block a user