Version 22.83.2: Mar 27, 2023 Changes in rubric criteria.

This commit is contained in:
acanas 2023-03-27 19:55:20 +02:00
parent c74c6e2f3e
commit 55a4c2aae6
8 changed files with 23 additions and 148 deletions

View File

@ -852,8 +852,7 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
[ActUp_RubCri ] = {1962,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_MoveUpCriterion ,NULL},
[ActDwnRubCri ] = {1963,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_MoveDownCriterion ,NULL},
[ActChgTitRubCri ] = {1964,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeTitle ,NULL},
[ActChgTypRubCri ] = {1968,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeType ,NULL},
[ActChgLnkRubCri ] = {1970,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeLink ,NULL},
[ActChgLnkRubCri ] = {1968,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeLink ,NULL},
[ActChgMinRubCri ] = {1965,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeMinValue ,NULL},
[ActChgMaxRubCri ] = {1966,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeMaxValue ,NULL},
[ActChgWeiRubCri ] = {1967,-1,TabUnk,ActSeeAllRub ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,RubCri_ChangeWeight ,NULL},
@ -3856,7 +3855,6 @@ Act_Action_t ActLst_FromActCodToAction[1 + ActLst_MAX_ACTION_COD] = // Do not re
ActChgMinRubCri, // #1965
ActChgMaxRubCri, // #1966
ActChgWeiRubCri, // #1967
ActChgTypRubCri, // #1968
ActChgLnkRubCri, // #1968
ActReqLnkRub, // #1969
ActChgLnkRubCri, // #1970
};

View File

@ -774,11 +774,10 @@
#define ActUp_RubCri (ActChgCrsTT1stDay + 231)
#define ActDwnRubCri (ActChgCrsTT1stDay + 232)
#define ActChgTitRubCri (ActChgCrsTT1stDay + 233)
#define ActChgTypRubCri (ActChgCrsTT1stDay + 234)
#define ActChgLnkRubCri (ActChgCrsTT1stDay + 235)
#define ActChgMinRubCri (ActChgCrsTT1stDay + 236)
#define ActChgMaxRubCri (ActChgCrsTT1stDay + 237)
#define ActChgWeiRubCri (ActChgCrsTT1stDay + 238)
#define ActChgLnkRubCri (ActChgCrsTT1stDay + 234)
#define ActChgMinRubCri (ActChgCrsTT1stDay + 235)
#define ActChgMaxRubCri (ActChgCrsTT1stDay + 236)
#define ActChgWeiRubCri (ActChgCrsTT1stDay + 237)
/*****************************************************************************/
/******************************** Files tab **********************************/
@ -1771,7 +1770,7 @@
#define ActLst_NUM_ACTIONS (ActChgMyTT1stDay + 1)
#define ActLst_MAX_ACTION_COD 1970
#define ActLst_MAX_ACTION_COD 1969
#define ActLst_DEFAULT_ACTION_AFTER_LOGIN ActSeeGblTL

View File

