From 8d53450993b101092f573a684f2352cc06fa44af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 18 Sep 2019 23:49:07 +0200 Subject: [PATCH] Version19.7.1 --- swad_action.c | 4 +- swad_changelog.h | 5 ++- swad_game.c | 4 +- swad_match.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++- swad_match.h | 3 +- swad_test.c | 12 +++--- swad_test.h | 2 +- swad_text.c | 25 +++++++++++- 8 files changed, 142 insertions(+), 17 deletions(-) diff --git a/swad_action.c b/swad_action.c index c313a94b2..58aa643e2 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2152,7 +2152,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqSeeMyTstRes */{1083,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelDatesToSeeMyTestResults ,NULL}, /* ActSeeMyTstRes */{1084,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowMyTestResults ,NULL}, /* ActSeeOneTstResMe */{1085,-1,TabUnk,ActReqTst ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTestResult ,NULL}, - /* ActReqSeeUsrTstRes*/{1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelUsrsToSeeUsrsTestResults,NULL}, + /* ActReqSeeUsrTstRes*/{1080,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelUsrsToViewUsrsTstResults,NULL}, /* ActSeeUsrTstRes */{1081,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowUsrsTestResults ,NULL}, /* ActSeeOneTstResOth*/{1082,-1,TabUnk,ActReqTst ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTestResult ,NULL}, @@ -2178,7 +2178,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqSeeMyMchRes */{1795,-1,TabUnk,ActSeeAllGam ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelDatesToSeeMyTestResults ,NULL}, /* ActSeeMyMchRes */{1796,-1,TabUnk,ActSeeAllGam ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowMyTestResults ,NULL}, /* ActSeeOneMchResMe */{1797,-1,TabUnk,ActSeeAllGam ,0x208,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTestResult ,NULL}, - /* ActReqSeeUsrMchRes*/{1798,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Tst_SelUsrsToSeeUsrsTestResults,NULL}, + /* ActReqSeeUsrMchRes*/{1798,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Mch_SelUsrsToViewUsrsMchResults,NULL}, /* ActSeeUsrMchRes */{1799,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowUsrsTestResults ,NULL}, /* ActSeeOneMchResOth*/{1800,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Tst_ShowOneTestResult ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index 001361361..131bc767c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -462,11 +462,12 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.7 (2019-09-18)" +#define Log_PLATFORM_VERSION "SWAD 19.7.1 (2019-09-18)" #define CSS_FILE "swad19.3.css" #define JS_FILE "swad18.130.2.js" /* - Version 19.7: Sep 17, 2019 New actions to see the matches results. (244664 lines) + Version 19.7.1: Sep 17, 2019 Users' selection to view the matches results. (244768 lines) + Version 19.7: Sep 17, 2019 New actions to view the matches results. (244664 lines) 6 changes necessary in database: INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1795','es','N','Seleccionar fechas para mis result. partidas'); INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1796','es','N','Ver mis resultados de partidas'); diff --git a/swad_game.c b/swad_game.c index d678eaeee..d3c2817e5 100644 --- a/swad_game.c +++ b/swad_game.c @@ -160,12 +160,12 @@ static void Gam_ListAllGames (void) switch (Gbl.Usrs.Me.Role.Logged) { case Rol_STD: - Mch_PutFormToViewResultsOfMatches (ActReqSeeMyMchRes); + Mch_PutFormToViewMchResults (ActReqSeeMyMchRes); break; case Rol_NET: case Rol_TCH: case Rol_SYS_ADM: - Mch_PutFormToViewResultsOfMatches (ActReqSeeUsrMchRes); + Mch_PutFormToViewMchResults (ActReqSeeUsrMchRes); break; default: break; diff --git a/swad_match.c b/swad_match.c index 44d9b865e..0d5364679 100644 --- a/swad_match.c +++ b/swad_match.c @@ -2442,7 +2442,7 @@ static void Mch_DrawBarNumUsrs (unsigned NumAnswerersAns,unsigned NumAnswerersQs /****************** Write a form to go to result of matches ******************/ /*****************************************************************************/ -void Mch_PutFormToViewResultsOfMatches (Act_Action_t Action) +void Mch_PutFormToViewMchResults (Act_Action_t Action) { extern const char *Txt_Results; @@ -2452,3 +2452,105 @@ void Mch_PutFormToViewResultsOfMatches (Act_Action_t Action) Txt_Results); fprintf (Gbl.F.Out,""); } + +/*****************************************************************************/ +/*********** Select users and dates to show their matches results ************/ +/*****************************************************************************/ + +void Mch_SelUsrsToViewUsrsMchResults (void) + { + extern const char *Hlp_ASSESSMENT_Tests_results; // TODO: Change to matches results + extern const char *The_ClassFormInBox[The_NUM_THEMES]; + extern const char *Txt_Results; + extern const char *Txt_Users; + extern const char *Txt_View_matches_results; + unsigned NumTotalUsrs; + + /***** Get and update type of list, + number of columns in class photo + and preference about viewing photos *****/ + Usr_GetAndUpdatePrefsAboutUsrList (); + + /***** Get groups to show ******/ + Grp_GetParCodsSeveralGrpsToShowUsrs (); + + /***** Get and order lists of users from this course *****/ + Usr_GetListUsrs (Hie_CRS,Rol_STD); + Usr_GetListUsrs (Hie_CRS,Rol_NET); + Usr_GetListUsrs (Hie_CRS,Rol_TCH); + NumTotalUsrs = Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs + + Gbl.Usrs.LstUsrs[Rol_NET].NumUsrs + + Gbl.Usrs.LstUsrs[Rol_TCH].NumUsrs; + + /***** Start box *****/ + Box_StartBox (NULL,Txt_Results,NULL, + Hlp_ASSESSMENT_Tests_results,Box_NOT_CLOSABLE); + + /***** Show form to select the groups *****/ + Grp_ShowFormToSelectSeveralGroups (NULL, + Grp_ONLY_MY_GROUPS); + + /***** Start section with user list *****/ + Lay_StartSection (Usr_USER_LIST_SECTION_ID); + + if (NumTotalUsrs) + { + if (Usr_GetIfShowBigList (NumTotalUsrs,NULL,NULL)) + { + /***** Form to select type of list used for select several users *****/ + Usr_ShowFormsToSelectUsrListType (NULL); + + /***** Start form *****/ + Frm_StartForm (ActSeeUsrMchRes); + Grp_PutParamsCodGrps (); + + /***** Put list of users to select some of them *****/ + Tbl_StartTableCenter (2); + fprintf (Gbl.F.Out,"" + "" + "%s:" + "" + "", + The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users, + The_ClassFormInBox[Gbl.Prefs.Theme]); + Tbl_StartTable (2); + Usr_ListUsersToSelect (Rol_TCH); + Usr_ListUsersToSelect (Rol_NET); + Usr_ListUsersToSelect (Rol_STD); + Tbl_EndTable (); + fprintf (Gbl.F.Out,"" + ""); + + /***** Starting and ending dates in the search *****/ + Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (false); + + Tbl_EndTable (); + + /***** Send button *****/ + Btn_PutConfirmButton (Txt_View_matches_results); + + /***** End form *****/ + Frm_EndForm (); + } + } + else // NumTotalUsrs == 0 + /***** Show warning indicating no students found *****/ + Usr_ShowWarningNoUsersFound (Rol_UNK); + + /***** End section with user list *****/ + Lay_EndSection (); + + /***** End box *****/ + Box_EndBox (); + + /***** Free memory for users' list *****/ + Usr_FreeUsrsList (Rol_TCH); + Usr_FreeUsrsList (Rol_NET); + Usr_FreeUsrsList (Rol_STD); + + /***** Free memory used by list of selected users' codes *****/ + Usr_FreeListsSelectedUsrsCods (); + + /***** Free memory for list of selected groups *****/ + Grp_FreeListCodSelectedGrps (); + } diff --git a/swad_match.h b/swad_match.h index 87d075ea8..36a7323e0 100644 --- a/swad_match.h +++ b/swad_match.h @@ -67,6 +67,7 @@ void Mch_GetAndDrawBarNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsig unsigned NumAnswerersQst,bool Correct); unsigned Mch_GetNumUsrsWhoHaveAnswerQst (long MchCod,unsigned QstInd); -void Mch_PutFormToViewResultsOfMatches (Act_Action_t Action); +void Mch_PutFormToViewMchResults (Act_Action_t Action); +void Mch_SelUsrsToViewUsrsMchResults (void); #endif diff --git a/swad_test.c b/swad_test.c index d338393fe..393547fc3 100644 --- a/swad_test.c +++ b/swad_test.c @@ -146,7 +146,7 @@ extern struct Globals Gbl; /***************************** Internal prototypes ***************************/ /*****************************************************************************/ -static void Tst_PutFormToViewResultsOfUsersTests (Act_Action_t Action); +static void Tst_PutFormToViewTstResults (Act_Action_t Action); static void Tst_GetQuestionsAndAnswersFromForm (void); static void Tst_ShowTstTotalMark (double TotalScore); @@ -327,12 +327,12 @@ void Tst_ShowFormAskTst (void) switch (Gbl.Usrs.Me.Role.Logged) { case Rol_STD: - Tst_PutFormToViewResultsOfUsersTests (ActReqSeeMyTstRes); + Tst_PutFormToViewTstResults (ActReqSeeMyTstRes); break; case Rol_NET: case Rol_TCH: case Rol_SYS_ADM: - Tst_PutFormToViewResultsOfUsersTests (ActReqSeeUsrTstRes); + Tst_PutFormToViewTstResults (ActReqSeeUsrTstRes); break; default: break; @@ -407,7 +407,7 @@ void Tst_ShowFormAskTst (void) /*************** Write a form to go to result of users' tests ****************/ /*****************************************************************************/ -static void Tst_PutFormToViewResultsOfUsersTests (Act_Action_t Action) +static void Tst_PutFormToViewTstResults (Act_Action_t Action) { extern const char *Txt_Results; @@ -7316,7 +7316,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Hie_Level_t Scope,Ts /************ Select users and dates to show their test results **************/ /*****************************************************************************/ -void Tst_SelUsrsToSeeUsrsTestResults (void) +void Tst_SelUsrsToViewUsrsTstResults (void) { extern const char *Hlp_ASSESSMENT_Tests_results; extern const char *The_ClassFormInBox[The_NUM_THEMES]; @@ -7525,7 +7525,7 @@ void Tst_ShowUsrsTestResults (void) // ...write warning alert Ale_ShowAlert (Ale_WARNING,Txt_You_must_select_one_ore_more_users); // ...and show again the form - Tst_SelUsrsToSeeUsrsTestResults (); + Tst_SelUsrsToViewUsrsTstResults (); } /***** Free memory used by list of selected users' codes *****/ diff --git a/swad_test.h b/swad_test.h index a8888181b..ef619801b 100644 --- a/swad_test.h +++ b/swad_test.h @@ -195,7 +195,7 @@ void Tst_FreeTagsList (void); void Tst_GetTestStats (Tst_AnswerType_t AnsType,struct Tst_Stats *Stats); -void Tst_SelUsrsToSeeUsrsTestResults (void); +void Tst_SelUsrsToViewUsrsTstResults (void); void Tst_SelDatesToSeeMyTestResults (void); void Tst_ShowUsrsTestResults (void); void Tst_ShowMyTestResults (void); diff --git a/swad_text.c b/swad_text.c index efbbc2176..28006f84f 100644 --- a/swad_text.c +++ b/swad_text.c @@ -52682,6 +52682,27 @@ const char *Txt_View_in_a_new_window = "Ver em uma nova janela"; #endif +const char *Txt_View_matches_results = +#if L==1 // ca + "Veure resultats de partides"; +#elif L==2 // de + "Siehe Spielergebnisse"; +#elif L==3 // en + "View matches results"; +#elif L==4 // es + "Ver resultados de partidas"; +#elif L==5 // fr + "Voir résultats de matchs"; +#elif L==6 // gn + "Ver resultados de partidas"; // Okoteve traducción +#elif L==7 // it + "Vedi risultati delle partite"; +#elif L==8 // pl + "Zobacz wyniki mecze"; +#elif L==9 // pt + "Ver resultados de partidas"; +#endif + const char *Txt_View_record_and_office_hours = #if L==1 // ca "Veure fitxa i horari de tutories"; @@ -52837,11 +52858,11 @@ const char *Txt_View_test_results = #elif L==3 // en "View test results"; #elif L==4 // es - "Ver resultados de los test"; + "Ver resultados de test"; #elif L==5 // fr "Voir résultats de tests"; #elif L==6 // gn - "Ver resultados de los test"; // Okoteve traducción + "Ver resultados de test"; // Okoteve traducción #elif L==7 // it "Vedi risultati dei test"; #elif L==8 // pl