From 8a7b07a3e3884833ff8f8bb31f7b0d18ecdfde9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 15 Jul 2019 22:08:06 +0200 Subject: [PATCH] Version18.132.3 --- css/swad18.132.2.css | 4 ++-- swad_action.c | 2 +- swad_changelog.h | 4 +++- swad_connected.c | 6 +++--- swad_date.c | 4 ++-- swad_game.c | 14 ++++++++++---- swad_layout.c | 31 ++++++++++++++++++++----------- 7 files changed, 41 insertions(+), 24 deletions(-) diff --git a/css/swad18.132.2.css b/css/swad18.132.2.css index a61a87122..5af9702a3 100644 --- a/css/swad18.132.2.css +++ b/css/swad18.132.2.css @@ -2570,7 +2570,7 @@ a:hover img.CENTRE_PHOTO_SHOW display:table; margin:5%; width:90%; - text-align:center; + /* text-align:center; */ } .GAM_PLAY_TCH_NUM_QST @@ -2676,7 +2676,7 @@ a:hover img.CENTRE_PHOTO_SHOW } .GAM_PLAY_STD_ANSWER_SELECTED { - box-shadow: 0px 0px 24px 12px rgba(0,180,0,1); + box-shadow: 0px 0px 18px 12px rgba(0,128,0,1); } .GAM_PLAY_TCH_BUTTON:hover, .GAM_PLAY_STD_BUTTON:hover { diff --git a/swad_action.c b/swad_action.c index 264f11b27..54235fda0 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2154,7 +2154,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActPlyMchStd */{1780,-1,TabUnk,ActSeeAllGam ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,Gam_GetMatchBeingPlayed ,Gam_ShowMatchToMeAsStd ,NULL}, /* ActRefMchStd */{1782,-1,TabUnk,ActSeeAllGam ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_AJAX_RFRESH,Gam_GetMatchBeingPlayed ,Gam_RefreshCurrentMatchStd ,NULL}, - /* ActAnsMchQstStd */{1651,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_204_NO_CONT,NULL ,Gam_ReceiveQstAnsFromStd ,NULL}, + /* ActAnsMchQstStd */{1651,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_ReceiveQstAnsFromStd ,NULL}, /* ActFrmNewGam */{1652,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_RequestCreatOrEditGame ,NULL}, /* ActEdiOneGam */{1653,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_RequestCreatOrEditGame ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index 07601e40f..d9f11caae 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -458,10 +458,12 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.132.2 (2019-07-15)" +#define Log_PLATFORM_VERSION "SWAD 18.132.3 (2019-07-15)" #define CSS_FILE "swad18.132.2.css" #define JS_FILE "swad18.130.2.js" /* +TODO: Poner cronómetro o algo que se vaya actualizando para ver que va cambiando la respuesta del estudiante + Version 18.132.3: Jul 15, 2019 Reception of student answer to a match question. (243470 lines) Version 18.132.2: Jul 15, 2019 Reception of student answer to a match question. Not finished. (243456 lines) Version 18.132.1: Jul 15, 2019 Reception of student answer to a match question. Not finished. (243405 lines) 2 changes necessary in database: diff --git a/swad_connected.c b/swad_connected.c index 39b1bcd3e..2e791e669 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -1105,12 +1105,12 @@ void Con_WriteScriptClockConnected (void) { unsigned NumUsr; - fprintf (Gbl.F.Out," NumUsrsCon = %u;\n", + fprintf (Gbl.F.Out,"\tNumUsrsCon = %u;\n", Gbl.Usrs.Connected.NumUsrsToList); for (NumUsr = 0; NumUsr < Gbl.Usrs.Connected.NumUsrsToList; NumUsr++) - fprintf (Gbl.F.Out," ListSeconds[%u] = %ld;\n", + fprintf (Gbl.F.Out,"\tListSeconds[%u] = %ld;\n", NumUsr,Gbl.Usrs.Connected.Lst[NumUsr].TimeDiff); - fprintf (Gbl.F.Out," writeClockConnected();\n"); + fprintf (Gbl.F.Out,"\twriteClockConnected();\n"); } diff --git a/swad_date.c b/swad_date.c index b14223816..974b314b9 100644 --- a/swad_date.c +++ b/swad_date.c @@ -1533,7 +1533,7 @@ void Dat_WriteScriptMonths (void) extern const char *Txt_MONTHS_SMALL_SHORT[12]; unsigned NumMonth; - fprintf (Gbl.F.Out,"var Months = ["); + fprintf (Gbl.F.Out,"\tvar Months = ["); for (NumMonth = 0; NumMonth < 12; NumMonth++) @@ -1544,7 +1544,7 @@ void Dat_WriteScriptMonths (void) } fprintf (Gbl.F.Out,"];\n"); - fprintf (Gbl.F.Out,"var MonthsShort = ["); + fprintf (Gbl.F.Out,"\tvar MonthsShort = ["); for (NumMonth = 0; NumMonth < 12; NumMonth++) diff --git a/swad_game.c b/swad_game.c index 68d8ff2fc..15900d7fd 100644 --- a/swad_game.c +++ b/swad_game.c @@ -3805,11 +3805,8 @@ void Gam_ReceiveQstAnsFromStd (void) unsigned StdAnsInd; int PreviousStdAnsInd; - /***** Get match code *****/ - if ((Match.MchCod = Gam_GetParamMatchCod ()) == -1L) - Lay_ShowErrorAndExit ("Code of match is missing."); - /***** Get data of the match from database *****/ + Match.MchCod = Gbl.Games.MchCodBeingPlayed; Gam_GetDataOfMatchByCod (&Match); /***** Get question index from form *****/ @@ -3849,6 +3846,15 @@ void Gam_ReceiveQstAnsFromStd (void) " (%ld,%ld,%u,%u)", Match.MchCod,Gbl.Usrs.Me.UsrDat.UsrCod,QstInd,StdAnsInd); } + + /***** Start container for match status *****/ + fprintf (Gbl.F.Out,"
"); + + /***** Show current question *****/ + Gam_ShowMatchStatusForStd (&Match); + + /***** End container for match status *****/ + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ diff --git a/swad_layout.c b/swad_layout.c index 09955222e..3ea5dc33c 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -268,6 +268,7 @@ void Lay_WriteStartOfPage (void) Cfg_URL_ICON_PUBLIC); break; case Act_BRW_NEW_TAB: + case Act_BRW_2ND_TAB: fprintf (Gbl.F.Out,"\n"); Gbl.Layout.WritingHTMLStart = false; Gbl.Layout.HTMLStartWritten = @@ -662,10 +663,14 @@ static void Lay_WriteScriptMathJax (void) static void Lay_WriteScriptInit (void) { extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; + bool RefreshConnected; bool RefreshNewTimeline = false; bool RefreshGame = false; bool RefreshLastClicks = false; + RefreshConnected = Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB && + (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN); // Right column visible + switch (Gbl.Action.Act) { case ActSeeSocTmlGbl: @@ -678,6 +683,7 @@ static void Lay_WriteScriptInit (void) RefreshNewTimeline = true; break; case ActPlyMchStd: + case ActAnsMchQstStd: RefreshGame = true; break; case ActLstClk: @@ -692,29 +698,31 @@ static void Lay_WriteScriptInit (void) Dat_WriteScriptMonths (); if (RefreshNewTimeline) - fprintf (Gbl.F.Out,"var delayNewTimeline = %lu;\n", + fprintf (Gbl.F.Out,"\tvar delayNewTimeline = %lu;\n", Cfg_TIME_TO_REFRESH_TIMELINE); else if (RefreshGame) // Refresh game via AJAX - fprintf (Gbl.F.Out,"var delayGame = %lu;\n", + fprintf (Gbl.F.Out,"\tvar delayGame = %lu;\n", Cfg_TIME_TO_REFRESH_GAME); fprintf (Gbl.F.Out,"function init(){\n"); - if ((Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible - Con_WriteScriptClockConnected (); + fprintf (Gbl.F.Out,"\tActionAJAX = \"%s\";\n", + Lan_STR_LANG_ID[Gbl.Prefs.Language]); - fprintf (Gbl.F.Out," ActionAJAX = \"%s\";\n" - " setTimeout(\"refreshConnected()\",%lu);\n", - Lan_STR_LANG_ID[Gbl.Prefs.Language], - Gbl.Usrs.Connected.TimeToRefreshInMs); + if (RefreshConnected) // Refresh connected users via AJAX + { + Con_WriteScriptClockConnected (); + fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshConnected()\",%lu);\n", + Gbl.Usrs.Connected.TimeToRefreshInMs); + } if (RefreshLastClicks) // Refresh last clicks via AJAX - fprintf (Gbl.F.Out," setTimeout(\"refreshLastClicks()\",%lu);\n", + fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshLastClicks()\",%lu);\n", Cfg_TIME_TO_REFRESH_LAST_CLICKS); else if (RefreshGame) // Refresh game via AJAX - fprintf (Gbl.F.Out," setTimeout(\"refreshGame()\",delayGame);\n"); + fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshGame()\",delayGame);\n"); else if (RefreshNewTimeline) // Refresh timeline via AJAX - fprintf (Gbl.F.Out," setTimeout(\"refreshNewTimeline()\",delayNewTimeline);\n"); + fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshNewTimeline()\",delayNewTimeline);\n"); fprintf (Gbl.F.Out,"}\n" "\n"); @@ -791,6 +799,7 @@ static void Lay_WriteScriptParamsAJAX (void) break; /* Parameters related with game refreshing */ case ActPlyMchStd: + case ActAnsMchQstStd: fprintf (Gbl.F.Out,"var RefreshParamNxtActGam = \"act=%ld\";\n" "var RefreshParamMchCod = \"MchCod=%ld\";\n", Act_GetActCod (ActRefMchStd),