@ -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.83.1 (2023-03-27)"
#define Log_PLATFORM_VERSION "SWAD 22.83.2 (2023-03-27)"
#define CSS_FILE "swad22.78.15.css"
#define JS_FILE "swad22.49.js"
/*
Version 22.83.2: Mar 27, 2023 Changes in rubric criteria. (338189 lines)
Version 22.83.1: Mar 27, 2023 Changes in rubric criteria. (338297 lines)
Version 22.83: Mar 27, 2023 New module swad_resource_database. (338208 lines)
1 change necessary in database:

View File

@ -390,48 +390,6 @@ void RubCri_ChangeTitle (void)
Rub_EXISTING_RUBRIC); // It's not a new rubric
}
/*****************************************************************************/
/******************* Receive form to change criterion type *******************/
/*****************************************************************************/
void RubCri_ChangeType (void)
{
struct Rub_Rubrics Rubrics;
struct RubCri_Criterion Criterion;
/***** Check if I can edit rubrics *****/
if (!Rub_CheckIfICanEditRubrics ())
Err_NoPermissionExit ();
/***** Reset rubrics context *****/
Rub_ResetRubrics (&Rubrics);
Rub_ResetRubric (&Rubrics.Rubric);
RubCri_ResetCriterion (&Criterion);
/***** Get parameters *****/
Rub_GetPars (&Rubrics,true);
Criterion.RubCod = Rubrics.Rubric.RubCod;
Rubrics.CriCod = Criterion.CriCod = ParCod_GetAndCheckPar (ParCod_Cri);
/***** Get and check parameters *****/
RubCri_GetAndCheckPars (&Rubrics,&Criterion);
/***** Check if rubric is editable *****/
if (!Rub_CheckIfEditable (&Rubrics.Rubric))
Err_NoPermissionExit ();
/***** Receive new type from form *****/
Criterion.Link.Type = RubCri_GetParType ();
/***** Change type *****/
/* Update the table changing old type by new type */
Rub_DB_UpdateCriterionType (&Criterion);
/***** Show current rubric and its criteria *****/
Rub_PutFormsOneRubric (&Rubrics,&Criterion,
Rub_EXISTING_RUBRIC); // It's not a new rubric
}
/*****************************************************************************/
/********* Receive form to change minimum/maximum value of criterion *********/
/*****************************************************************************/
@ -616,8 +574,6 @@ static void RubCri_ListOneOrMoreCriteriaForEdition (struct Rub_Rubrics *Rubrics,
unsigned NumCriterion;
struct RubCri_Criterion Criterion;
char *Anchor;
Rsc_Type_t Type;
unsigned SourceUnsigned;
RubCri_ValueRange_t ValueRange;
/***** Trivial check *****/
@ -712,29 +668,8 @@ static void RubCri_ListOneOrMoreCriteriaForEdition (struct Rub_Rubrics *Rubrics,
HTM_ARTICLE_End ();
HTM_TD_End ();
/***** Source *****/
/***** Link to resource *****/
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
/* Type of source selector */
Frm_BeginFormAnchor (ActChgTypRubCri,Anchor);
RubCri_PutParsOneCriterion (Rubrics);
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,
"name=\"Type\" class=\"INPUT_%s\"",
The_GetSuffix ());
for (Type = (Rsc_Type_t) 0;
Type <= (Rsc_Type_t) (Rsc_NUM_TYPES - 1);
Type++)
{
SourceUnsigned = (unsigned) Type;
HTM_OPTION (HTM_Type_UNSIGNED,&SourceUnsigned,
Type == Criterion.Link.Type,false,
"%s",Txt_RESOURCE_TYPES[Type]);
}
HTM_SELECT_End ();
Frm_EndForm ();
HTM_BR ();
/* Resource */
RubCri_ShowResource (Rubrics,&Criterion,
true,Anchor); // Editing
HTM_TD_End ();
@ -835,8 +770,10 @@ static void RubCri_GetCriterionDataFromRow (MYSQL_RES *mysql_res,
row[8] Title
*/
/***** Get criterion code (row[0]) and rubric code (row[1]) *****/
Criterion->CriCod = Str_ConvertStrCodToLongCod (row[0]);
Criterion->RubCod = Str_ConvertStrCodToLongCod (row[1]);
if ((Criterion->CriCod = Str_ConvertStrCodToLongCod (row[0])) <= 0)
Err_WrongCriterionExit ();
if ((Criterion->RubCod = Str_ConvertStrCodToLongCod (row[1])) <= 0)
Err_WrongRubricExit ();
/***** Get criterion index (row[2]) *****/
Criterion->CriInd = Str_ConvertStrToUnsigned (row[2]);
@ -1195,11 +1132,6 @@ static void RubCri_ShowClipboard (struct Rub_Rubrics *Rubrics,
/***** Begin form *****/
Frm_BeginFormAnchor (ActChgLnkRubCri,Anchor);
RubCri_PutParsOneCriterion (Rubrics);
if (Criterion->CriCod > 0)
ParCod_PutPar (ParCod_Cri,Criterion->CriCod);
// else
/* No resource selected, so it's a new resource at the end of the item */
// ParCod_PutPar (ParCod_Itm,Item->Hierarchy.ItmCod);
/***** Begin list *****/
HTM_UL_Begin ("class=\"PRG_CLIPBOARD\"");
@ -1260,18 +1192,6 @@ void RubCri_ChangeLink (void)
Criterion.Link.Type = Rsc_GetTypeFromString (TypeStr);
Criterion.Link.Cod = Cod;
/***** Is it an existing resource? *****/
// if (Criterion.CriCod <= 0)
//{
/* No resource selected, so it's a new resource at the end of the item */
/* Get the new title for the new resource from link title */
//Rsc_GetResourceTitleFromLink (&Item.Resource.Link,
// Item.Resource.Title);
/***** Create resource *****/
// Item.Resource.Hierarchy.RscCod = Prg_DB_CreateResource (&Item);
//}
/***** Update link to resource in criterion *****/
Rub_DB_UpdateCriterionLink (&Criterion);

View File

@ -37,7 +37,6 @@ void RubCri_GetCriterionDataByCod (struct RubCri_Criterion *Criterion);
void RubCri_ReceiveFormCriterion (void);
void RubCri_ChangeTitle (void);
void RubCri_ChangeType (void);
void RubCri_ChangeMinValue (void);
void RubCri_ChangeMaxValue (void);
void RubCri_ChangeWeight (void);

View File

@ -393,21 +393,21 @@ void Rub_DB_UpdateCriterionTitle (const struct RubCri_Criterion *Criterion)
}
/*****************************************************************************/
/********************** Update criterion type in database ********************/
/******** Update the link to a resource in a criterion given its code ********/
/*****************************************************************************/
void Rub_DB_UpdateCriterionType (const struct RubCri_Criterion *Criterion)
void Rub_DB_UpdateCriterionLink (const struct RubCri_Criterion *Criterion)
{
extern const char *Rsc_ResourceTypesDB[Rsc_NUM_TYPES];
DB_QueryUPDATE ("can not update the value of a criterion",
DB_QueryUPDATE ("can not update link of criterion",
"UPDATE rub_criteria"
" SET Type='%s'"
" WHERE CriCod=%ld"
" AND RubCod=%ld", // Extra check
" SET Type='%s',"
"Cod=%ld"
" WHERE CriCod=%ld",
Rsc_ResourceTypesDB[Criterion->Link.Type],
Criterion->CriCod,
Criterion->RubCod);
Criterion->Link.Cod,
Criterion->CriCod);
}
/*****************************************************************************/
@ -478,24 +478,6 @@ void Rub_DB_UpdateCriterionIndex (long CriInd,long CriCod,long RubCod)
RubCod);
}
/*****************************************************************************/
/******** Update the link to a resource in a criterion given its code ********/
/*****************************************************************************/
void Rub_DB_UpdateCriterionLink (const struct RubCri_Criterion *Criterion)
{
extern const char *Rsc_ResourceTypesDB[Rsc_NUM_TYPES];
DB_QueryUPDATE ("can not update link of criterion",
"UPDATE rub_criteria"
" SET Type='%s',"
"Cod=%ld"
" WHERE CriCod=%ld",
Rsc_ResourceTypesDB[Criterion->Link.Type],
Criterion->Link.Cod,
Criterion->CriCod);
}
/*****************************************************************************/
/************ Lock table to make the exchange of criteria atomic ***********/
/*****************************************************************************/

