diff --git a/icon/score0_1x1.png b/icon/score0_1x1.png new file mode 100644 index 00000000..5f4fb21c Binary files /dev/null and b/icon/score0_1x1.png differ diff --git a/icon/score1_1x1.png b/icon/score1_1x1.png new file mode 100644 index 00000000..621c54c7 Binary files /dev/null and b/icon/score1_1x1.png differ diff --git a/icon/score2_1x1.png b/icon/score2_1x1.png new file mode 100644 index 00000000..9aaab656 Binary files /dev/null and b/icon/score2_1x1.png differ diff --git a/icon/score3_1x1.png b/icon/score3_1x1.png new file mode 100644 index 00000000..9b17edf8 Binary files /dev/null and b/icon/score3_1x1.png differ diff --git a/icon/score4_1x1.png b/icon/score4_1x1.png new file mode 100644 index 00000000..804e4c9f Binary files /dev/null and b/icon/score4_1x1.png differ diff --git a/icon/score5_1x1.png b/icon/score5_1x1.png new file mode 100644 index 00000000..684c1209 Binary files /dev/null and b/icon/score5_1x1.png differ diff --git a/icon/score6_1x1.png b/icon/score6_1x1.png new file mode 100644 index 00000000..6c3749b4 Binary files /dev/null and b/icon/score6_1x1.png differ diff --git a/icon/score7_1x1.png b/icon/score7_1x1.png new file mode 100644 index 00000000..8d57a00f Binary files /dev/null and b/icon/score7_1x1.png differ diff --git a/icon/score8_1x1.png b/icon/score8_1x1.png new file mode 100644 index 00000000..245448b9 Binary files /dev/null and b/icon/score8_1x1.png differ diff --git a/icon/score9_1x1.png b/icon/score9_1x1.png new file mode 100644 index 00000000..fd44bba7 Binary files /dev/null and b/icon/score9_1x1.png differ diff --git a/swad_changelog.h b/swad_changelog.h index 4c62f5ba..d88a50a8 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,13 +487,17 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.40 (2019-10-21)" +#define Log_PLATFORM_VERSION "SWAD 19.40.1 (2019-10-21)" #define CSS_FILE "swad19.40.css" #define JS_FILE "swad19.39.js" /* // TODO: Perico: poner un candado de bloqueo de creación/edición de proyectos (por ejemplo en asignaturas obsoletas) // TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.) + Version 19.40.1: Oct 21, 2019 Coloured bars in score table. (245774 lines) + Copy the following 10 icons to icon public directory: +sudo cp -a icon/score*_1x1.png /var/www/html/swad/icon/ + Version 19.40: Oct 21, 2019 Match podium has been replaced by score table. (245741 lines) Version 19.39.2: Oct 18, 2019 Fixed HTML bug in listing of registration requests. (245659 lines) Version 19.39.1: Oct 18, 2019 Changes in layout and behaviour of matches. (245656 lines) diff --git a/swad_match.c b/swad_match.c index 98c388df..72ef3de9 100644 --- a/swad_match.c +++ b/swad_match.c @@ -163,7 +163,8 @@ static void Mch_ShowQuestionAndAnswersStd (struct Match *Match); static void Mch_ShowMatchScore (struct Match *Match); static void Mch_DrawEmptyRowScore (unsigned NumRow,double MinScore,double MaxScore); -static void Mch_DrawScoreRow (double Score,unsigned MaxUsrs,unsigned NumUsrs); +static void Mch_DrawScoreRow (double Score,double MinScore,double MaxScore, + unsigned NumUsrs,unsigned MaxUsrs); static void Mch_PutParamNumOpt (unsigned NumOpt); static unsigned Mch_GetParamNumOpt (void); @@ -2576,7 +2577,7 @@ static void Mch_ShowMatchScore (struct Match *Match) Mch_DrawEmptyRowScore (NumRow,MinScore,MaxScore); /***** Draw row for this score *****/ - Mch_DrawScoreRow (Score,MaxUsrs,NumUsrs); + Mch_DrawScoreRow (Score,MinScore,MaxScore,NumUsrs,MaxUsrs); NumRow++; } @@ -2619,10 +2620,40 @@ static void Mch_DrawEmptyRowScore (unsigned NumRow,double MinScore,double MaxSco Tbl_TR_End (); } -static void Mch_DrawScoreRow (double Score,unsigned MaxUsrs,unsigned NumUsrs) +static void Mch_DrawScoreRow (double Score,double MinScore,double MaxScore, + unsigned NumUsrs,unsigned MaxUsrs) { + unsigned Color; unsigned BarWidth; + /***** Compute color *****/ + /* + +----------------- MaxScore + | score9_1x1.png + +----------------- + | score8_1x1.png + +----------------- + | score7_1x1.png + +----------------- + | score6_1x1.png + +----------------- + | score5_1x1.png + +----------------- + | score4_1x1.png + +----------------- + | score3_1x1.png + +----------------- + | score2_1x1.png + +----------------- + | score1_1x1.png + +----------------- + | score0_1x1.png + +----------------- MinScore + */ + Color = (unsigned) (((Score - MinScore) / (MaxScore - MinScore)) * 10.0); + if (Color >= 10) + Color = 9; + /***** Compute bar width *****/ if (MaxUsrs > 0) { @@ -2644,11 +2675,11 @@ static void Mch_DrawScoreRow (double Score,unsigned MaxUsrs,unsigned NumUsrs) /* Draw bar and write number of users for this score */ Tbl_TD_Begin ("class=\"MATCH_SCORE_NUM\""); - fprintf (Gbl.F.Out,"\"\"" " %u", - Cfg_URL_ICON_PUBLIC,BarWidth,NumUsrs); + Cfg_URL_ICON_PUBLIC,Color,BarWidth,NumUsrs); Tbl_TD_End (); Tbl_TR_End ();