mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-13 04:04:35 +02:00
Version 22.98: Apr 17, 2023 Code refactoring in rubrics.
This commit is contained in:
parent
d6cce8b198
commit
643876456b
|
@ -1563,14 +1563,14 @@ void Agd_ReceiveFormEvent (void)
|
||||||
if (!AgdEvent.Location[0]) // If there is no event
|
if (!AgdEvent.Location[0]) // If there is no event
|
||||||
{
|
{
|
||||||
NewEventIsCorrect = false;
|
NewEventIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Check if event is correct *****/
|
/***** Check if event is correct *****/
|
||||||
if (!AgdEvent.Event[0]) // If there is no event
|
if (!AgdEvent.Event[0]) // If there is no event
|
||||||
{
|
{
|
||||||
NewEventIsCorrect = false;
|
NewEventIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Create a new event or update an existing one *****/
|
/***** Create a new event or update an existing one *****/
|
||||||
|
|
40
swad_alert.c
40
swad_alert.c
|
@ -476,15 +476,14 @@ void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const c
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/** Create alert when user not found or no permission to perform an action ***/
|
/**************** Create alert when a form field is empty ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ale_CreateAlertUserNotFoundOrYouDoNotHavePermission (void)
|
void Ale_ShowAlertYouCanNotLeaveFieldEmpty (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
extern const char *Txt_You_can_not_leave_the_field_empty;
|
||||||
|
|
||||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_field_empty);
|
||||||
Txt_User_not_found_or_you_do_not_have_permission_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -498,6 +497,18 @@ void Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission (void)
|
||||||
Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
Ale_ShowAlert (Ale_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/** Create alert when user not found or no permission to perform an action ***/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Ale_CreateAlertUserNotFoundOrYouDoNotHavePermission (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||||
|
|
||||||
|
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||||
|
Txt_User_not_found_or_you_do_not_have_permission_);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************** Create alert when a form field is empty ********************/
|
/**************** Create alert when a form field is empty ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -509,22 +520,11 @@ void Ale_CreateAlertYouCanNotLeaveFieldEmpty (void)
|
||||||
Ale_CreateAlert (Ale_WARNING,NULL,Txt_You_can_not_leave_the_field_empty);
|
Ale_CreateAlert (Ale_WARNING,NULL,Txt_You_can_not_leave_the_field_empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/**************** Create alert when a form field is empty ********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void Ale_ShowAlertYouCanNotLeaveFieldEmpty (void)
|
|
||||||
{
|
|
||||||
extern const char *Txt_You_can_not_leave_the_field_empty;
|
|
||||||
|
|
||||||
Ale_ShowAlert (Ale_WARNING,Txt_You_can_not_leave_the_field_empty);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************* Create alert when title is empty **********************/
|
/********************* Create alert when title is empty **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ale_ShowAlertYouMustSpecifyTheTitle (void)
|
void Ale_CreateAlertYouMustSpecifyTheTitle (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_You_must_specify_the_title;
|
extern const char *Txt_You_must_specify_the_title;
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ void Ale_ShowAlertYouMustSpecifyTheTitle (void)
|
||||||
/****************** Create alert when web address is empty *******************/
|
/****************** Create alert when web address is empty *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ale_ShowAlertYouMustSpecifyTheWebAddress (void)
|
void Ale_CreateAlertYouMustSpecifyTheWebAddress (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_You_must_specify_the_web_address;
|
extern const char *Txt_You_must_specify_the_web_address;
|
||||||
|
|
||||||
|
@ -548,7 +548,7 @@ void Ale_ShowAlertYouMustSpecifyTheWebAddress (void)
|
||||||
/************ Create alert when short name or full name are empty ************/
|
/************ Create alert when short name or full name are empty ************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ale_ShowAlertYouMustSpecifyTheName (void)
|
void Ale_CreateAlertYouMustSpecifyTheName (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_You_must_specify_the_name;
|
extern const char *Txt_You_must_specify_the_name;
|
||||||
|
|
||||||
|
@ -560,7 +560,7 @@ void Ale_ShowAlertYouMustSpecifyTheName (void)
|
||||||
/************ Create alert when short name or full name are empty ************/
|
/************ Create alert when short name or full name are empty ************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName (void)
|
void Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_You_must_specify_the_short_name_and_the_full_name;
|
extern const char *Txt_You_must_specify_the_short_name_and_the_full_name;
|
||||||
|
|
||||||
|
|
14
swad_alert.h
14
swad_alert.h
|
@ -82,13 +82,13 @@ void Ale_ShowAlertAndButton2 (Act_Action_t NextAction,const char *Anchor,const c
|
||||||
void (*FuncPars) (void *Args),void *Args,
|
void (*FuncPars) (void *Args),void *Args,
|
||||||
Btn_Button_t Button,const char *TxtButton);
|
Btn_Button_t Button,const char *TxtButton);
|
||||||
|
|
||||||
void Ale_CreateAlertUserNotFoundOrYouDoNotHavePermission (void);
|
|
||||||
void Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission (void);
|
|
||||||
void Ale_CreateAlertYouCanNotLeaveFieldEmpty (void);
|
|
||||||
void Ale_ShowAlertYouCanNotLeaveFieldEmpty (void);
|
void Ale_ShowAlertYouCanNotLeaveFieldEmpty (void);
|
||||||
void Ale_ShowAlertYouMustSpecifyTheTitle (void);
|
void Ale_ShowAlertUserNotFoundOrYouDoNotHavePermission (void);
|
||||||
void Ale_ShowAlertYouMustSpecifyTheWebAddress (void);
|
void Ale_CreateAlertUserNotFoundOrYouDoNotHavePermission (void);
|
||||||
void Ale_ShowAlertYouMustSpecifyTheName (void);
|
void Ale_CreateAlertYouCanNotLeaveFieldEmpty (void);
|
||||||
void Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName (void);
|
void Ale_CreateAlertYouMustSpecifyTheTitle (void);
|
||||||
|
void Ale_CreateAlertYouMustSpecifyTheWebAddress (void);
|
||||||
|
void Ale_CreateAlertYouMustSpecifyTheName (void);
|
||||||
|
void Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1483,7 +1483,7 @@ void Asg_ReceiveFormAssignment (void)
|
||||||
else // If there is not an assignment title
|
else // If there is not an assignment title
|
||||||
{
|
{
|
||||||
NewAssignmentIsCorrect = false;
|
NewAssignmentIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Create a new assignment or update an existing one *****/
|
/***** Create a new assignment or update an existing one *****/
|
||||||
|
|
|
@ -1237,7 +1237,7 @@ void Att_ReceiveFormEvent (void)
|
||||||
else // If there is not an attendance event title
|
else // If there is not an attendance event title
|
||||||
{
|
{
|
||||||
ReceivedAttEventIsCorrect = false;
|
ReceivedAttEventIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Create a new attendance event or update an existing one *****/
|
/***** Create a new attendance event or update an existing one *****/
|
||||||
|
|
|
@ -945,7 +945,7 @@ void Ban_ReceiveFormNewBanner (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a banner name
|
else // If there is not a banner name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -817,7 +817,7 @@ void Bld_ReceiveFormNewBuilding (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a building name
|
else // If there is not a building name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -1560,10 +1560,10 @@ static void Ctr_ReceiveFormRequestOrCreateCtr (Hie_Status_t Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a web
|
else // If there is not a web
|
||||||
Ale_ShowAlertYouMustSpecifyTheWebAddress ();
|
Ale_CreateAlertYouMustSpecifyTheWebAddress ();
|
||||||
}
|
}
|
||||||
else // If there is not a center name
|
else // If there is not a center name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -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.97 (2023-04-14)"
|
#define Log_PLATFORM_VERSION "SWAD 22.98 (2023-04-17)"
|
||||||
#define CSS_FILE "swad22.95.css"
|
#define CSS_FILE "swad22.95.css"
|
||||||
#define JS_FILE "swad22.49.js"
|
#define JS_FILE "swad22.49.js"
|
||||||
/*
|
/*
|
||||||
|
Version 22.98: Apr 17, 2023 Code refactoring in rubrics. (339062 lines)
|
||||||
Version 22.97: Apr 14, 2023 Changes in listing of rubrics. (339029 lines)
|
Version 22.97: Apr 14, 2023 Changes in listing of rubrics. (339029 lines)
|
||||||
Version 22.96.1: Apr 14, 2023 Code refactoring in selectors. (338991 lines)
|
Version 22.96.1: Apr 14, 2023 Code refactoring in selectors. (338991 lines)
|
||||||
Version 22.96: Apr 12, 2023 Changes in configuration of projects.
|
Version 22.96: Apr 12, 2023 Changes in configuration of projects.
|
||||||
|
|
|
@ -1543,7 +1543,7 @@ static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a course name
|
else // If there is not a course name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
else // Year not valid
|
else // Year not valid
|
||||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||||
|
|
|
@ -1121,10 +1121,10 @@ static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a degree logo or web
|
else // If there is not a degree logo or web
|
||||||
Ale_ShowAlertYouMustSpecifyTheWebAddress ();
|
Ale_CreateAlertYouMustSpecifyTheWebAddress ();
|
||||||
}
|
}
|
||||||
else // If there is not a degree name
|
else // If there is not a degree name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -946,10 +946,10 @@ void Dpt_ReceiveFormNewDpt (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a web
|
else // If there is not a web
|
||||||
Ale_ShowAlertYouMustSpecifyTheWebAddress ();
|
Ale_CreateAlertYouMustSpecifyTheWebAddress ();
|
||||||
}
|
}
|
||||||
else // If there is not a department name
|
else // If there is not a department name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -1488,7 +1488,7 @@ static bool Exa_CheckExamFieldsReceivedFromForm (const struct Exa_Exam *Exam)
|
||||||
else // If there is not an exam title
|
else // If there is not an exam title
|
||||||
{
|
{
|
||||||
NewExamIsCorrect = false;
|
NewExamIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewExamIsCorrect;
|
return NewExamIsCorrect;
|
||||||
|
|
|
@ -313,7 +313,7 @@ static bool ExaSet_CheckSetTitleReceivedFromForm (const struct ExaSet_Set *Set,
|
||||||
else // If there is not a set title
|
else // If there is not a set title
|
||||||
{
|
{
|
||||||
NewTitleIsCorrect = false;
|
NewTitleIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewTitleIsCorrect;
|
return NewTitleIsCorrect;
|
||||||
|
|
|
@ -1484,7 +1484,7 @@ static bool Gam_CheckGameFieldsReceivedFromForm (const struct Gam_Game *Game)
|
||||||
else // If there is not a game title
|
else // If there is not a game title
|
||||||
{
|
{
|
||||||
NewGameIsCorrect = false;
|
NewGameIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewGameIsCorrect;
|
return NewGameIsCorrect;
|
||||||
|
|
|
@ -1600,10 +1600,10 @@ static void Ins_ReceiveFormRequestOrCreateIns (Hie_Status_t Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a web
|
else // If there is not a web
|
||||||
Ale_ShowAlertYouMustSpecifyTheWebAddress ();
|
Ale_CreateAlertYouMustSpecifyTheWebAddress ();
|
||||||
}
|
}
|
||||||
else // If there is not a institution name
|
else // If there is not a institution name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -795,7 +795,7 @@ void Lnk_ReceiveFormNewLink (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a link name
|
else // If there is not a link name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -779,7 +779,7 @@ void Mai_ReceiveFormNewMailDomain (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a mail name
|
else // If there is not a mail name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -911,7 +911,8 @@ void Par_GetMainPars (void)
|
||||||
unsigned Par_GetParText (const char *ParName,char *ParValue,size_t MaxBytes)
|
unsigned Par_GetParText (const char *ParName,char *ParValue,size_t MaxBytes)
|
||||||
{
|
{
|
||||||
return Par_GetParAndChangeFormat (ParName,ParValue,MaxBytes,
|
return Par_GetParAndChangeFormat (ParName,ParValue,MaxBytes,
|
||||||
Str_TO_TEXT,true);
|
Str_TO_TEXT,
|
||||||
|
true); // Remove leading and trailing spaces
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -804,7 +804,7 @@ void Plc_ReceiveFormNewPlace (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a place name
|
else // If there is not a place name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -4093,7 +4093,7 @@ void Prj_ReceiveFormProject (void)
|
||||||
if (!Projects.Prj.Title[0]) // If there is not a project title
|
if (!Projects.Prj.Title[0]) // If there is not a project title
|
||||||
{
|
{
|
||||||
NewProjectIsCorrect = false;
|
NewProjectIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Create a new project or update an existing one *****/
|
/***** Create a new project or update an existing one *****/
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include "swad_project_config.h"
|
#include "swad_project_config.h"
|
||||||
#include "swad_project_database.h"
|
#include "swad_project_database.h"
|
||||||
#include "swad_rubric.h"
|
#include "swad_rubric.h"
|
||||||
|
#include "swad_rubric_database.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************************** Private constants ******************************/
|
/**************************** Private constants ******************************/
|
||||||
|
@ -193,7 +194,7 @@ static void PrjCfg_ShowFormRubric (const struct PrjCfg_Config *Config,
|
||||||
extern const char *Txt_PROJECT_RUBRIC[PrjCfg_NUM_RUBRICS];
|
extern const char *Txt_PROJECT_RUBRIC[PrjCfg_NUM_RUBRICS];
|
||||||
extern const char *Txt_no_rubric;
|
extern const char *Txt_no_rubric;
|
||||||
unsigned NumRub;
|
unsigned NumRub;
|
||||||
const struct Rub_Rubric *Rubric;
|
char Title[Rub_MAX_BYTES_TITLE + 1];
|
||||||
long RubCodInConfig = Config->RubCod[WhichRubric];
|
long RubCodInConfig = Config->RubCod[WhichRubric];
|
||||||
|
|
||||||
/***** Row with form for rubric *****/
|
/***** Row with form for rubric *****/
|
||||||
|
@ -222,11 +223,11 @@ static void PrjCfg_ShowFormRubric (const struct PrjCfg_Config *Config,
|
||||||
NumRub < Rubrics->Num;
|
NumRub < Rubrics->Num;
|
||||||
NumRub++)
|
NumRub++)
|
||||||
{
|
{
|
||||||
Rubric = &Rubrics->Lst[NumRub];
|
Rub_DB_GetRubricTitle (Rubrics->Lst[NumRub],Title,Rub_MAX_BYTES_TITLE);
|
||||||
HTM_OPTION (HTM_Type_LONG,&Rubric->RubCod,
|
HTM_OPTION (HTM_Type_LONG,&Rubrics->Lst[NumRub],
|
||||||
Rubric->RubCod == RubCodInConfig, // Selected?
|
Rubrics->Lst[NumRub] == RubCodInConfig, // Selected?
|
||||||
HTM_OPTION_ENABLED,
|
HTM_OPTION_ENABLED,
|
||||||
"%s",Rubric->Title);
|
"%s",Title);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTM_SELECT_End ();
|
HTM_SELECT_End ();
|
||||||
|
|
|
@ -474,7 +474,7 @@ void Rec_ReceiveFormField (void)
|
||||||
Rec_CreateRecordField ();
|
Rec_CreateRecordField ();
|
||||||
}
|
}
|
||||||
else // If there is not name
|
else // If there is not name
|
||||||
Ale_ShowAlertYouMustSpecifyTheName ();
|
Ale_CreateAlertYouMustSpecifyTheName ();
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Rec_ReqEditRecordFields ();
|
Rec_ReqEditRecordFields ();
|
||||||
|
|
|
@ -1403,7 +1403,7 @@ void Roo_ReceiveFormNewRoom (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a room name
|
else // If there is not a room name
|
||||||
Ale_ShowAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
Ale_CreateAlertYouMustSpecifyTheShortNameAndTheFullName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
158
swad_rubric.c
158
swad_rubric.c
|
@ -65,7 +65,7 @@ static void Rub_PutButtonToCreateNewRubric (struct Rub_Rubrics *Rubrics);
|
||||||
static void Rub_PutParsToCreateNewRubric (void *Rubrics);
|
static void Rub_PutParsToCreateNewRubric (void *Rubrics);
|
||||||
|
|
||||||
static void Rub_ShowRubricMainData (struct Rub_Rubrics *Rubrics,
|
static void Rub_ShowRubricMainData (struct Rub_Rubrics *Rubrics,
|
||||||
const struct Rub_Rubric *Rubric,
|
struct Rub_Rubric *Rubric,
|
||||||
bool ShowOnlyThisRubric);
|
bool ShowOnlyThisRubric);
|
||||||
|
|
||||||
static void Rub_PutIconsOneRubric (void *Rubrics);
|
static void Rub_PutIconsOneRubric (void *Rubrics);
|
||||||
|
@ -75,12 +75,11 @@ static void Rub_PutIconsToRemEditOneRubric (struct Rub_Rubrics *Rubrics);
|
||||||
|
|
||||||
static void Rub_RemoveRubricFromAllTables (long RubCod);
|
static void Rub_RemoveRubricFromAllTables (long RubCod);
|
||||||
|
|
||||||
static void Rub_ReceiveRubricFieldsFromForm (struct Rub_Rubric *Rubric,
|
static void Rub_ReceiveRubricFieldsFromForm (struct Rub_Rubric *Rubric);
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1]);
|
|
||||||
static bool Rub_CheckRubricFieldsReceivedFromForm (const struct Rub_Rubric *Rubric);
|
static bool Rub_CheckRubricFieldsReceivedFromForm (const struct Rub_Rubric *Rubric);
|
||||||
|
|
||||||
static void Rub_CreateRubric (struct Rub_Rubric *Rubric,const char *Txt);
|
static void Rub_CreateRubric (struct Rub_Rubric *Rubric);
|
||||||
static void Rub_UpdateRubric (struct Rub_Rubric *Rubric,const char *Txt);
|
static void Rub_UpdateRubric (struct Rub_Rubric *Rubric);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*************************** Reset rubrics context ***************************/
|
/*************************** Reset rubrics context ***************************/
|
||||||
|
@ -96,16 +95,30 @@ void Rub_ResetRubrics (struct Rub_Rubrics *Rubrics)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*************************** Initialize rubric to empty **********************/
|
/************************ Rubric constructor/destructor **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rub_ResetRubric (struct Rub_Rubric *Rubric)
|
void Rub_RubricConstructor (struct Rub_Rubric *Rubric)
|
||||||
{
|
{
|
||||||
/***** Initialize to empty rubric *****/
|
/***** Initialize to empty rubric *****/
|
||||||
Rubric->RubCod = -1L;
|
Rubric->RubCod = -1L;
|
||||||
Rubric->CrsCod = -1L;
|
Rubric->CrsCod = -1L;
|
||||||
Rubric->UsrCod = -1L;
|
Rubric->UsrCod = -1L;
|
||||||
Rubric->Title[0] = '\0';
|
Rubric->Title[0] = '\0';
|
||||||
|
|
||||||
|
/***** Allocate memory for rubric text *****/
|
||||||
|
if ((Rubric->Txt = malloc (Cns_MAX_BYTES_TEXT + 1)) == NULL)
|
||||||
|
Err_NotEnoughMemoryExit ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rub_RubricDestructor (struct Rub_Rubric *Rubric)
|
||||||
|
{
|
||||||
|
/***** Free memory used for rubric text *****/
|
||||||
|
if (Rubric->Txt != NULL)
|
||||||
|
{
|
||||||
|
free (Rubric->Txt);
|
||||||
|
Rubric->Txt = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -138,6 +151,7 @@ void Rub_ListAllRubrics (struct Rub_Rubrics *Rubrics)
|
||||||
extern const char *Txt_No_rubrics;
|
extern const char *Txt_No_rubrics;
|
||||||
struct Pag_Pagination Pagination;
|
struct Pag_Pagination Pagination;
|
||||||
unsigned NumRubric;
|
unsigned NumRubric;
|
||||||
|
struct Rub_Rubric Rubric;
|
||||||
|
|
||||||
/***** Get number of groups in current course *****/
|
/***** Get number of groups in current course *****/
|
||||||
if (!Gbl.Crs.Grps.NumGrps)
|
if (!Gbl.Crs.Grps.NumGrps)
|
||||||
|
@ -170,11 +184,6 @@ void Rub_ListAllRubrics (struct Rub_Rubrics *Rubrics)
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
HTM_TH_Span (NULL,HTM_HEAD_CENTER,1,1,"CONTEXT_COL"); // Column for contextual icons
|
HTM_TH_Span (NULL,HTM_HEAD_CENTER,1,1,"CONTEXT_COL"); // Column for contextual icons
|
||||||
/*
|
|
||||||
HTM_TH_Begin (HTM_HEAD_LEFT);
|
|
||||||
HTM_Txt (Txt_Rubric);
|
|
||||||
HTM_TH_End ();
|
|
||||||
*/
|
|
||||||
HTM_TH_Span (Txt_Rubric,HTM_HEAD_LEFT,1,2,NULL);
|
HTM_TH_Span (Txt_Rubric,HTM_HEAD_LEFT,1,2,NULL);
|
||||||
|
|
||||||
// HTM_TH (Txt_Criteria,HTM_HEAD_RIGHT);
|
// HTM_TH (Txt_Criteria,HTM_HEAD_RIGHT);
|
||||||
|
@ -186,10 +195,17 @@ void Rub_ListAllRubrics (struct Rub_Rubrics *Rubrics)
|
||||||
NumRubric <= Pagination.LastItemVisible;
|
NumRubric <= Pagination.LastItemVisible;
|
||||||
NumRubric++)
|
NumRubric++)
|
||||||
{
|
{
|
||||||
/* Show a pair of rows with the main data of this rubric */
|
/***** Get rubric data *****/
|
||||||
Rubrics->RubCod = Rubrics->Lst[NumRubric - 1].RubCod;
|
Rub_RubricConstructor (&Rubric);
|
||||||
Rub_ShowRubricMainData (Rubrics,&Rubrics->Lst[NumRubric - 1],
|
Rubrics->RubCod = Rubric.RubCod = Rubrics->Lst[NumRubric - 1];
|
||||||
|
Rub_GetRubricDataByCod (&Rubric);
|
||||||
|
|
||||||
|
/***** Show main data of this rubric *****/
|
||||||
|
Rub_ShowRubricMainData (Rubrics,&Rubric,
|
||||||
false); // Do not show only this rubric
|
false); // Do not show only this rubric
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
|
@ -330,15 +346,20 @@ void Rub_SeeOneRubric (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Rub_GetPars (&Rubrics,true);
|
Rub_GetPars (&Rubrics,true);
|
||||||
Rubric.RubCod = Rubrics.RubCod;
|
Rubric.RubCod = Rubrics.RubCod;
|
||||||
|
|
||||||
|
/***** Get rubric data *****/
|
||||||
Rub_GetRubricDataByCod (&Rubric);
|
Rub_GetRubricDataByCod (&Rubric);
|
||||||
|
|
||||||
/***** Show rubric *****/
|
/***** Show rubric *****/
|
||||||
Rub_ShowOnlyOneRubric (&Rubrics,&Rubric);
|
Rub_ShowOnlyOneRubric (&Rubrics,&Rubric);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -346,13 +367,14 @@ void Rub_SeeOneRubric (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rub_ShowOnlyOneRubric (struct Rub_Rubrics *Rubrics,
|
void Rub_ShowOnlyOneRubric (struct Rub_Rubrics *Rubrics,
|
||||||
const struct Rub_Rubric *Rubric)
|
struct Rub_Rubric *Rubric)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Rubrics;
|
extern const char *Hlp_ASSESSMENT_Rubrics;
|
||||||
extern const char *Txt_Rubric;
|
extern const char *Txt_Rubric;
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin (NULL,Txt_Rubric,
|
Box_BoxBegin (NULL,Rubric->Title[0] ? Rubric->Title :
|
||||||
|
Txt_Rubric,
|
||||||
Rub_PutIconsOneRubric,Rubrics,
|
Rub_PutIconsOneRubric,Rubrics,
|
||||||
Hlp_ASSESSMENT_Rubrics,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Rubrics,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
|
@ -372,12 +394,11 @@ void Rub_ShowOnlyOneRubric (struct Rub_Rubrics *Rubrics,
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Rub_ShowRubricMainData (struct Rub_Rubrics *Rubrics,
|
static void Rub_ShowRubricMainData (struct Rub_Rubrics *Rubrics,
|
||||||
const struct Rub_Rubric *Rubric,
|
struct Rub_Rubric *Rubric,
|
||||||
bool ShowOnlyThisRubric)
|
bool ShowOnlyThisRubric)
|
||||||
{
|
{
|
||||||
extern const char *Txt_View_rubric;
|
extern const char *Txt_View_rubric;
|
||||||
extern const char *Txt_Number_of_criteria;
|
extern const char *Txt_Number_of_criteria;
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
if (ShowOnlyThisRubric)
|
if (ShowOnlyThisRubric)
|
||||||
|
@ -436,12 +457,11 @@ static void Rub_ShowRubricMainData (struct Rub_Rubrics *Rubrics,
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
else
|
else
|
||||||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
||||||
Rub_DB_GetRubricTxt (Rubric->RubCod,Txt);
|
|
||||||
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
|
||||||
Txt,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to rigorous HTML
|
Rubric->Txt,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to rigorous HTML
|
||||||
ALn_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
ALn_InsertLinks (Rubric->Txt,Cns_MAX_BYTES_TEXT,60); // Insert links
|
||||||
HTM_DIV_Begin ("class=\"PAR DAT_%s\"",The_GetSuffix ());
|
HTM_DIV_Begin ("class=\"PAR DAT_%s\"",The_GetSuffix ());
|
||||||
HTM_Txt (Txt);
|
HTM_Txt (Rubric->Txt);
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -533,6 +553,7 @@ void Rub_GetPars (struct Rub_Rubrics *Rubrics,bool CheckRubCod)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Get list of all rubrics ***************************/
|
/************************* Get list of all rubrics ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
// Txt is not retrieved from database
|
||||||
|
|
||||||
void Rub_GetListRubrics (struct Rub_Rubrics *Rubrics)
|
void Rub_GetListRubrics (struct Rub_Rubrics *Rubrics)
|
||||||
{
|
{
|
||||||
|
@ -560,13 +581,8 @@ void Rub_GetListRubrics (struct Rub_Rubrics *Rubrics)
|
||||||
/* Get row */
|
/* Get row */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
/* Get code of the rubric (row[0]), course (row[1] and author (row[2]) */
|
/* Get code of the rubric (row[0]) */
|
||||||
Rubrics->Lst[NumRubric].RubCod = Str_ConvertStrCodToLongCod (row[0]);
|
Rubrics->Lst[NumRubric] = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
Rubrics->Lst[NumRubric].CrsCod = Str_ConvertStrCodToLongCod (row[1]);
|
|
||||||
Rubrics->Lst[NumRubric].UsrCod = Str_ConvertStrCodToLongCod (row[2]);
|
|
||||||
|
|
||||||
/* Get the title of the rubric (row[3]) */
|
|
||||||
Str_Copy (Rubrics->Lst[NumRubric].Title,row[3],sizeof (Rubrics->Lst[NumRubric].Title) - 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,7 +593,7 @@ void Rub_GetListRubrics (struct Rub_Rubrics *Rubrics)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************* Get rubric data using its code ************************/
|
/*********************** Get rubric data using its code **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rub_GetRubricDataByCod (struct Rub_Rubric *Rubric)
|
void Rub_GetRubricDataByCod (struct Rub_Rubric *Rubric)
|
||||||
|
@ -598,10 +614,19 @@ void Rub_GetRubricDataByCod (struct Rub_Rubric *Rubric)
|
||||||
|
|
||||||
/* Get the title of the rubric (row[3]) */
|
/* Get the title of the rubric (row[3]) */
|
||||||
Str_Copy (Rubric->Title,row[3],sizeof (Rubric->Title) - 1);
|
Str_Copy (Rubric->Title,row[3],sizeof (Rubric->Title) - 1);
|
||||||
|
|
||||||
|
/* Get rubric text */
|
||||||
|
Rub_DB_GetRubricTxt (Rubric);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* Initialize to empty rubric */
|
{
|
||||||
Rub_ResetRubric (Rubric);
|
/***** Initialize to empty rubric *****/
|
||||||
|
Rubric->RubCod = -1L;
|
||||||
|
Rubric->CrsCod = -1L;
|
||||||
|
Rubric->UsrCod = -1L;
|
||||||
|
Rubric->Title[0] = '\0';
|
||||||
|
Rubric->Txt[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
/* Free structure that stores the query result */
|
/* Free structure that stores the query result */
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
@ -636,7 +661,7 @@ void Rub_AskRemRubric (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Rub_GetPars (&Rubrics,true);
|
Rub_GetPars (&Rubrics,true);
|
||||||
|
@ -656,6 +681,9 @@ void Rub_AskRemRubric (void)
|
||||||
|
|
||||||
/***** Show rubrics again *****/
|
/***** Show rubrics again *****/
|
||||||
Rub_ListAllRubrics (&Rubrics);
|
Rub_ListAllRubrics (&Rubrics);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -670,7 +698,7 @@ void Rub_RemoveRubric (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Rub_GetPars (&Rubrics,true);
|
Rub_GetPars (&Rubrics,true);
|
||||||
|
@ -690,6 +718,9 @@ void Rub_RemoveRubric (void)
|
||||||
|
|
||||||
/***** Show rubrics again *****/
|
/***** Show rubrics again *****/
|
||||||
Rub_ListAllRubrics (&Rubrics);
|
Rub_ListAllRubrics (&Rubrics);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -735,7 +766,7 @@ void Rub_ReqCreatOrEditRubric (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
|
@ -752,13 +783,14 @@ void Rub_ReqCreatOrEditRubric (void)
|
||||||
Rub_GetRubricDataByCod (&Rubric);
|
Rub_GetRubricDataByCod (&Rubric);
|
||||||
break;
|
break;
|
||||||
case Rub_NEW_RUBRIC:
|
case Rub_NEW_RUBRIC:
|
||||||
/* Initialize to empty rubric */
|
|
||||||
Rub_ResetRubric (&Rubric);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Put form to create/edit a rubric and show criteria *****/
|
/***** Put form to create/edit a rubric and show criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,ExistingNewRubric);
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,ExistingNewRubric);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -770,21 +802,8 @@ void Rub_PutFormsOneRubric (struct Rub_Rubrics *Rubrics,
|
||||||
struct RubCri_Criterion *Criterion,
|
struct RubCri_Criterion *Criterion,
|
||||||
Rub_ExistingNewRubric_t ExistingNewRubric)
|
Rub_ExistingNewRubric_t ExistingNewRubric)
|
||||||
{
|
{
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
|
||||||
|
|
||||||
/***** Initialize text / get text from database *****/
|
|
||||||
switch (ExistingNewRubric)
|
|
||||||
{
|
|
||||||
case Rub_EXISTING_RUBRIC:
|
|
||||||
Rub_DB_GetRubricTxt (Rubric->RubCod,Txt);
|
|
||||||
break;
|
|
||||||
case Rub_NEW_RUBRIC:
|
|
||||||
Txt[0] = '\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Put form to create/edit a rubric *****/
|
/***** Put form to create/edit a rubric *****/
|
||||||
Rub_PutFormEditionRubric (Rubrics,Rubric,Txt,ExistingNewRubric);
|
Rub_PutFormEditionRubric (Rubrics,Rubric,ExistingNewRubric);
|
||||||
|
|
||||||
/***** Show other lists *****/
|
/***** Show other lists *****/
|
||||||
switch (ExistingNewRubric)
|
switch (ExistingNewRubric)
|
||||||
|
@ -806,7 +825,6 @@ void Rub_PutFormsOneRubric (struct Rub_Rubrics *Rubrics,
|
||||||
|
|
||||||
void Rub_PutFormEditionRubric (struct Rub_Rubrics *Rubrics,
|
void Rub_PutFormEditionRubric (struct Rub_Rubrics *Rubrics,
|
||||||
struct Rub_Rubric *Rubric,
|
struct Rub_Rubric *Rubric,
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
|
||||||
Rub_ExistingNewRubric_t ExistingNewRubric)
|
Rub_ExistingNewRubric_t ExistingNewRubric)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Rubrics_new_rubric;
|
extern const char *Hlp_ASSESSMENT_Rubrics_new_rubric;
|
||||||
|
@ -883,7 +901,7 @@ void Rub_PutFormEditionRubric (struct Rub_Rubrics *Rubrics,
|
||||||
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" rows=\"5\""
|
HTM_TEXTAREA_Begin ("id=\"Txt\" name=\"Txt\" rows=\"5\""
|
||||||
" class=\"TITLE_DESCRIPTION_WIDTH INPUT_%s\"",
|
" class=\"TITLE_DESCRIPTION_WIDTH INPUT_%s\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
HTM_Txt (Txt);
|
HTM_Txt (Rubric->Txt);
|
||||||
HTM_TEXTAREA_End ();
|
HTM_TEXTAREA_End ();
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
@ -907,7 +925,6 @@ void Rub_ReceiveFormRubric (void)
|
||||||
struct Rub_Rubric Rubric;
|
struct Rub_Rubric Rubric;
|
||||||
struct RubCri_Criterion Criterion;
|
struct RubCri_Criterion Criterion;
|
||||||
Rub_ExistingNewRubric_t ExistingNewRubric;
|
Rub_ExistingNewRubric_t ExistingNewRubric;
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
|
||||||
|
|
||||||
/***** Check if I can edit rubrics *****/
|
/***** Check if I can edit rubrics *****/
|
||||||
if (!Rub_CheckIfICanEditRubrics ())
|
if (!Rub_CheckIfICanEditRubrics ())
|
||||||
|
@ -915,7 +932,7 @@ void Rub_ReceiveFormRubric (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
|
@ -937,34 +954,39 @@ void Rub_ReceiveFormRubric (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Overwrite some rubric data with the data received from form *****/
|
/***** Overwrite some rubric data with the data received from form *****/
|
||||||
Rub_ReceiveRubricFieldsFromForm (&Rubric,Txt);
|
Rub_ReceiveRubricFieldsFromForm (&Rubric);
|
||||||
if (Rub_CheckRubricFieldsReceivedFromForm (&Rubric))
|
if (Rub_CheckRubricFieldsReceivedFromForm (&Rubric))
|
||||||
{
|
{
|
||||||
/***** Create a new rubric or update an existing one *****/
|
/***** Create a new rubric or update an existing one *****/
|
||||||
switch (ExistingNewRubric)
|
switch (ExistingNewRubric)
|
||||||
{
|
{
|
||||||
case Rub_EXISTING_RUBRIC:
|
case Rub_EXISTING_RUBRIC:
|
||||||
Rub_UpdateRubric (&Rubric,Txt); // Update rubric data in database
|
Rub_UpdateRubric (&Rubric); // Update rubric data in database
|
||||||
break;
|
break;
|
||||||
case Rub_NEW_RUBRIC:
|
case Rub_NEW_RUBRIC:
|
||||||
Rub_CreateRubric (&Rubric,Txt); // Add new rubric to database
|
Rub_CreateRubric (&Rubric); // Add new rubric to database
|
||||||
ExistingNewRubric = Rub_EXISTING_RUBRIC;
|
ExistingNewRubric = Rub_EXISTING_RUBRIC;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Show pending alerts */
|
||||||
|
Ale_ShowAlerts (NULL);
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,ExistingNewRubric);
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,ExistingNewRubric);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Rub_ReceiveRubricFieldsFromForm (struct Rub_Rubric *Rubric,
|
static void Rub_ReceiveRubricFieldsFromForm (struct Rub_Rubric *Rubric)
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1])
|
|
||||||
{
|
{
|
||||||
/***** Get rubric title *****/
|
/***** Get rubric title *****/
|
||||||
Par_GetParText ("Title",Rubric->Title,Rub_MAX_BYTES_TITLE);
|
Par_GetParText ("Title",Rubric->Title,Rub_MAX_BYTES_TITLE);
|
||||||
|
|
||||||
/***** Get rubric text *****/
|
/***** Get rubric text *****/
|
||||||
Par_GetParHTML ("Txt",Txt,Cns_MAX_BYTES_TEXT); // Store in HTML format (not rigorous)
|
Par_GetParHTML ("Txt",Rubric->Txt,Cns_MAX_BYTES_TEXT); // Store in HTML format (not rigorous)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Rub_CheckRubricFieldsReceivedFromForm (const struct Rub_Rubric *Rubric)
|
static bool Rub_CheckRubricFieldsReceivedFromForm (const struct Rub_Rubric *Rubric)
|
||||||
|
@ -987,7 +1009,7 @@ static bool Rub_CheckRubricFieldsReceivedFromForm (const struct Rub_Rubric *Rubr
|
||||||
else // If there is not a rubric title
|
else // If there is not a rubric title
|
||||||
{
|
{
|
||||||
NewRubricIsCorrect = false;
|
NewRubricIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewRubricIsCorrect;
|
return NewRubricIsCorrect;
|
||||||
|
@ -997,12 +1019,12 @@ static bool Rub_CheckRubricFieldsReceivedFromForm (const struct Rub_Rubric *Rubr
|
||||||
/**************************** Create a new rubric ****************************/
|
/**************************** Create a new rubric ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Rub_CreateRubric (struct Rub_Rubric *Rubric,const char *Txt)
|
static void Rub_CreateRubric (struct Rub_Rubric *Rubric)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Created_new_rubric_X;
|
extern const char *Txt_Created_new_rubric_X;
|
||||||
|
|
||||||
/***** Create a new rubric *****/
|
/***** Create a new rubric *****/
|
||||||
Rubric->RubCod = Rub_DB_CreateRubric (Rubric,Txt);
|
Rubric->RubCod = Rub_DB_CreateRubric (Rubric);
|
||||||
|
|
||||||
/***** Write success message *****/
|
/***** Write success message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_rubric_X,Rubric->Title);
|
Ale_ShowAlert (Ale_SUCCESS,Txt_Created_new_rubric_X,Rubric->Title);
|
||||||
|
@ -1012,12 +1034,12 @@ static void Rub_CreateRubric (struct Rub_Rubric *Rubric,const char *Txt)
|
||||||
/************************* Update an existing rubric *************************/
|
/************************* Update an existing rubric *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Rub_UpdateRubric (struct Rub_Rubric *Rubric,const char *Txt)
|
static void Rub_UpdateRubric (struct Rub_Rubric *Rubric)
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_rubric_has_been_modified;
|
extern const char *Txt_The_rubric_has_been_modified;
|
||||||
|
|
||||||
/***** Update the data of the rubric *****/
|
/***** Update the data of the rubric *****/
|
||||||
Rub_DB_UpdateRubric (Rubric,Txt);
|
Rub_DB_UpdateRubric (Rubric);
|
||||||
|
|
||||||
/***** Write success message *****/
|
/***** Write success message *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_The_rubric_has_been_modified);
|
Ale_ShowAlert (Ale_SUCCESS,Txt_The_rubric_has_been_modified);
|
||||||
|
|
|
@ -41,7 +41,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rub_ResetRubrics (struct Rub_Rubrics *Rubrics);
|
void Rub_ResetRubrics (struct Rub_Rubrics *Rubrics);
|
||||||
void Rub_ResetRubric (struct Rub_Rubric *Rubric);
|
void Rub_RubricConstructor (struct Rub_Rubric *Rubric);
|
||||||
|
void Rub_RubricDestructor (struct Rub_Rubric *Rubric);
|
||||||
|
|
||||||
void Rub_SeeAllRubrics (void);
|
void Rub_SeeAllRubrics (void);
|
||||||
void Rub_ListAllRubrics (struct Rub_Rubrics *Rubrics);
|
void Rub_ListAllRubrics (struct Rub_Rubrics *Rubrics);
|
||||||
|
@ -49,7 +50,7 @@ bool Rub_CheckIfICanEditRubrics (void);
|
||||||
bool Rub_CheckIfEditable (void);
|
bool Rub_CheckIfEditable (void);
|
||||||
void Rub_SeeOneRubric (void);
|
void Rub_SeeOneRubric (void);
|
||||||
void Rub_ShowOnlyOneRubric (struct Rub_Rubrics *Rubrics,
|
void Rub_ShowOnlyOneRubric (struct Rub_Rubrics *Rubrics,
|
||||||
const struct Rub_Rubric *Rubric);
|
struct Rub_Rubric *Rubric);
|
||||||
|
|
||||||
void Rub_SetCurrentRubCod (long GamCod);
|
void Rub_SetCurrentRubCod (long GamCod);
|
||||||
void Rub_PutPars (void *Rubrics);
|
void Rub_PutPars (void *Rubrics);
|
||||||
|
@ -70,7 +71,6 @@ void Rub_PutFormsOneRubric (struct Rub_Rubrics *Rubrics,
|
||||||
Rub_ExistingNewRubric_t ExistingNewRubric);
|
Rub_ExistingNewRubric_t ExistingNewRubric);
|
||||||
void Rub_PutFormEditionRubric (struct Rub_Rubrics *Rubrics,
|
void Rub_PutFormEditionRubric (struct Rub_Rubrics *Rubrics,
|
||||||
struct Rub_Rubric *Rubric,
|
struct Rub_Rubric *Rubric,
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1],
|
|
||||||
Rub_ExistingNewRubric_t ExistingNewRubric);
|
Rub_ExistingNewRubric_t ExistingNewRubric);
|
||||||
|
|
||||||
void Rub_ReceiveFormRubric (void);
|
void Rub_ReceiveFormRubric (void);
|
||||||
|
|
|
@ -239,7 +239,7 @@ void RubCri_ReceiveFormCriterion (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
|
@ -261,7 +261,10 @@ void RubCri_ReceiveFormCriterion (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void RubCri_ReceiveCriterionFieldsFromForm (struct RubCri_Criterion *Criterion)
|
static void RubCri_ReceiveCriterionFieldsFromForm (struct RubCri_Criterion *Criterion)
|
||||||
|
@ -318,7 +321,7 @@ static bool RubCri_CheckCriterionTitleReceivedFromForm (const struct RubCri_Crit
|
||||||
else // If there is not a criterion title
|
else // If there is not a criterion title
|
||||||
{
|
{
|
||||||
NewTitleIsCorrect = false;
|
NewTitleIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewTitleIsCorrect;
|
return NewTitleIsCorrect;
|
||||||
|
@ -337,7 +340,7 @@ void RubCri_ChangeTitle (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
|
@ -360,7 +363,10 @@ void RubCri_ChangeTitle (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -386,7 +392,7 @@ static void RubCri_ChangeValueCriterion (RubCri_ValueRange_t ValueRange)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
|
@ -411,7 +417,10 @@ static void RubCri_ChangeValueCriterion (RubCri_ValueRange_t ValueRange)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -427,7 +436,7 @@ void RubCri_ChangeWeight (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
|
@ -452,7 +461,10 @@ void RubCri_ChangeWeight (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -941,7 +953,7 @@ void RubCri_ReqRemCriterion (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
|
@ -960,7 +972,10 @@ void RubCri_ReqRemCriterion (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -976,7 +991,7 @@ void RubCri_RemoveCriterion (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
|
@ -1001,7 +1016,10 @@ void RubCri_RemoveCriterion (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1019,7 +1037,7 @@ void RubCri_MoveUpCriterion (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
|
@ -1048,7 +1066,10 @@ void RubCri_MoveUpCriterion (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1067,7 +1088,7 @@ void RubCri_MoveDownCriterion (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
|
@ -1099,7 +1120,10 @@ void RubCri_MoveDownCriterion (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new trubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1184,7 +1208,7 @@ void RubCri_ChangeLink (void)
|
||||||
|
|
||||||
/***** Reset rubrics context *****/
|
/***** Reset rubrics context *****/
|
||||||
Rub_ResetRubrics (&Rubrics);
|
Rub_ResetRubrics (&Rubrics);
|
||||||
Rub_ResetRubric (&Rubric);
|
Rub_RubricConstructor (&Rubric);
|
||||||
RubCri_ResetCriterion (&Criterion);
|
RubCri_ResetCriterion (&Criterion);
|
||||||
|
|
||||||
/***** Get and check parameters *****/
|
/***** Get and check parameters *****/
|
||||||
|
@ -1206,5 +1230,8 @@ void RubCri_ChangeLink (void)
|
||||||
|
|
||||||
/***** Show current rubric and its criteria *****/
|
/***** Show current rubric and its criteria *****/
|
||||||
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
Rub_PutFormsOneRubric (&Rubrics,&Rubric,&Criterion,
|
||||||
Rub_EXISTING_RUBRIC); // It's not a new rubric
|
Rub_EXISTING_RUBRIC);
|
||||||
|
|
||||||
|
/***** Free memory used for rubric *****/
|
||||||
|
Rub_RubricDestructor (&Rubric);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ extern struct Globals Gbl;
|
||||||
/*************************** Create a new rubric *****************************/
|
/*************************** Create a new rubric *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
long Rub_DB_CreateRubric (const struct Rub_Rubric *Rubric,const char *Txt)
|
long Rub_DB_CreateRubric (const struct Rub_Rubric *Rubric)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
DB_QueryINSERTandReturnCode ("can not create new rubric",
|
DB_QueryINSERTandReturnCode ("can not create new rubric",
|
||||||
|
@ -69,14 +69,14 @@ long Rub_DB_CreateRubric (const struct Rub_Rubric *Rubric,const char *Txt)
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Rubric->Title,
|
Rubric->Title,
|
||||||
Txt);
|
Rubric->Txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** Update an existing rubric ************************/
|
/************************** Update an existing rubric ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Rub_DB_UpdateRubric (const struct Rub_Rubric *Rubric,const char *Txt)
|
void Rub_DB_UpdateRubric (const struct Rub_Rubric *Rubric)
|
||||||
{
|
{
|
||||||
DB_QueryUPDATE ("can not update rubric",
|
DB_QueryUPDATE ("can not update rubric",
|
||||||
"UPDATE rub_rubrics"
|
"UPDATE rub_rubrics"
|
||||||
|
@ -86,22 +86,19 @@ void Rub_DB_UpdateRubric (const struct Rub_Rubric *Rubric,const char *Txt)
|
||||||
" WHERE RubCod=%ld",
|
" WHERE RubCod=%ld",
|
||||||
Gbl.Hierarchy.Crs.CrsCod,
|
Gbl.Hierarchy.Crs.CrsCod,
|
||||||
Rubric->Title,
|
Rubric->Title,
|
||||||
Txt,
|
Rubric->Txt,
|
||||||
Rubric->RubCod);
|
Rubric->RubCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************** Get list of all rubrics in the current course ****************/
|
/************ Get list of all rubric codes in the current course *************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
unsigned Rub_DB_GetListRubrics (MYSQL_RES **mysql_res)
|
unsigned Rub_DB_GetListRubrics (MYSQL_RES **mysql_res)
|
||||||
{
|
{
|
||||||
return (unsigned)
|
return (unsigned)
|
||||||
DB_QuerySELECT (mysql_res,"can not get rubrics",
|
DB_QuerySELECT (mysql_res,"can not get rubrics",
|
||||||
"SELECT RubCod," // row[0]
|
"SELECT RubCod" // row[0]
|
||||||
"CrsCod," // row[1]
|
|
||||||
"UsrCod," // row[2]
|
|
||||||
"Title" // row[3]
|
|
||||||
" FROM rub_rubrics"
|
" FROM rub_rubrics"
|
||||||
" WHERE CrsCod=%ld"
|
" WHERE CrsCod=%ld"
|
||||||
" ORDER BY Title",
|
" ORDER BY Title",
|
||||||
|
@ -145,14 +142,15 @@ void Rub_DB_GetRubricTitle (long RubCod,char *Title,size_t TitleSize)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Get rubric text from database ************************/
|
/********************** Get rubric text from database ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
// Rubric->Txt must be allocated with Cns_MAX_BYTES_TEXT + 1 bytes
|
||||||
|
|
||||||
void Rub_DB_GetRubricTxt (long RubCod,char Txt[Cns_MAX_BYTES_TEXT + 1])
|
void Rub_DB_GetRubricTxt (struct Rub_Rubric *Rubric)
|
||||||
{
|
{
|
||||||
DB_QuerySELECTString (Txt,Cns_MAX_BYTES_TEXT,"can not get rubric text",
|
DB_QuerySELECTString (Rubric->Txt,Cns_MAX_BYTES_TEXT,"can not get rubric text",
|
||||||
"SELECT Txt" // row[0]
|
"SELECT Txt" // row[0]
|
||||||
" FROM rub_rubrics"
|
" FROM rub_rubrics"
|
||||||
" WHERE RubCod=%ld",
|
" WHERE RubCod=%ld",
|
||||||
RubCod);
|
Rubric->RubCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -38,14 +38,14 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
//-------------------------------- Rubrics ------------------------------------
|
//-------------------------------- Rubrics ------------------------------------
|
||||||
long Rub_DB_CreateRubric (const struct Rub_Rubric *Rubric,const char *Txt);
|
long Rub_DB_CreateRubric (const struct Rub_Rubric *Rubric);
|
||||||
void Rub_DB_UpdateRubric (const struct Rub_Rubric *Rubric,const char *Txt);
|
void Rub_DB_UpdateRubric (const struct Rub_Rubric *Rubric);
|
||||||
void Rub_DB_HideOrUnhideRubric (long RubCod,bool Hide);
|
void Rub_DB_HideOrUnhideRubric (long RubCod,bool Hide);
|
||||||
|
|
||||||
unsigned Rub_DB_GetListRubrics (MYSQL_RES **mysql_res);
|
unsigned Rub_DB_GetListRubrics (MYSQL_RES **mysql_res);
|
||||||
unsigned Rub_DB_GetRubricDataByCod (MYSQL_RES **mysql_res,long RubCod);
|
unsigned Rub_DB_GetRubricDataByCod (MYSQL_RES **mysql_res,long RubCod);
|
||||||
void Rub_DB_GetRubricTitle (long RubCod,char *Title,size_t TitleSize);
|
void Rub_DB_GetRubricTitle (long RubCod,char *Title,size_t TitleSize);
|
||||||
void Rub_DB_GetRubricTxt (long RubCod,char Txt[Cns_MAX_BYTES_TEXT + 1]);
|
void Rub_DB_GetRubricTxt (struct Rub_Rubric *Rubric);
|
||||||
bool Rub_DB_CheckIfSimilarRubricExists (const struct Rub_Rubric *Rubric);
|
bool Rub_DB_CheckIfSimilarRubricExists (const struct Rub_Rubric *Rubric);
|
||||||
unsigned Rub_DB_GetNumCoursesWithRubrics (HieLvl_Level_t Scope);
|
unsigned Rub_DB_GetNumCoursesWithRubrics (HieLvl_Level_t Scope);
|
||||||
unsigned Rub_DB_GetNumRubrics (HieLvl_Level_t Scope);
|
unsigned Rub_DB_GetNumRubrics (HieLvl_Level_t Scope);
|
||||||
|
|
|
@ -49,7 +49,8 @@ struct Rub_Rubric
|
||||||
long RubCod; // Rubric code
|
long RubCod; // Rubric code
|
||||||
long CrsCod; // Course code
|
long CrsCod; // Course code
|
||||||
long UsrCod; // Author code
|
long UsrCod; // Author code
|
||||||
char Title[Rub_MAX_BYTES_TITLE + 1];
|
char Title[Rub_MAX_BYTES_TITLE + 1]; // Title
|
||||||
|
char *Txt; // Text (dynamically allocated)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Rub_Rubrics
|
struct Rub_Rubrics
|
||||||
|
@ -57,7 +58,7 @@ struct Rub_Rubrics
|
||||||
bool LstIsRead; // Is the list already read from database...
|
bool LstIsRead; // Is the list already read from database...
|
||||||
// ...or it needs to be read?
|
// ...or it needs to be read?
|
||||||
unsigned Num; // Total number of rubrics
|
unsigned Num; // Total number of rubrics
|
||||||
struct Rub_Rubric *Lst; // List of rubrics
|
long *Lst; // List of rubric codes
|
||||||
unsigned CurrentPage;
|
unsigned CurrentPage;
|
||||||
long RubCod; // Selected/current rubric code
|
long RubCod; // Selected/current rubric code
|
||||||
long CriCod; // Selected/current criterion code
|
long CriCod; // Selected/current criterion code
|
||||||
|
|
|
@ -2074,7 +2074,7 @@ void Svy_ReceiveFormSurvey (void)
|
||||||
else // If there is not a survey title
|
else // If there is not a survey title
|
||||||
{
|
{
|
||||||
NewSurveyIsCorrect = false;
|
NewSurveyIsCorrect = false;
|
||||||
Ale_ShowAlertYouMustSpecifyTheTitle ();
|
Ale_CreateAlertYouMustSpecifyTheTitle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Create a new survey or update an existing one *****/
|
/***** Create a new survey or update an existing one *****/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user