View File

@ -56,13 +56,12 @@ void Rub_DB_RemoveCrsRubrics (long CrsCod);
//--------------------------- Rubric criteria -------------------------------
long Rub_DB_CreateCriterion (const struct RubCri_Criterion *Criterion);
void Rub_DB_UpdateCriterionTitle (const struct RubCri_Criterion *Criterion);
void Rub_DB_UpdateCriterionType (const struct RubCri_Criterion *Criterion);
void Rub_DB_UpdateCriterionLink (const struct RubCri_Criterion *Criterion);
void Rub_DB_UpdateCriterionValue (const struct RubCri_Criterion *Criterion,
RubCri_ValueRange_t ValueRange);
void Rub_DB_UpdateCriterionWeight (const struct RubCri_Criterion *Criterion);
void Rub_DB_UpdateCriteriaIndexesInRubricGreaterThan (long RubCod,unsigned CriInd);
void Rub_DB_UpdateCriterionIndex (long CriInd,long CriCod,long RubCod);
void Rub_DB_UpdateCriterionLink (const struct RubCri_Criterion *Criterion);
void Rub_DB_LockTable (void);
unsigned Rub_DB_GetNumCriteriaInRubric (long RubCod);

View File

@ -14205,29 +14205,6 @@ const char *Txt_Actions[ActLst_NUM_ACTIONS] =
"Alterar t&iacute;tulo do crit&eacute;rio de rubrica"
#elif L==10 // tr
"Puan anahtar&inodot; &ouml;l&ccedil;&uuml;t ba&scedil;l&inodot;&gbreve;&inodot;n&inodot; de&gbreve;i&scedil;tir" // Çeviri lazim!
#endif
,
[ActChgTypRubCri] =
#if L==1 // ca
"Canviar font de criteri de r&uacute;brica"
#elif L==2 // de
"Schriftart der Rubrikkriterien &auml;ndern"
#elif L==3 // en
"Change rubric criterion source"
#elif L==4 // es
"Cambiar fuente de criterio de r&uacute;brica"
#elif L==5 // fr
"Modifier source de crit&egrave;re de rubrique"
#elif L==6 // gn
"Omoambue criterio r&uacute;brica fuente"
#elif L==7 // it
"Cambiare fonte di criterio di rubrica"
#elif L==8 // pl
"Zmie&nacute; &zacute;r&oacute;d&lstrok;o kryterium rubryki"
#elif L==9 // pt
"Alterar origem do crit&eacute;rio de rubrica"
#elif L==10 // tr
"Puan anahtar&inodot; &ouml;l&ccedil;&uuml;t yaz&inodot; tipini de&gbreve;i&scedil;tir"
#endif
,
[ActChgLnkRubCri] =