mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-01 06:15:31 +02:00
Version18.136.5
This commit is contained in:
parent
4d2a11e750
commit
4640f5fdc1
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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:
|
||||
|
|
107
swad_game.c
107
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,"<div class=\"MATCH_RIGHT\">");
|
||||
|
||||
/***** Top row *****/
|
||||
/* Start top container */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP\">");
|
||||
|
||||
/* Left: Match title */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP_LEFT\">"
|
||||
"%s"
|
||||
"</div>",
|
||||
Match->Title);
|
||||
|
||||
/* Right: Number of players */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP_RIGHT\">%s: %u</div>",
|
||||
Txt_Players,NumPlayers);
|
||||
|
||||
/* End top container */
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
Gam_ShowMatchTitleAndPlayers (Match);
|
||||
|
||||
/***** Bottom row *****/
|
||||
/* Start bottom container */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BOTTOM\">");
|
||||
|
||||
/* Show right column */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BOTTOM_RIGHT\">");
|
||||
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,"</div>");
|
||||
|
||||
/* End bottom container */
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* 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,"<div class=\"MATCH_RIGHT\">");
|
||||
|
||||
/***** Top row *****/
|
||||
Gam_ShowMatchTitleAndPlayers (Match);
|
||||
|
||||
/***** Bottom row *****/
|
||||
/* Start bottom container */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BOTTOM\">");
|
||||
|
||||
/* Show left column */
|
||||
Gam_ShowBottonLeftColumnStd (Match);
|
||||
|
||||
/* Show right column */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BOTTOM_RIGHT\">");
|
||||
if (!Match->Status.Finished)
|
||||
{
|
||||
/***** Update players ******/
|
||||
|
@ -3565,7 +3554,7 @@ static void Gam_ShowMatchStatusForStd (struct Match *Match)
|
|||
}
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* End bottom container */
|
||||
/* End right container */
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
|
@ -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,"<div class=\"MATCH_LEFT\">");
|
||||
|
||||
/***** Top *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP\"></div>");
|
||||
|
||||
/***** Write number of question *****/
|
||||
NumQsts = Gam_GetNumQstsGame (Match->GamCod);
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_NUM_QST\">");
|
||||
|
@ -3645,7 +3637,7 @@ static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers
|
|||
"responden<br />" // TODO: Need translation!!!
|
||||
"<strong>%u/%u</strong>"
|
||||
"</div>",
|
||||
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,"<div class=\"MATCH_BOTTOM_LEFT\">");
|
||||
/***** Start left container *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_LEFT\">");
|
||||
|
||||
/***** Top *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP\"></div>");
|
||||
|
||||
/***** Write number of question *****/
|
||||
NumQsts = Gam_GetNumQstsGame (Match->GamCod);
|
||||
|
@ -3682,7 +3677,32 @@ static void Gam_ShowBottonLeftColumnStd (struct Match *Match)
|
|||
fprintf (Gbl.F.Out,"</div>"
|
||||
"</div>");
|
||||
|
||||
/***** End bottom left container *****/
|
||||
/***** End left container *****/
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** 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,"<div class=\"MATCH_TOP\">");
|
||||
|
||||
/***** Left: Match title *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP_LEFT\">"
|
||||
"%s"
|
||||
"</div>",
|
||||
Match->Title);
|
||||
|
||||
/***** Right: Number of players *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP_RIGHT\">%s: %u</div>",
|
||||
Txt_Players,Match->Status.NumPlayers);
|
||||
|
||||
/***** End container *****/
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
|
@ -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",
|
||||
Match->Status.NumPlayers = (unsigned) DB_QueryCOUNT ("can not get number of players",
|
||||
"SELECT COUNT(*) FROM gam_players"
|
||||
" WHERE MchCod=%ld",
|
||||
MchCod);
|
||||
Match->MchCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue
Block a user