From 37f343a10c0cb6c95ce41fa646f2f7a406adbd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 19 Feb 2020 00:45:26 +0100 Subject: [PATCH] Version19.127.1 --- icon/eye-green.svg | 1 + icon/eye-slash-red.svg | 1 + swad_agenda.c | 4 ++-- swad_changelog.h | 11 ++++++++-- swad_forum.c | 8 ++++---- swad_game.c | 4 +--- swad_icon.c | 15 ++++++++++++-- swad_icon.h | 2 ++ swad_match.c | 15 +++++++------- swad_match_result.c | 30 +++++++++++++-------------- swad_project.c | 4 ++-- swad_test.c | 24 ++++++++++------------ swad_test_result.c | 4 ++-- swad_test_visibility.c | 9 +++++---- swad_test_visibility.h | 2 +- swad_text.c | 46 +++++++++++++++++++++--------------------- 16 files changed, 99 insertions(+), 81 deletions(-) create mode 100644 icon/eye-green.svg create mode 100644 icon/eye-slash-red.svg diff --git a/icon/eye-green.svg b/icon/eye-green.svg new file mode 100644 index 00000000..13d71c4b --- /dev/null +++ b/icon/eye-green.svg @@ -0,0 +1 @@ + diff --git a/icon/eye-slash-red.svg b/icon/eye-slash-red.svg new file mode 100644 index 00000000..aff530bb --- /dev/null +++ b/icon/eye-slash-red.svg @@ -0,0 +1 @@ + diff --git a/swad_agenda.c b/swad_agenda.c index 6f6ae1df..2de0a735 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -258,8 +258,8 @@ static void Agd_ShowFormToSelHiddenVisiblEvents (void) Agd_HiddenVisiblEvents_t HidVis; static const char *Icon[2] = { - [Agd_HIDDEN_EVENTS] = "eye-slash.svg", - [Agd_VISIBL_EVENTS] = "eye.svg", + [Agd_HIDDEN_EVENTS] = "eye-slash-red.svg", + [Agd_VISIBL_EVENTS] = "eye-green.svg", }; Set_StartOneSettingSelector (); diff --git a/swad_changelog.h b/swad_changelog.h index 71f62c70..4329d86f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.126 (2020-02-18)" +#define Log_PLATFORM_VERSION "SWAD 19.127.1 (2020-02-19)" #define CSS_FILE "swad19.118.css" #define JS_FILE "swad19.91.1.js" /* @@ -521,6 +521,13 @@ Param // TODO: Add visibility to API function getTestConfig // TODO: Get visibility IN API function getGames // TODO: Sugerencia de Jesús González Peñalver: añadir un poco más de espacio entre pregunta y pregunta en las opciones de un juego +// TODO: Remove Txt_Result + + Version 19.127.1: Feb 18, 2020 Changes in match results. + Changes in icon. (279116 lines) + Copy the following icons to icon public directory: +sudo cp -a icon/eye-green.svg /var/www/html/swad/icon/ +sudo cp -a icon/eye-slash-red.svg /var/www/html/swad/icon/ Version 19.127: Feb 18, 2020 Form to define visibility of match results in games. (279103 lines) 2 changes necessary in database: @@ -554,7 +561,7 @@ UPDATE tst_config SET Visibility=0x1f WHERE Feedback='full_feedback'; Version 19.122.2: Feb 13, 2020 Increased quality in images. (278698 lines) Version 19.122.1: Feb 07, 2020 Fixed bug removing test tags, reported by Mancia Anguita López. (278692 lines) Version 19.122: Jan 30, 2020 Some options changed in system tab. (278690 lines) -Copy the following icons to icon public directory: + Copy the following icons to icon public directory: sudo cp -a icon/bolt.svg /var/www/html/swad/icon/ sudo cp -a icon/iconset/awesome/tools.svg /var/www/html/swad/icon/iconset/awesome/ sudo cp -a icon/iconset/nuvola/tools.svg /var/www/html/swad/icon/iconset/nuvola/ diff --git a/swad_forum.c b/swad_forum.c index 77abb18c..4e3d195c 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1234,8 +1234,8 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod, Gbl.Forum.ForumSelected.Location, Gbl.Forum.ForumSelected.ThrCod, PstCod); - Ico_PutIconLink (Enabled ? "eye.svg" : - "eye-slash.svg", + Ico_PutIconLink (Enabled ? "eye-green.svg" : + "eye-slash-red.svg", Str_BuildStringLong (Enabled ? Txt_FORUM_Post_X_allowed_Click_to_ban_it : Txt_FORUM_Post_X_banned_Click_to_unban_it, (long) PstNum)); @@ -1244,8 +1244,8 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod, } else { - Ico_PutIcon (Enabled ? "eye.svg" : - "eye-slash.svg", + Ico_PutIcon (Enabled ? "eye-green.svg" : + "eye-slash-red.svg", Str_BuildStringLong (Enabled ? Txt_FORUM_Post_X_allowed : Txt_FORUM_Post_X_banned, (long) PstNum), diff --git a/swad_game.c b/swad_game.c index ea09f44a..2bfa4967 100644 --- a/swad_game.c +++ b/swad_game.c @@ -528,9 +528,7 @@ static void Gam_ShowOneGame (struct Game *Game,bool ShowOnlyThisGame) HTM_BR (); HTM_TxtColonNBSP (Txt_Result_visibility); HTM_BR (); - TsV_ShowVisibility (Game->Visibility, - Game->Hidden ? "ASG_GRP_LIGHT" : - "ASG_GRP"); + TsV_ShowVisibility (Game->Visibility); } HTM_DIV_End (); diff --git a/swad_icon.c b/swad_icon.c index 96972d79..83474dea 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -276,7 +276,7 @@ void Ico_PutContextualIconToHide (Act_Action_t NextAction,const char *Anchor,voi extern const char *Txt_Hide; Lay_PutContextualLinkOnlyIcon (NextAction,Anchor,FuncParams, - "eye.svg", + "eye-green.svg", Txt_Hide); } @@ -285,7 +285,7 @@ void Ico_PutContextualIconToUnhide (Act_Action_t NextAction,const char *Anchor,v extern const char *Txt_Show; Lay_PutContextualLinkOnlyIcon (NextAction,Anchor,FuncParams, - "eye-slash.svg", + "eye-slash-red.svg", Txt_Show); } @@ -510,3 +510,14 @@ void Ico_PutIconPaste (void) Ico_PutIconLink ("paste.svg",Txt_Paste); } + +/*****************************************************************************/ +/************* Put icon indicating that a content is not visible *************/ +/*****************************************************************************/ + +void Ico_PutIconNotVisible (void) + { + extern const char *Txt_Not_visible; + + Ico_PutIconOff ("eye-slash-red.svg",Txt_Not_visible); + } diff --git a/swad_icon.h b/swad_icon.h index 2438c9d7..db26c23b 100644 --- a/swad_icon.h +++ b/swad_icon.h @@ -90,4 +90,6 @@ void Ico_PutIconRemove (void); void Ico_PutIconCut (void); void Ico_PutIconPaste (void); +void Ico_PutIconNotVisible (void); + #endif diff --git a/swad_match.c b/swad_match.c index 07b772a7..06094253 100644 --- a/swad_match.c +++ b/swad_match.c @@ -481,7 +481,7 @@ static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches) extern const char *Txt_Match; extern const char *Txt_Players; extern const char *Txt_Status; - extern const char *Txt_Result; + extern const char *Txt_Results; /***** Start row *****/ HTM_TR_Begin (NULL); @@ -497,7 +497,7 @@ static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches) HTM_TH (1,1,"LT",Txt_Match); HTM_TH (1,1,"RT",Txt_Players); HTM_TH (1,1,"CT",Txt_Status); - HTM_TH (1,1,"CT",Txt_Result); + HTM_TH (1,1,"CT",Txt_Results); /***** End row *****/ HTM_TR_End (); @@ -768,7 +768,6 @@ static void Mch_ListOneOrMoreMatchesResult (const struct Match *Match) static void Mch_ListOneOrMoreMatchesResultStd (const struct Match *Match) { - extern const char *Txt_Hidden_results; extern const char *Txt_Results; /***** Is match result visible or hidden? *****/ @@ -784,7 +783,7 @@ static void Mch_ListOneOrMoreMatchesResultStd (const struct Match *Match) } else /* Result is forbidden to me */ - Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results); + Ico_PutIconNotVisible (); } static void Mch_ListOneOrMoreMatchesResultTch (const struct Match *Match) @@ -808,15 +807,15 @@ static void Mch_ListOneOrMoreMatchesResultTch (const struct Match *Match) /* I can edit visibility */ Lay_PutContextualLinkOnlyIcon (ActChgVisResMchUsr,NULL, Mch_PutParamsEdit, - Match->Status.ShowUsrResults ? "eye.svg" : - "eye-slash.svg", + Match->Status.ShowUsrResults ? "eye-green.svg" : + "eye-slash-red.svg", Match->Status.ShowUsrResults ? Txt_Visible_results : Txt_Hidden_results); } else /* I can not edit visibility */ - Ico_PutIconOff (Match->Status.ShowUsrResults ? "eye.svg" : - "eye-slash.svg", + Ico_PutIconOff (Match->Status.ShowUsrResults ? "eye-green.svg" : + "eye-slash-red.svg", Match->Status.ShowUsrResults ? Txt_Visible_results : Txt_Hidden_results); } diff --git a/swad_match_result.c b/swad_match_result.c index 01732a5f..944ec917 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -662,7 +662,6 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, const char *GamesSelectedCommas) { extern const char *Txt_Match_result; - extern const char *Txt_Hidden_results; char *MchSubQuery; char *GamSubQuery; MYSQL_RES *mysql_res; @@ -807,7 +806,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, HTM_Txt (Match.Title); HTM_TD_End (); - if (ICanViewResult) + if (ICanViewScore) { /* Get number of questions (row[3]) */ if (sscanf (row[3],"%u",&NumQstsInThisResult) != 1) @@ -835,18 +834,18 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, /* Write number of questions */ HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd); - if (ICanViewResult) + if (ICanViewScore) HTM_Unsigned (NumQstsInThisResult); else - Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results); - HTM_TD_End (); + Ico_PutIconNotVisible (); + HTM_TD_End (); /* Write number of questions not blank */ HTM_TD_Begin ("class=\"DAT RT COLOR%u\"",Gbl.RowEvenOdd); - if (ICanViewResult) + if (ICanViewScore) HTM_Unsigned (NumQstsNotBlankInThisResult); else - Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results); + Ico_PutIconNotVisible (); HTM_TD_End (); /* Write score */ @@ -854,7 +853,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, if (ICanViewScore) HTM_Double2Decimals (ScoreInThisResult); else - Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results); + Ico_PutIconNotVisible (); HTM_TD_End (); /* Write average score per question */ @@ -864,7 +863,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, (double) NumQstsInThisResult : 0.0); else - Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results); + Ico_PutIconNotVisible (); HTM_TD_End (); /* Write grade over maximum grade */ @@ -876,7 +875,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, TotalGrade += Grade; } else - Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results); + Ico_PutIconNotVisible (); HTM_TD_End (); /* Link to show this result */ @@ -901,7 +900,7 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther, Frm_EndForm (); } else - Ico_PutIconOff ("eye-slash.svg",Txt_Hidden_results); + Ico_PutIconNotVisible (); HTM_TD_End (); HTM_TR_End (); @@ -965,8 +964,9 @@ static void McR_ShowMchResultsSummaryRow (unsigned NumResults, /***** Write average score per question *****/ HTM_TD_Begin ("class=\"DAT_N_LINE_TOP RM COLOR%u\"",Gbl.RowEvenOdd); - HTM_Double2Decimals (NumTotalQsts ? TotalScoreOfAllResults / (double) NumTotalQsts : - 0.0); + HTM_Double2Decimals (NumTotalQsts ? TotalScoreOfAllResults / + (double) NumTotalQsts : + 0.0); HTM_TD_End (); /***** Write total grade *****/ @@ -1156,7 +1156,7 @@ void McR_ShowOneMchResult (void) if (ICanViewScore) HTM_Double2Decimals (TotalScore); else - HTM_Txt ("?"); // No feedback + Ico_PutIconNotVisible (); HTM_TD_End (); HTM_TR_End (); @@ -1172,7 +1172,7 @@ void McR_ShowOneMchResult (void) if (ICanViewScore) Tst_ComputeAndShowGrade (NumQsts,TotalScore,Game.MaxGrade); else - HTM_Txt ("?"); // Not visible + Ico_PutIconNotVisible (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_project.c b/swad_project.c index 89092c24..d7e6ec3b 100644 --- a/swad_project.c +++ b/swad_project.c @@ -574,8 +574,8 @@ static void Prj_ShowFormToFilterByHidden (void) Prj_HiddenVisibl_t HidVis; static const char *HiddenVisiblIcon[Prj_NUM_HIDDEN_VISIBL] = { - [Prj_HIDDEN] = "eye-slash.svg", - [Prj_VISIBL] = "eye.svg", + [Prj_HIDDEN] = "eye-slash-red.svg", + [Prj_VISIBL] = "eye-green.svg", }; Set_StartOneSettingSelector (); diff --git a/swad_test.c b/swad_test.c index d6943101..6680d899 100644 --- a/swad_test.c +++ b/swad_test.c @@ -1025,7 +1025,6 @@ void Tst_WriteQstAndAnsTest (Tst_ActionToDoWithQuestions_t ActionToDoWithQuestio void Tst_WriteQstStem (const char *Stem,const char *ClassStem,bool Visible) { - extern const char *Txt_Question_not_visible; unsigned long StemLength; char *StemRigorousHTML; @@ -1051,7 +1050,7 @@ void Tst_WriteQstStem (const char *Stem,const char *ClassStem,bool Visible) free (StemRigorousHTML); } else - HTM_Txt (Txt_Question_not_visible); + Ico_PutIconNotVisible (); /***** DIV end *****/ HTM_DIV_End (); @@ -1674,8 +1673,8 @@ static void Tst_ShowFormSelTags (unsigned long NumRows,MYSQL_RES *mysql_res, { TagHidden = (row[2][0] == 'Y'); HTM_TD_Begin ("class=\"LM\""); - Ico_PutIconOff (TagHidden ? "eye-slash.svg" : - "eye.svg", + Ico_PutIconOff (TagHidden ? "eye-slash-red.svg" : + "eye-green.svg", TagHidden ? Txt_Tag_not_allowed : Txt_Tag_allowed); HTM_TD_End (); @@ -1791,7 +1790,7 @@ static void Tst_PutIconEnable (long TagCod,const char *TagTxt) HTM_TD_Begin ("class=\"BM\""); Frm_StartForm (ActEnableTag); Par_PutHiddenParamLong (NULL,"TagCod",TagCod); - Ico_PutIconLink ("eye-slash.svg", + Ico_PutIconLink ("eye-slash-red.svg", Str_BuildStringStr (Txt_Tag_X_not_allowed_Click_to_allow_it, TagTxt)); Str_FreeString (); @@ -1810,7 +1809,7 @@ static void Tst_PutIconDisable (long TagCod,const char *TagTxt) HTM_TD_Begin ("class=\"BM\""); Frm_StartForm (ActDisableTag); Par_PutHiddenParamLong (NULL,"TagCod",TagCod); - Ico_PutIconLink ("eye.svg", + Ico_PutIconLink ("eye-green.svg", Str_BuildStringStr (Txt_Tag_X_allowed_Click_to_disable_it, TagTxt)); Str_FreeString (); @@ -3546,7 +3545,7 @@ static void Tst_WriteTFAnsAssessTest (struct UsrData *UsrDat, TsV_IsVisibleCorrectAns (Visibility)) Tst_WriteAnsTF (row[1][0]); else - HTM_Txt ("?"); + Ico_PutIconNotVisible (); HTM_TD_End (); HTM_TR_End (); @@ -3702,7 +3701,6 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat, { extern const char *Txt_TST_Answer_given_by_the_user; extern const char *Txt_TST_Answer_given_by_the_teachers; - extern const char *Txt_Question_not_visible; unsigned NumOpt; unsigned Indexes[Tst_MAX_OPTIONS_PER_QUESTION]; // Indexes of all answers of this question bool AnswersUsr[Tst_MAX_OPTIONS_PER_QUESTION]; @@ -3785,7 +3783,7 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat, else { HTM_TD_Begin ("class=\"ANS_0 CT\""); - HTM_Txt ("?"); + Ico_PutIconNotVisible (); HTM_TD_End (); } @@ -3806,7 +3804,7 @@ static void Tst_WriteChoiceAnsAssessTest (struct UsrData *UsrDat, "TEST_MED_SHOW"); } else - HTM_Txt (Txt_Question_not_visible); + Ico_PutIconNotVisible (); HTM_DIV_End (); if (TsV_IsVisibleCorrectAns (Visibility)) @@ -4320,7 +4318,7 @@ static void Tst_WriteTextAnsAssessTest (struct UsrData *UsrDat, else { HTM_TD_Begin ("class=\"ANS_0 CT\""); - HTM_Txt ("?"); + Ico_PutIconNotVisible (); HTM_TD_End (); } HTM_TR_End (); @@ -4447,7 +4445,7 @@ static void Tst_WriteIntAnsAssessTest (struct UsrData *UsrDat, TsV_IsVisibleCorrectAns (Visibility)) HTM_Long (IntAnswerCorr); else - HTM_Txt ("?"); + Ico_PutIconNotVisible (); HTM_TD_End (); HTM_TR_End (); @@ -4593,7 +4591,7 @@ static void Tst_WriteFloatAnsAssessTest (struct UsrData *UsrDat, HTM_Txt ("]"); } else - HTM_Txt ("?"); + Ico_PutIconNotVisible (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_test_result.c b/swad_test_result.c index 477af21c..b557e625 100644 --- a/swad_test_result.c +++ b/swad_test_result.c @@ -740,7 +740,7 @@ void TsR_ShowOneTstResult (void) if (ICanViewScore) HTM_Double2Decimals (TotalScore); else - HTM_Txt ("?"); // No feedback + Ico_PutIconNotVisible (); HTM_TD_End (); /* Grade */ @@ -754,7 +754,7 @@ void TsR_ShowOneTstResult (void) if (ICanViewScore) Tst_ComputeAndShowGrade (Gbl.Test.NumQsts,TotalScore,TsR_SCORE_MAX); else - HTM_Txt ("?"); // No feedback + Ico_PutIconNotVisible (); HTM_TD_End (); HTM_TR_End (); diff --git a/swad_test_visibility.c b/swad_test_visibility.c index c6536367..58b9f7fd 100644 --- a/swad_test_visibility.c +++ b/swad_test_visibility.c @@ -59,7 +59,7 @@ extern struct Globals Gbl; /************ Put checkboxes in form to select result visibility *************/ /*****************************************************************************/ -void TsV_ShowVisibility (unsigned SelectedVisibility,const char *Class) +void TsV_ShowVisibility (unsigned SelectedVisibility) { extern const char *Txt_Visible; extern const char *Txt_Hidden; @@ -71,10 +71,11 @@ void TsV_ShowVisibility (unsigned SelectedVisibility,const char *Class) Visibility <= (TsV_Visibility_t) (TsV_NUM_ITEMS_VISIBILITY - 1); Visibility++) { - HTM_LABEL_Begin ("class=\"%s\"",Class); ItemVisible = (SelectedVisibility & (1 << Visibility)) != 0; - Ico_PutIconOff (ItemVisible ? "eye.svg" : - "eye-slash.svg", + HTM_LABEL_Begin ("class=\"%s\"",ItemVisible ? "DAT_SMALL_GREEN" : + "DAT_SMALL_RED"); + Ico_PutIconOff (ItemVisible ? "eye-green.svg" : + "eye-slash-red.svg", ItemVisible ? Txt_Visible : Txt_Hidden); HTM_Txt (Txt_TST_STR_VISIBILITY[Visibility]); diff --git a/swad_test_visibility.h b/swad_test_visibility.h index fd84e146..f7177d24 100644 --- a/swad_test_visibility.h +++ b/swad_test_visibility.h @@ -54,7 +54,7 @@ typedef enum /***************************** Public prototypes *****************************/ /*****************************************************************************/ -void TsV_ShowVisibility (unsigned SelectedVisibility,const char *Class); +void TsV_ShowVisibility (unsigned SelectedVisibility); void TsV_PutVisibilityCheckboxes (unsigned SelectedVisibility); unsigned TsV_GetVisibilityFromForm (void); unsigned TsV_GetVisibilityFromStr (const char *Str); diff --git a/swad_text.c b/swad_text.c index 0c8ec432..29800430 100644 --- a/swad_text.c +++ b/swad_text.c @@ -26574,6 +26574,27 @@ const char *Txt_Not_duplicated = "Não duplicado"; #endif +const char *Txt_Not_visible = +#if L==1 // ca + "No visible"; +#elif L==2 // de + "Nicht sichtbar"; +#elif L==3 // en + "Not visible"; +#elif L==4 // es + "No visible"; +#elif L==5 // fr + "Non visible"; +#elif L==6 // gn + "No visible"; // Okoteve traducción +#elif L==7 // it + "Non visibile"; +#elif L==8 // pl + "Niewidoczne"; +#elif L==9 // pt + "Não visível"; +#endif + const char *Txt_Nothing_has_been_pasted_because_the_clipboard_is_empty_ = #if L==1 // ca "No se pegado nada porque el portapapeles está vacío." @@ -31739,27 +31760,6 @@ const char *Txt_Question_modified = "Questão modificada."; #endif -const char *Txt_Question_not_visible = -#if L==1 // ca - "Pregunta no visible"; -#elif L==2 // de - "Frage nicht sichtbar"; -#elif L==3 // en - "Question not visible"; -#elif L==4 // es - "Pregunta no visible"; -#elif L==5 // fr - "Question non visible"; -#elif L==6 // gn - "Pregunta no visible"; // Okoteve traducción -#elif L==7 // it - "Domanda non visibile"; -#elif L==8 // pl - "Pytanie niewidoczne"; -#elif L==9 // pt - "Pergunta não visível"; -#endif - const char *Txt_Question_removed = #if L==1 // ca "Pregunta eliminada."; @@ -33712,7 +33712,7 @@ const char *Txt_Reset_survey = #elif L==9 // pt "Reiniciar inquérito"; #endif - +/* const char *Txt_Result = #if L==1 // ca "Resultat"; @@ -33733,7 +33733,7 @@ const char *Txt_Result = #elif L==9 // pt "Resultado"; #endif - +*/ const char *Txt_Results = #if L==1 // ca "Resultats";