From 38e7617d2c71964150763adb5830bfb01517504e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 20 Dec 2017 19:01:49 +0100 Subject: [PATCH] Version 17.27.1 --- swad_changelog.h | 3 ++- swad_game.c | 42 ++++++++++++++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 0e74d3566..09d1d73c6 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -297,7 +297,7 @@ Gracias /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 17.27 (2017-12-19)" +#define Log_PLATFORM_VERSION "SWAD 17.27.1 (2017-12-20)" #define CSS_FILE "swad17.25.4.css" #define JS_FILE "swad17.17.1.js" @@ -313,6 +313,7 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ /* + Version 17.27.1: Dec 20, 2017 Changes in icon to play game. (234484 lines) Version 17.27: Dec 19, 2017 Statistics tab is renamed as Analytics. (234464 lines) Copy the following icons to icon public directory: sudo cp icon/iconset/awesome/action64x64/ana64x64.gif /var/www/html/swad/icon/iconset/awesome/action64x64/ diff --git a/swad_game.c b/swad_game.c index 1c2756273..4b1c5b03b 100644 --- a/swad_game.c +++ b/swad_game.c @@ -96,7 +96,9 @@ static void Gam_WriteAuthor (struct Game *Game); static void Gam_WriteStatus (struct Game *Game); static void Gam_GetParamGameOrder (void); -static void Gam_PutFormsToRemEditOneGame (long GamCod,bool Visible); +static void Gam_PutFormsToRemEditOneGame (long GamCod,bool Visible, + bool ShowOnlyThisGame); +static void Gam_PutParamsToPlayGame1stQst (void); static void Gam_PutParams (void); static void Gam_SetAllowedAndHiddenScopes (unsigned *ScopesAllowed, @@ -459,7 +461,8 @@ static void Gam_ShowOneGame (long GamCod, fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out,"\">"); if (Game.Status.ICanEdit) - Gam_PutFormsToRemEditOneGame (Game.GamCod,Game.Status.Visible); + Gam_PutFormsToRemEditOneGame (Game.GamCod,Game.Status.Visible, + ShowOnlyThisGame); fprintf (Gbl.F.Out,""); /* Start date/time */ @@ -536,7 +539,7 @@ static void Gam_ShowOneGame (long GamCod, Gam_WriteStatus (&Game); if (ShowOnlyThisGame) - { + { fprintf (Gbl.F.Out,"
"); Act_FormStart (ActPlyGam); @@ -808,7 +811,8 @@ void Gam_PutHiddenParamGameOrder (void) /******************** Put a link (form) to edit one game *********************/ /*****************************************************************************/ -static void Gam_PutFormsToRemEditOneGame (long GamCod,bool Visible) +static void Gam_PutFormsToRemEditOneGame (long GamCod,bool Visible, + bool ShowOnlyThisGame) { extern const char *Txt_Reset; extern const char *Txt_Play; @@ -833,21 +837,39 @@ static void Gam_PutFormsToRemEditOneGame (long GamCod,bool Visible) /***** Put icon to edit game *****/ Ico_PutContextualIconToEdit (ActEdiOneGam,Gam_PutParams); - /***** Put icon to play game *****/ - Lay_PutContextualLink (ActPlyGam,NULL,Gam_PutParams, - "play64x64.png", - Txt_Play,NULL, - NULL); + if (ShowOnlyThisGame) + /***** Put icon to show first question *****/ + Lay_PutContextualLink (ActPlyGam1stQst,NULL,Gam_PutParamsToPlayGame1stQst, + "play64x64.png", + Txt_Play,NULL, + NULL); + else + /***** Put icon to play game *****/ + Lay_PutContextualLink (ActPlyGam,NULL,Gam_PutParams, + "play64x64.png", + Txt_Play,NULL, + NULL); } /*****************************************************************************/ -/********************** Params used to edit a game *************************/ +/************* Params used to play the first question of a game **************/ +/*****************************************************************************/ + +static void Gam_PutParamsToPlayGame1stQst (void) + { + Gam_PutParams (); + Gam_PutParamQstInd (0); // Start by first question in game + } + +/*****************************************************************************/ +/******************** Params used to edit/play a game ************************/ /*****************************************************************************/ static void Gam_PutParams (void) { if (Gbl.Games.CurrentGamCod > 0) Gam_PutParamGameCod (Gbl.Games.CurrentGamCod); + Att_PutHiddenParamAttOrder (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Pag_GAMES,Gbl.Games.CurrentPage);