From 0d2261a511800f68906a42e89e77af9a91c1cdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 10 Sep 2019 11:06:31 +0200 Subject: [PATCH] Version18.142.1 --- swad_action.c | 21 ++++---- swad_action.h | 109 ++++++++++++++++++------------------- swad_changelog.h | 3 +- swad_game.c | 137 ++++++++++++++++++++++++++++++----------------- swad_game.h | 6 ++- swad_layout.c | 14 ++--- 6 files changed, 169 insertions(+), 121 deletions(-) diff --git a/swad_action.c b/swad_action.c index 47abe7a69..de558e584 100644 --- a/swad_action.c +++ b/swad_action.c @@ -611,11 +611,12 @@ Assessment: 455. ActReqNewMchTch Put form to create a new match (by a teacher) 456. ActNewMchTch Create a new match showing first question in a new browser tab (by a teacher) NEW. ActResMchTch Resume an unfinished match showing current question in a new browser tab (by a teacher) - NEW. ActPrvMchTch Show previous question when playing a match (by a teacher) NEW. ActPauMchTch Pause current match (by a teacher) NEW. ActPlyMchTch Play/resume current match (by a teacher) - NEW. ActSteMchTch Show current question when playing a match (by a teacher) - 457. ActNxtMchTch Show next question when playing a match (by a teacher) + NEW. ActShoSteMchTch Show stem of current question, hiding answers, when playing a match (by a teacher) + NEW. ActShoAnsMchTch Show full current question, including answers, when playing a match (by a teacher) + NEW. ActPrvQstMchTch Show previous question when playing a match (by a teacher) + 457. ActNxtQstMchTch Show next question when playing a match (by a teacher) NEW. ActRefMchTch Refresh current question when playing a match (as teacher) NEW. ActShoMchTch Show finished match results @@ -2155,11 +2156,12 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqNewMchTch */{1670,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_RequestNewMatchTch ,NULL}, /* ActNewMchTch */{1671,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,Gam_CreateNewMatchTch ,Gam_RequestStartResumeMatchTch ,NULL}, /* ActResMchTch */{1785,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,Gam_GetMatchBeingPlayed ,Gam_RequestStartResumeMatchTch ,NULL}, - /* ActPrvMchTch */{1790,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_PrevStatusMatchTch ,NULL}, /* ActPauMchTch */{1791,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_PauseMatchTch ,NULL}, /* ActPlyMchTch */{1789,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_ResumeMatchTch ,NULL}, - /* ActSteMchTch */{1792,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_PrevStatusMatchTch ,NULL}, - /* ActNxtMchTch */{1672,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_NextStatusMatchTch ,NULL}, + /* ActShoSteMchTch */{1792,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_ShowStemQstMatchTch ,NULL}, + /* ActShoAnsMchTch */{1793,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_ShowAnssQstMatchTch ,NULL}, + /* ActPrvQstMchTch */{1790,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_PrevQstMatchTch ,NULL}, + /* ActNxtQstMchTch */{1672,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_NextQstMatchTch ,NULL}, /* ActRefMchTch */{1788,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_AJAX_RFRESH,Gam_GetMatchBeingPlayed ,Gam_RefreshMatchTch ,NULL}, /* ActShoMchTch */{1786,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_ShowFinishedMatchResults ,NULL}, @@ -4889,7 +4891,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActDwnGamQst, // #1669 ActReqNewMchTch, // #1670 ActNewMchTch, // #1671 - ActNxtMchTch, // #1672 + ActNxtQstMchTch, // #1672 -1, // #1673 (obsolete action) ActSeePrj, // #1674 ActFrmNewPrj, // #1675 @@ -5007,9 +5009,10 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActCreMyAcc, // #1787 ActRefMchTch, // #1788 ActPlyMchTch, // #1789 - ActPrvMchTch, // #1790 + ActPrvQstMchTch, // #1790 ActPauMchTch, // #1791 - ActSteMchTch, // #1792 + ActShoSteMchTch, // #1792 + ActShoAnsMchTch, // #1793 }; /*****************************************************************************/ diff --git a/swad_action.h b/swad_action.h index 49b93534b..8929c1e1b 100644 --- a/swad_action.h +++ b/swad_action.h @@ -64,9 +64,9 @@ typedef enum typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1 + 4 + 64 + 38 + 12 + 42 + 36 + 19 + 110 + 173 + 437 + 176 + 169 + 16 + 68) +#define Act_NUM_ACTIONS (1 + 4 + 64 + 38 + 12 + 42 + 36 + 19 + 110 + 174 + 437 + 176 + 169 + 16 + 68) -#define Act_MAX_ACTION_COD 1792 +#define Act_MAX_ACTION_COD 1793 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13 @@ -612,60 +612,61 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to #define ActReqNewMchTch (ActChgCrsTT1stDay + 119) #define ActNewMchTch (ActChgCrsTT1stDay + 120) #define ActResMchTch (ActChgCrsTT1stDay + 121) -#define ActPrvMchTch (ActChgCrsTT1stDay + 122) -#define ActPauMchTch (ActChgCrsTT1stDay + 123) -#define ActPlyMchTch (ActChgCrsTT1stDay + 124) -#define ActSteMchTch (ActChgCrsTT1stDay + 125) -#define ActNxtMchTch (ActChgCrsTT1stDay + 126) -#define ActRefMchTch (ActChgCrsTT1stDay + 127) -#define ActShoMchTch (ActChgCrsTT1stDay + 128) -#define ActPlyMchStd (ActChgCrsTT1stDay + 129) -#define ActRefMchStd (ActChgCrsTT1stDay + 130) -#define ActAnsMchQstStd (ActChgCrsTT1stDay + 131) -#define ActFrmNewGam (ActChgCrsTT1stDay + 132) -#define ActEdiOneGam (ActChgCrsTT1stDay + 133) -#define ActNewGam (ActChgCrsTT1stDay + 134) -#define ActChgGam (ActChgCrsTT1stDay + 135) -#define ActReqRemGam (ActChgCrsTT1stDay + 136) -#define ActRemGam (ActChgCrsTT1stDay + 137) -#define ActReqRstGam (ActChgCrsTT1stDay + 138) -#define ActRstGam (ActChgCrsTT1stDay + 139) -#define ActHidGam (ActChgCrsTT1stDay + 140) -#define ActShoGam (ActChgCrsTT1stDay + 141) -#define ActAddOneGamQst (ActChgCrsTT1stDay + 142) -#define ActGamLstTstQst (ActChgCrsTT1stDay + 143) -#define ActAddTstQstToGam (ActChgCrsTT1stDay + 144) -#define ActReqRemGamQst (ActChgCrsTT1stDay + 145) -#define ActRemGamQst (ActChgCrsTT1stDay + 146) -#define ActUp_GamQst (ActChgCrsTT1stDay + 147) -#define ActDwnGamQst (ActChgCrsTT1stDay + 148) +#define ActPauMchTch (ActChgCrsTT1stDay + 122) +#define ActPlyMchTch (ActChgCrsTT1stDay + 123) +#define ActShoSteMchTch (ActChgCrsTT1stDay + 124) +#define ActShoAnsMchTch (ActChgCrsTT1stDay + 125) +#define ActPrvQstMchTch (ActChgCrsTT1stDay + 126) +#define ActNxtQstMchTch (ActChgCrsTT1stDay + 127) +#define ActRefMchTch (ActChgCrsTT1stDay + 128) +#define ActShoMchTch (ActChgCrsTT1stDay + 129) +#define ActPlyMchStd (ActChgCrsTT1stDay + 130) +#define ActRefMchStd (ActChgCrsTT1stDay + 131) +#define ActAnsMchQstStd (ActChgCrsTT1stDay + 132) +#define ActFrmNewGam (ActChgCrsTT1stDay + 133) +#define ActEdiOneGam (ActChgCrsTT1stDay + 134) +#define ActNewGam (ActChgCrsTT1stDay + 135) +#define ActChgGam (ActChgCrsTT1stDay + 136) +#define ActReqRemGam (ActChgCrsTT1stDay + 137) +#define ActRemGam (ActChgCrsTT1stDay + 138) +#define ActReqRstGam (ActChgCrsTT1stDay + 139) +#define ActRstGam (ActChgCrsTT1stDay + 140) +#define ActHidGam (ActChgCrsTT1stDay + 141) +#define ActShoGam (ActChgCrsTT1stDay + 142) +#define ActAddOneGamQst (ActChgCrsTT1stDay + 143) +#define ActGamLstTstQst (ActChgCrsTT1stDay + 144) +#define ActAddTstQstToGam (ActChgCrsTT1stDay + 145) +#define ActReqRemGamQst (ActChgCrsTT1stDay + 146) +#define ActRemGamQst (ActChgCrsTT1stDay + 147) +#define ActUp_GamQst (ActChgCrsTT1stDay + 148) +#define ActDwnGamQst (ActChgCrsTT1stDay + 149) -#define ActSeeSvy (ActChgCrsTT1stDay + 149) -#define ActAnsSvy (ActChgCrsTT1stDay + 150) -#define ActFrmNewSvy (ActChgCrsTT1stDay + 151) -#define ActEdiOneSvy (ActChgCrsTT1stDay + 152) -#define ActNewSvy (ActChgCrsTT1stDay + 153) -#define ActChgSvy (ActChgCrsTT1stDay + 154) -#define ActReqRemSvy (ActChgCrsTT1stDay + 155) -#define ActRemSvy (ActChgCrsTT1stDay + 156) -#define ActReqRstSvy (ActChgCrsTT1stDay + 157) -#define ActRstSvy (ActChgCrsTT1stDay + 158) -#define ActHidSvy (ActChgCrsTT1stDay + 159) -#define ActShoSvy (ActChgCrsTT1stDay + 160) -#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 161) -#define ActRcvSvyQst (ActChgCrsTT1stDay + 162) -#define ActReqRemSvyQst (ActChgCrsTT1stDay + 163) -#define ActRemSvyQst (ActChgCrsTT1stDay + 164) +#define ActSeeSvy (ActChgCrsTT1stDay + 150) +#define ActAnsSvy (ActChgCrsTT1stDay + 151) +#define ActFrmNewSvy (ActChgCrsTT1stDay + 152) +#define ActEdiOneSvy (ActChgCrsTT1stDay + 153) +#define ActNewSvy (ActChgCrsTT1stDay + 154) +#define ActChgSvy (ActChgCrsTT1stDay + 155) +#define ActReqRemSvy (ActChgCrsTT1stDay + 156) +#define ActRemSvy (ActChgCrsTT1stDay + 157) +#define ActReqRstSvy (ActChgCrsTT1stDay + 158) +#define ActRstSvy (ActChgCrsTT1stDay + 159) +#define ActHidSvy (ActChgCrsTT1stDay + 160) +#define ActShoSvy (ActChgCrsTT1stDay + 161) +#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 162) +#define ActRcvSvyQst (ActChgCrsTT1stDay + 163) +#define ActReqRemSvyQst (ActChgCrsTT1stDay + 164) +#define ActRemSvyQst (ActChgCrsTT1stDay + 165) -#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 165) -#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 166) -#define ActEdiExaAnn (ActChgCrsTT1stDay + 167) -#define ActRcvExaAnn (ActChgCrsTT1stDay + 168) -#define ActPrnExaAnn (ActChgCrsTT1stDay + 169) -#define ActReqRemExaAnn (ActChgCrsTT1stDay + 170) -#define ActRemExaAnn (ActChgCrsTT1stDay + 171) -#define ActHidExaAnn (ActChgCrsTT1stDay + 172) -#define ActShoExaAnn (ActChgCrsTT1stDay + 173) +#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 166) +#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 167) +#define ActEdiExaAnn (ActChgCrsTT1stDay + 168) +#define ActRcvExaAnn (ActChgCrsTT1stDay + 169) +#define ActPrnExaAnn (ActChgCrsTT1stDay + 170) +#define ActReqRemExaAnn (ActChgCrsTT1stDay + 171) +#define ActRemExaAnn (ActChgCrsTT1stDay + 172) +#define ActHidExaAnn (ActChgCrsTT1stDay + 173) +#define ActShoExaAnn (ActChgCrsTT1stDay + 174) /*****************************************************************************/ /******************************** Files tab **********************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 2e42f1806..90b61f187 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -460,10 +460,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.142 (2019-09-10)" +#define Log_PLATFORM_VERSION "SWAD 18.142.1 (2019-09-10)" #define CSS_FILE "swad18.138.css" #define JS_FILE "swad18.130.2.js" /* + Version 18.142.1: Sep 10, 2019 When a match is paused, backward/forward buttons go to previous/next question. (244383 lines) Version 18.142: Sep 10, 2019 New action to see the stem/hide the answers of a question when playing a match. (244345 lines) 2 changes necessary in database: UPDATE actions SET Txt='Comenzar/reanudar partida (como profesor)' WHERE ActCod='1789' AND Language='es'; diff --git a/swad_game.c b/swad_game.c index 41a2b6edc..2c638c797 100644 --- a/swad_game.c +++ b/swad_game.c @@ -89,13 +89,13 @@ const char *Gam_StrAnswerTypesDB[Gam_NUM_ANS_TYPES] = #define Gam_ICON_PLAY "fas fa-play" #define Gam_ICON_PAUSE "fas fa-pause" // #define Gam_ICON_STEM "fas fa-step-backward" -#define Gam_ICON_STEM "fas fa-file" +#define Gam_ICON_STEM "fas fa-angle-up" #define Gam_ICON_START "fas fa-step-backward" #define Gam_ICON_PREVIOUS "fas fa-step-backward" #define Gam_ICON_FINISH "fas fa-step-forward" #define Gam_ICON_NEXT "fas fa-step-forward" // #define Gam_ICON_ANSWERS "fas fa-step-forward" -#define Gam_ICON_ANSWERS "fas fa-file-alt" +#define Gam_ICON_ANSWERS "fas fa-angle-down" /*****************************************************************************/ /******************************* Private types *******************************/ @@ -3531,10 +3531,10 @@ void Gam_ResumeMatchTch (void) } /*****************************************************************************/ -/* Show previous match status (previous question, answers...) (by a teacher) */ +/** Show stem, hiding answers, of current question in a match (by a teacher) */ /*****************************************************************************/ -void Gam_PrevStatusMatchTch (void) +void Gam_ShowStemQstMatchTch (void) { struct Match Match; @@ -3547,15 +3547,63 @@ void Gam_PrevStatusMatchTch (void) Gam_GetDataOfMatchByCod (&Match); /***** Update status *****/ - if (Match.Status.QstInd >= Gam_AFTER_LAST_QUESTION) // Finished - Gam_SetMatchStatusToPrevQuestion (&Match); - else // Unfinished - { - if (Match.Status.ShowingAnswers) // Showing answers currently - Match.Status.ShowingAnswers = false; // Do not show answers - else - Gam_SetMatchStatusToPrevQuestion (&Match); - } + Match.Status.ShowingAnswers = false; // Do not show answers + + /***** Update match status in database *****/ + Gam_UpdateMatchStatusInDB (&Match); + + /***** Show current match status *****/ + fprintf (Gbl.F.Out,"
"); + Gam_ShowMatchStatusForTch (&Match); + fprintf (Gbl.F.Out,"
"); + } + +/*****************************************************************************/ +/**** Show stem and answers of current question in a match (by a teacher) ****/ +/*****************************************************************************/ + +void Gam_ShowAnssQstMatchTch (void) + { + struct Match Match; + + /***** Remove old players. + This function must be called before getting match status. *****/ + Gam_RemoveOldPlayers (); + + /***** Get data of the match from database *****/ + Match.MchCod = Gbl.Games.MchCodBeingPlayed; + Gam_GetDataOfMatchByCod (&Match); + + /***** Update status *****/ + Match.Status.ShowingAnswers = true; // Show answers + + /***** Update match status in database *****/ + Gam_UpdateMatchStatusInDB (&Match); + + /***** Show current match status *****/ + fprintf (Gbl.F.Out,"
"); + Gam_ShowMatchStatusForTch (&Match); + fprintf (Gbl.F.Out,"
"); + } + +/*****************************************************************************/ +/* Show previous match status (previous question, answers...) (by a teacher) */ +/*****************************************************************************/ + +void Gam_PrevQstMatchTch (void) + { + struct Match Match; + + /***** Remove old players. + This function must be called before getting match status. *****/ + Gam_RemoveOldPlayers (); + + /***** Get data of the match from database *****/ + Match.MchCod = Gbl.Games.MchCodBeingPlayed; + Gam_GetDataOfMatchByCod (&Match); + + /***** Update status *****/ + Gam_SetMatchStatusToPrevQuestion (&Match); /***** Update match status in database *****/ Gam_UpdateMatchStatusInDB (&Match); @@ -3570,7 +3618,7 @@ void Gam_PrevStatusMatchTch (void) /***** Show next match status (next question, answers...) (by a teacher) *****/ /*****************************************************************************/ -void Gam_NextStatusMatchTch (void) +void Gam_NextQstMatchTch (void) { struct Match Match; @@ -3582,16 +3630,8 @@ void Gam_NextStatusMatchTch (void) Match.MchCod = Gbl.Games.MchCodBeingPlayed; Gam_GetDataOfMatchByCod (&Match); - /***** If not yet finished, update status *****/ - if (Match.Status.QstInd == 0) // Not started - Gam_SetMatchStatusToNextQuestion (&Match); - else if (Match.Status.QstInd < Gam_AFTER_LAST_QUESTION) // Unfinished - { - if (Match.Status.ShowingAnswers) // Showing answers currently - Gam_SetMatchStatusToNextQuestion (&Match); - else - Match.Status.ShowingAnswers = true; // Show answers - } + /***** Update status *****/ + Gam_SetMatchStatusToNextQuestion (&Match); /***** Update match status in database *****/ Gam_UpdateMatchStatusInDB (&Match); @@ -3614,15 +3654,12 @@ static void Gam_SetMatchStatusToPrevQuestion (struct Match *Match) if (Match->Status.QstInd == 0) // Start of questions has been reached { Match->Status.QstCod = -1L; // No previous questions - Match->Status.BeingPlayed = false; // Match is not being played - Match->Status.ShowingAnswers = false; // Do not show answers + Match->Status.BeingPlayed = false; // Match is not being played } else - { Match->Status.QstCod = Gam_GetQstCodFromQstInd (Match->GamCod, Match->Status.QstInd); - Match->Status.ShowingAnswers = true; // Show answers - } + Match->Status.ShowingAnswers = Match->Status.BeingPlayed; // Show answers only if being played } /*****************************************************************************/ @@ -3778,15 +3815,16 @@ static void Gam_ShowLeftColumnTch (struct Match *Match) fprintf (Gbl.F.Out,"
"); if (Match->Status.QstInd < Gam_AFTER_LAST_QUESTION) // Unfinished { - if (Match->Status.ShowingAnswers) + if (Match->Status.BeingPlayed && + Match->Status.ShowingAnswers) /* Put button to show stem of current question, hiding answers */ - Gam_PutBigButton (ActSteMchTch,Match->MchCod, + Gam_PutBigButton (ActShoSteMchTch,Match->MchCod, Gam_ICON_STEM,Txt_Stem); else if (Match->Status.QstInd == 0) { if (Match->Status.BeingPlayed) /* Put button to go to start of match before first question */ - Gam_PutBigButton (ActPrvMchTch,Match->MchCod, + Gam_PutBigButton (ActPrvQstMchTch,Match->MchCod, Gam_ICON_START,Txt_MATCH_Start); else // Not being played /* Put button to close browser tab */ @@ -3799,17 +3837,17 @@ static void Gam_ShowLeftColumnTch (struct Match *Match) Match->Status.QstInd); if (PrvQstInd == 0) // There is not a previous question /* Put button to resume match before first question */ - Gam_PutBigButton (ActPrvMchTch,Match->MchCod, + Gam_PutBigButton (ActPrvQstMchTch,Match->MchCod, Gam_ICON_START,Txt_MATCH_Start); else // There is a previous question /* Put button to show previous question */ - Gam_PutBigButton (ActPrvMchTch,Match->MchCod, + Gam_PutBigButton (ActPrvQstMchTch,Match->MchCod, Gam_ICON_PREVIOUS,Txt_Previous_QUESTION); } } else // Finished /* Put button to show last question */ - Gam_PutBigButton (ActPrvMchTch,Match->MchCod, + Gam_PutBigButton (ActPrvQstMchTch,Match->MchCod, Gam_ICON_PREVIOUS,Txt_Previous_QUESTION); fprintf (Gbl.F.Out,"
"); @@ -3844,28 +3882,29 @@ static void Gam_ShowLeftColumnTch (struct Match *Match) /* Get index of the next question */ NxtQstInd = Gam_GetNextQuestionIndexInGame (Match->GamCod, Match->Status.QstInd); - if (Match->Status.ShowingAnswers) - { - if (NxtQstInd >= Gam_AFTER_LAST_QUESTION) // No more questions - /* Put button to finish */ - Gam_PutBigButton (ActNxtMchTch,Match->MchCod, - Gam_ICON_FINISH,Txt_Finish); - else // There are more questions - /* Put button to show next question */ - Gam_PutBigButton (ActNxtMchTch,Match->MchCod, - Gam_ICON_NEXT,Txt_Next_QUESTION); - } - else + if (Match->Status.BeingPlayed && + !Match->Status.ShowingAnswers) { if (Match->Status.QstInd == 0) /* Put button to show first question */ - Gam_PutBigButton (ActNxtMchTch,Match->MchCod, + Gam_PutBigButton (ActNxtQstMchTch,Match->MchCod, Gam_ICON_NEXT,Txt_Next_QUESTION); else /* Put button to show answers */ - Gam_PutBigButton (ActNxtMchTch,Match->MchCod, + Gam_PutBigButton (ActShoAnsMchTch,Match->MchCod, Gam_ICON_ANSWERS,Txt_Answers); } + else + { + if (NxtQstInd >= Gam_AFTER_LAST_QUESTION) // No more questions + /* Put button to finish */ + Gam_PutBigButton (ActNxtQstMchTch,Match->MchCod, + Gam_ICON_FINISH,Txt_Finish); + else // There are more questions + /* Put button to show next question */ + Gam_PutBigButton (ActNxtQstMchTch,Match->MchCod, + Gam_ICON_NEXT,Txt_Next_QUESTION); + } } fprintf (Gbl.F.Out,""); diff --git a/swad_game.h b/swad_game.h index 6a98fc568..44a297019 100644 --- a/swad_game.h +++ b/swad_game.h @@ -123,8 +123,10 @@ void Gam_CreateNewMatchTch (void); void Gam_RequestStartResumeMatchTch (void); void Gam_PauseMatchTch (void); void Gam_ResumeMatchTch (void); -void Gam_PrevStatusMatchTch (void); -void Gam_NextStatusMatchTch (void); +void Gam_ShowStemQstMatchTch (void); +void Gam_ShowAnssQstMatchTch (void); +void Gam_PrevQstMatchTch (void); +void Gam_NextQstMatchTch (void); void Gam_ShowFinishedMatchResults (void); diff --git a/swad_layout.c b/swad_layout.c index cfc8fa31c..dfbd822be 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -696,11 +696,12 @@ static void Lay_WriteScriptInit (void) break; case ActNewMchTch: case ActResMchTch: - case ActPrvMchTch: case ActPauMchTch: case ActPlyMchTch: - case ActSteMchTch: - case ActNxtMchTch: + case ActShoSteMchTch: + case ActShoAnsMchTch: + case ActPrvQstMchTch: + case ActNxtQstMchTch: case ActPlyMchStd: case ActAnsMchQstStd: RefreshGame = true; @@ -819,11 +820,12 @@ static void Lay_WriteScriptParamsAJAX (void) /* Parameters related with match refreshing (for teachers) */ case ActNewMchTch: case ActResMchTch: - case ActPrvMchTch: case ActPauMchTch: case ActPlyMchTch: - case ActSteMchTch: - case ActNxtMchTch: + case ActShoSteMchTch: + case ActShoAnsMchTch: + case ActPrvQstMchTch: + case ActNxtQstMchTch: fprintf (Gbl.F.Out,"var RefreshParamNxtActGam = \"act=%ld\";\n" "var RefreshParamMchCod = \"MchCod=%ld\";\n", Act_GetActCod (ActRefMchTch),