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,"