diff --git a/css/swad18.136.4.css b/css/swad18.136.4.css index fa3b27a6a..64e7b7eb2 100644 --- a/css/swad18.136.4.css +++ b/css/swad18.136.4.css @@ -2594,8 +2594,8 @@ a:hover img.CENTRE_PHOTO_SHOW box-sizing:border-box; display:table; width:100%; + height:60px; font-size:18pt; - padding-bottom:18pt; border:1px solid pink; } .MATCH_TOP_LEFT @@ -2626,10 +2626,12 @@ a:hover img.CENTRE_PHOTO_SHOW .MATCH_NUM_QST { text-align:center; - padding:48pt 0; + vertical-align:top; + padding-bottom:48pt; color:#808080; font-size:36pt; font-weight:bold; + border:1px solid green; } .MATCH_NUM_ANSWERERS { diff --git a/swad_changelog.h b/swad_changelog.h index 0705281cb..1a9c3950f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -439,6 +439,8 @@ Lo de mutear anuncios, en principio prefiero hacer una opci // TODO: Perico: bloquear la subida de archivos por parte de estudiantes (no tiene que ver con el bloqueo de la edición de proyectos) +// TODO: Al confirmar una inscripción, mostrar ficha de retroalimentación similar a la que se muestra cuando se crea un administrador. Tal y como está ahora crea confusión al usuario. + /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ @@ -458,10 +460,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.136.4 (2019-07-19)" +#define Log_PLATFORM_VERSION "SWAD 18.136.5 (2019-07-25)" #define CSS_FILE "swad18.136.4.css" #define JS_FILE "swad18.130.2.js" /* + Version 18.136.5: Jul 25, 2019 Changes in layout of match for students. (243936 lines) Version 18.136.4: Jul 19, 2019 Changes in layout of match for teachers. (243920 lines) Version 18.136.3: Jul 19, 2019 New icon to see answers in a match. (243924 lines) Copy the following icon to icon public directory: diff --git a/swad_game.c b/swad_game.c index 8d20dfeac..e045533b0 100644 --- a/swad_game.c +++ b/swad_game.c @@ -93,6 +93,7 @@ struct Match bool ShowingAnswers; bool Finished; bool BeingPlayed; + unsigned NumPlayers; } Status; }; @@ -189,8 +190,9 @@ static void Gam_UpdateMatchStatusInDB (struct Match *Match); static void Gam_SetMatchStatusToNextQuestion (struct Match *Match); static void Gam_ShowMatchStatusForTch (struct Match *Match); static void Gam_ShowMatchStatusForStd (struct Match *Match); -static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers); -static void Gam_ShowBottonLeftColumnStd (struct Match *Match); +static void Gam_ShowLeftColumnTch (struct Match *Match); +static void Gam_ShowLeftColumnStd (struct Match *Match); +static void Gam_ShowMatchTitleAndPlayers (struct Match *Match); static void Gam_ShowQuestionAndAnswersTch (struct Match *Match); static void Gam_ShowQuestionAndAnswersStd (struct Match *Match); @@ -203,7 +205,7 @@ static void Gam_UpdateMatchAsBeingPlayed (long MchCod); static void Gam_SetMatchAsNotBeingPlayed (long MchCod); static bool Gam_GetIfMatchIsBeingPlayed (long MchCod); static void Gam_RegisterMeAsPlayerInMatch (long MchCod); -static unsigned Gam_GetNumPlayers (long MchCod); +static void Gam_GetNumPlayers (struct Match *Match); static void Gam_ShowMatchStatusForStd (struct Match *Match); static int Gam_GetQstAnsFromDB (long MchCod,unsigned QstInd); @@ -3470,39 +3472,22 @@ static void Gam_SetMatchStatusToNextQuestion (struct Match *Match) static void Gam_ShowMatchStatusForTch (struct Match *Match) { - extern const char *Txt_Players; - unsigned NumPlayers = Gam_GetNumPlayers (Match->MchCod); + /***** Get current number of players *****/ + Gam_GetNumPlayers (Match); /***** Left column *****/ - Gam_ShowBottonLeftColumnTch (Match,NumPlayers); + Gam_ShowLeftColumnTch (Match); /***** Right column *****/ /* Start right container */ fprintf (Gbl.F.Out,"
"); /***** Top row *****/ - /* Start top container */ - fprintf (Gbl.F.Out,"
"); - - /* Left: Match title */ - fprintf (Gbl.F.Out,"
" - "%s" - "
", - Match->Title); - - /* Right: Number of players */ - fprintf (Gbl.F.Out,"
%s: %u
", - Txt_Players,NumPlayers); - - /* End top container */ - fprintf (Gbl.F.Out,"
"); + Gam_ShowMatchTitleAndPlayers (Match); /***** Bottom row *****/ - /* Start bottom container */ fprintf (Gbl.F.Out,"
"); - /* Show right column */ - fprintf (Gbl.F.Out,"
"); if (!Match->Status.Finished && Match->Status.BeingPlayed) { @@ -3512,9 +3497,7 @@ static void Gam_ShowMatchStatusForTch (struct Match *Match) /* Update match as being played */ Gam_UpdateMatchAsBeingPlayed (Match->MchCod); } - fprintf (Gbl.F.Out,"
"); - /* End bottom container */ fprintf (Gbl.F.Out,"
"); /* End right container */ @@ -3536,15 +3519,21 @@ static void Gam_ShowMatchStatusForStd (struct Match *Match) if (!IBelongToGroups) Lay_ShowErrorAndExit ("You can not play this match!"); + /***** Get current number of players *****/ + Gam_GetNumPlayers (Match); + + /***** Left column *****/ + Gam_ShowLeftColumnStd (Match); + + /***** Right column *****/ + /* Start right container */ + fprintf (Gbl.F.Out,"
"); + + /***** Top row *****/ + Gam_ShowMatchTitleAndPlayers (Match); + /***** Bottom row *****/ - /* Start bottom container */ fprintf (Gbl.F.Out,"
"); - - /* Show left column */ - Gam_ShowBottonLeftColumnStd (Match); - - /* Show right column */ - fprintf (Gbl.F.Out,"
"); if (!Match->Status.Finished) { /***** Update players ******/ @@ -3565,7 +3554,7 @@ static void Gam_ShowMatchStatusForStd (struct Match *Match) } fprintf (Gbl.F.Out,"
"); - /* End bottom container */ + /* End right container */ fprintf (Gbl.F.Out,"
"); } @@ -3573,7 +3562,7 @@ static void Gam_ShowMatchStatusForStd (struct Match *Match) /******** Show left botton column when playing a match (as a teacher) ********/ /*****************************************************************************/ -static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers) +static void Gam_ShowLeftColumnTch (struct Match *Match) { extern const char *Txt_End; extern const char *Txt_Next_QUESTION; @@ -3588,6 +3577,9 @@ static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers /***** Start left container *****/ fprintf (Gbl.F.Out,"
"); + /***** Top *****/ + fprintf (Gbl.F.Out,"
"); + /***** Write number of question *****/ NumQsts = Gam_GetNumQstsGame (Match->GamCod); fprintf (Gbl.F.Out,"
"); @@ -3645,7 +3637,7 @@ static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers "responden
" // TODO: Need translation!!! "%u/%u" "
", - NumAnswerers,NumPlayers); + NumAnswerers,Match->Status.NumPlayers); } /***** End left container *****/ @@ -3656,13 +3648,16 @@ static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers /******** Show left botton column when playing a match (as a student) ********/ /*****************************************************************************/ -static void Gam_ShowBottonLeftColumnStd (struct Match *Match) +static void Gam_ShowLeftColumnStd (struct Match *Match) { extern const char *Txt_End; unsigned NumQsts; - /***** Start bottom left container *****/ - fprintf (Gbl.F.Out,"
"); + /***** Start left container *****/ + fprintf (Gbl.F.Out,"
"); + + /***** Top *****/ + fprintf (Gbl.F.Out,"
"); /***** Write number of question *****/ NumQsts = Gam_GetNumQstsGame (Match->GamCod); @@ -3682,7 +3677,32 @@ static void Gam_ShowBottonLeftColumnStd (struct Match *Match) fprintf (Gbl.F.Out,"
" "
"); - /***** End bottom left container *****/ + /***** End left container *****/ + fprintf (Gbl.F.Out,"
"); + } + +/*****************************************************************************/ +/************** Show match title and current number of players ***************/ +/*****************************************************************************/ + +static void Gam_ShowMatchTitleAndPlayers (struct Match *Match) + { + extern const char *Txt_Players; + + /***** Start container *****/ + fprintf (Gbl.F.Out,"
"); + + /***** Left: Match title *****/ + fprintf (Gbl.F.Out,"
" + "%s" + "
", + Match->Title); + + /***** Right: Number of players *****/ + fprintf (Gbl.F.Out,"
%s: %u
", + Txt_Players,Match->Status.NumPlayers); + + /***** End container *****/ fprintf (Gbl.F.Out,"
"); } @@ -3965,14 +3985,13 @@ static void Gam_RegisterMeAsPlayerInMatch (long MchCod) MchCod,Gbl.Usrs.Me.UsrDat.UsrCod); } -static unsigned Gam_GetNumPlayers (long MchCod) +static void Gam_GetNumPlayers (struct Match *Match) { /***** Get number of players who are playing a match *****/ - return - (unsigned) DB_QueryCOUNT ("can not get number of players", - "SELECT COUNT(*) FROM gam_players" - " WHERE MchCod=%ld", - MchCod); + Match->Status.NumPlayers = (unsigned) DB_QueryCOUNT ("can not get number of players", + "SELECT COUNT(*) FROM gam_players" + " WHERE MchCod=%ld", + Match->MchCod); } /*****************************************************************************/