mirror of https://github.com/acanas/swad-core.git
Version 22.110.2: May 15, 2023 Changes in rubrics.
This commit is contained in:
parent
941f191c50
commit
9ca2f36b3e
|
@ -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.110.1 (2023-05-14)"
|
#define Log_PLATFORM_VERSION "SWAD 22.110.2 (2023-05-15)"
|
||||||
#define CSS_FILE "swad22.107.36.css"
|
#define CSS_FILE "swad22.107.36.css"
|
||||||
#define JS_FILE "swad22.49.js"
|
#define JS_FILE "swad22.49.js"
|
||||||
/*
|
/*
|
||||||
|
Version 22.110.2: May 15, 2023 Changes in rubrics. (336462 lines)
|
||||||
Version 22.110.1: May 14, 2023 Changes in project rubrics. (336462 lines)
|
Version 22.110.1: May 14, 2023 Changes in project rubrics. (336462 lines)
|
||||||
Version 22.110: May 12, 2023 Code refactoring confirming removal. (336445 lines)
|
Version 22.110: May 12, 2023 Code refactoring confirming removal. (336445 lines)
|
||||||
Version 22.109: May 11, 2023 Code refactoring confirming removal. (336647 lines)
|
Version 22.109: May 11, 2023 Code refactoring confirming removal. (336647 lines)
|
||||||
|
|
|
@ -587,9 +587,11 @@ static void RubCri_ListOneOrMoreCriteriaForSeeing (unsigned NumCriteria,
|
||||||
MYSQL_RES *mysql_res)
|
MYSQL_RES *mysql_res)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Criteria;
|
extern const char *Txt_Criteria;
|
||||||
|
extern const char *Txt_Total;
|
||||||
unsigned NumCriterion;
|
unsigned NumCriterion;
|
||||||
struct RubCri_Criterion Criterion;
|
struct RubCri_Criterion Criterion;
|
||||||
RubCri_ValueRange_t ValueRange;
|
RubCri_ValueRange_t ValueRange;
|
||||||
|
double SumOfWeights = 0.0;
|
||||||
|
|
||||||
/***** Begin table *****/
|
/***** Begin table *****/
|
||||||
HTM_TABLE_BeginWideMarginPadding (5);
|
HTM_TABLE_BeginWideMarginPadding (5);
|
||||||
|
@ -608,6 +610,7 @@ static void RubCri_ListOneOrMoreCriteriaForSeeing (unsigned NumCriteria,
|
||||||
|
|
||||||
/***** Get criterion data *****/
|
/***** Get criterion data *****/
|
||||||
RubCri_GetCriterionDataFromRow (mysql_res,&Criterion);
|
RubCri_GetCriterionDataFromRow (mysql_res,&Criterion);
|
||||||
|
SumOfWeights += Criterion.Weight;
|
||||||
|
|
||||||
/***** Begin row *****/
|
/***** Begin row *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -654,6 +657,23 @@ static void RubCri_ListOneOrMoreCriteriaForSeeing (unsigned NumCriteria,
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Write total row *****/
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
/***** Label *****/
|
||||||
|
HTM_TD_Begin ("colspan=\"5\" class=\"RB LINE_TOP DAT_STRONG_%s\"",
|
||||||
|
The_GetSuffix ());
|
||||||
|
HTM_Txt (Txt_Total);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
/***** Sum of weights *****/
|
||||||
|
HTM_TD_Begin ("class=\"RB LINE_TOP DAT_STRONG_%s\"",The_GetSuffix ());
|
||||||
|
HTM_Double2Decimals (SumOfWeights);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
/***** End row *****/
|
||||||
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
HTM_TABLE_End ();
|
HTM_TABLE_End ();
|
||||||
}
|
}
|
||||||
|
@ -814,7 +834,7 @@ static void RubCri_ListOneOrMoreCriteriaForEdition (struct Rub_Rubrics *Rubrics,
|
||||||
|
|
||||||
/***** Sum of weights *****/
|
/***** Sum of weights *****/
|
||||||
HTM_TD_Begin ("class=\"RB LINE_TOP DAT_STRONG_%s\"",The_GetSuffix ());
|
HTM_TD_Begin ("class=\"RB LINE_TOP DAT_STRONG_%s\"",The_GetSuffix ());
|
||||||
HTM_Double (SumOfWeights);
|
HTM_Double2Decimals (SumOfWeights);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** End row *****/
|
/***** End row *****/
|
||||||
|
@ -834,11 +854,16 @@ static void RubCri_ListOneOrMoreCriteriaInProject (struct Prj_Projects *Projects
|
||||||
MYSQL_RES *mysql_res)
|
MYSQL_RES *mysql_res)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Criteria;
|
extern const char *Txt_Criteria;
|
||||||
|
extern const char *Txt_Total;
|
||||||
struct RubCri_Criterion Criterion;
|
struct RubCri_Criterion Criterion;
|
||||||
unsigned NumCriterion;
|
unsigned NumCriterion;
|
||||||
RubCri_ValueRange_t ValueRange;
|
RubCri_ValueRange_t ValueRange;
|
||||||
char *Anchor;
|
char *Anchor;
|
||||||
double Score = 0.0;
|
double Score;
|
||||||
|
double WeightedScore;
|
||||||
|
double SumOfWeights = 0.0;
|
||||||
|
double SumOfScores = 0.0;
|
||||||
|
double WeightedSum = 0.0;
|
||||||
|
|
||||||
/***** Write the heading *****/
|
/***** Write the heading *****/
|
||||||
RubCri_PutTableHeadingForCriteria (RubCri_DONT_PUT_COLUMN_FOR_ICONS,
|
RubCri_PutTableHeadingForCriteria (RubCri_DONT_PUT_COLUMN_FOR_ICONS,
|
||||||
|
@ -854,6 +879,13 @@ static void RubCri_ListOneOrMoreCriteriaInProject (struct Prj_Projects *Projects
|
||||||
|
|
||||||
/***** Get criterion data *****/
|
/***** Get criterion data *****/
|
||||||
RubCri_GetCriterionDataFromRow (mysql_res,&Criterion);
|
RubCri_GetCriterionDataFromRow (mysql_res,&Criterion);
|
||||||
|
SumOfWeights += Criterion.Weight;
|
||||||
|
|
||||||
|
/***** Get score from database *****/
|
||||||
|
Score = Prj_DB_GetScore (Projects->Prj.PrjCod,Criterion.CriCod);
|
||||||
|
WeightedScore = Score * Criterion.Weight;
|
||||||
|
SumOfScores += Score;
|
||||||
|
WeightedSum += WeightedScore;
|
||||||
|
|
||||||
/***** Build anchor string *****/
|
/***** Build anchor string *****/
|
||||||
Frm_SetAnchorStr (Criterion.CriCod,&Anchor);
|
Frm_SetAnchorStr (Criterion.CriCod,&Anchor);
|
||||||
|
@ -905,11 +937,6 @@ static void RubCri_ListOneOrMoreCriteriaInProject (struct Prj_Projects *Projects
|
||||||
HTM_TD_Begin ("class=\"RT DAT_%s %s\"",
|
HTM_TD_Begin ("class=\"RT DAT_%s %s\"",
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
/* Get score from database */
|
|
||||||
Score = Prj_DB_GetScore (Projects->Prj.PrjCod,
|
|
||||||
Criterion.CriCod);
|
|
||||||
|
|
||||||
/* Show score */
|
|
||||||
if (ICanFill)
|
if (ICanFill)
|
||||||
{
|
{
|
||||||
Frm_BeginFormAnchor (ActChgPrjSco,Anchor);
|
Frm_BeginFormAnchor (ActChgPrjSco,Anchor);
|
||||||
|
@ -930,16 +957,43 @@ static void RubCri_ListOneOrMoreCriteriaInProject (struct Prj_Projects *Projects
|
||||||
HTM_Double (Score);
|
HTM_Double (Score);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Criterion score x weight *****/
|
/***** Weighted score *****/
|
||||||
HTM_TD_Begin ("class=\"RT DAT_%s %s\"",
|
HTM_TD_Begin ("class=\"RT DAT_%s %s\"",
|
||||||
The_GetSuffix (),
|
The_GetSuffix (),
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
HTM_Double (Score * Criterion.Weight);
|
HTM_Double2Decimals (WeightedScore);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** End row *****/
|
/***** End row *****/
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Write total row *****/
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
/***** Label *****/
|
||||||
|
HTM_TD_Begin ("colspan=\"5\" class=\"RB LINE_TOP DAT_STRONG_%s\"",
|
||||||
|
The_GetSuffix ());
|
||||||
|
HTM_Txt (Txt_Total);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
/***** Sum of weights *****/
|
||||||
|
HTM_TD_Begin ("class=\"RB LINE_TOP DAT_%s\"",The_GetSuffix ());
|
||||||
|
HTM_Double2Decimals (SumOfWeights);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
/***** Sum of scores *****/
|
||||||
|
HTM_TD_Begin ("class=\"RB LINE_TOP DAT_%s\"",The_GetSuffix ());
|
||||||
|
HTM_Double2Decimals (SumOfScores);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
/***** Weighted sum *****/
|
||||||
|
HTM_TD_Begin ("class=\"RB LINE_TOP DAT_STRONG_%s\"",The_GetSuffix ());
|
||||||
|
HTM_Double2Decimals (WeightedSum);
|
||||||
|
HTM_TD_End ();
|
||||||
|
|
||||||
|
/***** End row *****/
|
||||||
|
HTM_TR_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1038,7 +1092,7 @@ static void RubCri_PutTableHeadingForCriteria (RubCri_PutColumnForIcons_t PutCol
|
||||||
HTM_TH (Txt_Score,HTM_HEAD_RIGHT);
|
HTM_TH (Txt_Score,HTM_HEAD_RIGHT);
|
||||||
|
|
||||||
if (asprintf (&Title,"%s × %s",
|
if (asprintf (&Title,"%s × %s",
|
||||||
Txt_Score,Txt_Weight) < 0)
|
Txt_Weight,Txt_Score) < 0)
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
HTM_TH (Title,HTM_HEAD_RIGHT);
|
HTM_TH (Title,HTM_HEAD_RIGHT);
|
||||||
free (Title);
|
free (Title);
|
||||||
|
|
Loading…
Reference in New Issue