mirror of https://github.com/acanas/swad-core.git
Version18.136.4
This commit is contained in:
parent
c9f3337c67
commit
4d2a11e750
|
@ -2571,6 +2571,24 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
margin:4%;
|
||||
width:92%;
|
||||
}
|
||||
.MATCH_LEFT
|
||||
{
|
||||
box-sizing:border-box;
|
||||
float:left;
|
||||
width:25%;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
border:1px solid red;
|
||||
}
|
||||
.MATCH_RIGHT
|
||||
{
|
||||
box-sizing:border-box;
|
||||
display:table;
|
||||
float:left;
|
||||
width:75%;
|
||||
border:1px solid blue;
|
||||
}
|
||||
.MATCH_TOP
|
||||
{
|
||||
box-sizing:border-box;
|
||||
|
@ -2578,7 +2596,7 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
width:100%;
|
||||
font-size:18pt;
|
||||
padding-bottom:18pt;
|
||||
/* border:1px solid pink; */
|
||||
border:1px solid pink;
|
||||
}
|
||||
.MATCH_TOP_LEFT
|
||||
{
|
||||
|
@ -2588,7 +2606,7 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
/* border:1px solid red; */
|
||||
border:1px solid red;
|
||||
}
|
||||
.MATCH_TOP_RIGHT
|
||||
{
|
||||
|
@ -2596,40 +2614,31 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
float:left;
|
||||
width:40%;
|
||||
text-align:right;
|
||||
/* border:1px solid blue; */
|
||||
border:1px solid blue;
|
||||
}
|
||||
.MATCH_BOTTOM
|
||||
{
|
||||
box-sizing:border-box;
|
||||
width:100%;
|
||||
/* border:1px solid pink; */
|
||||
}
|
||||
.MATCH_BOTTOM_LEFT
|
||||
{
|
||||
box-sizing:border-box;
|
||||
float:left;
|
||||
width:20%;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
/* border:1px solid red; */
|
||||
}
|
||||
.MATCH_BOTTOM_RIGHT
|
||||
{
|
||||
box-sizing:border-box;
|
||||
float:left;
|
||||
width:80%;
|
||||
/* border:1px solid blue; */
|
||||
border:1px solid pink;
|
||||
}
|
||||
|
||||
.MATCH_TCH_NUM_QST
|
||||
.MATCH_NUM_QST
|
||||
{
|
||||
text-align:center;
|
||||
padding-bottom:24pt;
|
||||
padding:48pt 0;
|
||||
color:#808080;
|
||||
font-size:36pt;
|
||||
font-weight:bold;
|
||||
}
|
||||
.MATCH_NUM_ANSWERERS
|
||||
{
|
||||
text-align:center;
|
||||
padding:16pt 0;
|
||||
color:#808080;
|
||||
font-size:16pt;
|
||||
}
|
||||
|
||||
.MATCH_TCH_NXT_CONTAINER
|
||||
{
|
||||
}
|
||||
|
@ -2664,15 +2673,6 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
width:50%;
|
||||
}
|
||||
|
||||
.MATCH_STD_NUM_QST
|
||||
{
|
||||
width:15%;
|
||||
float:left;
|
||||
padding-bottom:24pt;
|
||||
color:#808080;
|
||||
font-size:36pt;
|
||||
font-weight:bold;
|
||||
}
|
||||
.MATCH_STD_QST_CONTAINER
|
||||
{
|
||||
width:85%;
|
|
@ -0,0 +1 @@
|
|||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="list" class="svg-inline--fa fa-list fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#404040" d="M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"></path></svg>
|
After Width: | Height: | Size: 782 B |
|
@ -458,10 +458,15 @@ En OpenSWAD:
|
|||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.136.2 (2019-07-18)"
|
||||
#define CSS_FILE "swad18.136.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.136.4 (2019-07-19)"
|
||||
#define CSS_FILE "swad18.136.4.css"
|
||||
#define JS_FILE "swad18.130.2.js"
|
||||
/*
|
||||
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:
|
||||
sudo cp icon/list.svg /var/www/html/swad/icon/
|
||||
|
||||
Version 18.136.2: Jul 18, 2019 Changes in layout of match. (243895 lines)
|
||||
Version 18.136.1: Jul 18, 2019 Changes in layout of match. (243853 lines)
|
||||
Version 18.136: Jul 18, 2019 Changes in layout of match. (243767 lines)
|
||||
|
|
81
swad_game.c
81
swad_game.c
|
@ -163,6 +163,7 @@ static void Gam_AllocateListSelectedQuestions (void);
|
|||
static void Gam_FreeListsSelectedQuestions (void);
|
||||
static unsigned Gam_CountNumQuestionsInList (void);
|
||||
|
||||
static unsigned Gam_GetNumAnswerers (struct Match *Match);
|
||||
static unsigned Gam_GetNumUsrsWhoAnswered (long GamCod,unsigned QstInd,unsigned AnsInd);
|
||||
static void Gam_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs);
|
||||
|
||||
|
@ -188,7 +189,7 @@ 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);
|
||||
static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers);
|
||||
static void Gam_ShowBottonLeftColumnStd (struct Match *Match);
|
||||
static void Gam_ShowQuestionAndAnswersTch (struct Match *Match);
|
||||
static void Gam_ShowQuestionAndAnswersStd (struct Match *Match);
|
||||
|
@ -202,7 +203,6 @@ 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 void Gam_GetAndShowNumPlayersInMatch (long MchCod);
|
||||
static unsigned Gam_GetNumPlayers (long MchCod);
|
||||
|
||||
static void Gam_ShowMatchStatusForStd (struct Match *Match);
|
||||
|
@ -1667,7 +1667,7 @@ static bool Gam_CheckIfIPlayThisMatchBasedOnGrps (long MchCod)
|
|||
|
||||
static unsigned Gam_GetNumQstsGame (long GamCod)
|
||||
{
|
||||
/***** Get data of questions from database *****/
|
||||
/***** Get nuumber of questions in a game from database *****/
|
||||
return
|
||||
(unsigned) DB_QueryCOUNT ("can not get number of questions of a game",
|
||||
"SELECT COUNT(*) FROM gam_questions"
|
||||
|
@ -2308,6 +2308,20 @@ void Gam_GetAndDrawBarNumUsrsWhoAnswered (long GamCod,unsigned QstInd,unsigned A
|
|||
Gam_DrawBarNumUsrs (NumUsrsThisAnswer,NumUsrs);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***** Get number of users who have answered current question in a match *****/
|
||||
/*****************************************************************************/
|
||||
|
||||
static unsigned Gam_GetNumAnswerers (struct Match *Match)
|
||||
{
|
||||
/***** Get number of users who have answered the current question in a match from database *****/
|
||||
return
|
||||
(unsigned) DB_QueryCOUNT ("can not get number of questions of a game",
|
||||
"SELECT COUNT(*) FROM gam_answers"
|
||||
" WHERE MchCod=%ld AND QstInd=%u",
|
||||
Match->MchCod,Match->Status.QstInd);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/**** Get number of users who selected a given answer of a game question *****/
|
||||
/*****************************************************************************/
|
||||
|
@ -3456,6 +3470,16 @@ 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);
|
||||
|
||||
/***** Left column *****/
|
||||
Gam_ShowBottonLeftColumnTch (Match,NumPlayers);
|
||||
|
||||
/***** 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\">");
|
||||
|
@ -3467,9 +3491,8 @@ static void Gam_ShowMatchStatusForTch (struct Match *Match)
|
|||
Match->Title);
|
||||
|
||||
/* Right: Number of players */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP_RIGHT\">");
|
||||
Gam_GetAndShowNumPlayersInMatch (Match->MchCod);
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP_RIGHT\">%s: %u</div>",
|
||||
Txt_Players,NumPlayers);
|
||||
|
||||
/* End top container */
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
@ -3478,9 +3501,6 @@ static void Gam_ShowMatchStatusForTch (struct Match *Match)
|
|||
/* Start bottom container */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BOTTOM\">");
|
||||
|
||||
/* Show left column */
|
||||
Gam_ShowBottonLeftColumnTch (Match);
|
||||
|
||||
/* Show right column */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BOTTOM_RIGHT\">");
|
||||
if (!Match->Status.Finished &&
|
||||
|
@ -3496,6 +3516,9 @@ static void Gam_ShowMatchStatusForTch (struct Match *Match)
|
|||
|
||||
/* End bottom container */
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* End right container */
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -3550,7 +3573,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)
|
||||
static void Gam_ShowBottonLeftColumnTch (struct Match *Match,unsigned NumPlayers)
|
||||
{
|
||||
extern const char *Txt_End;
|
||||
extern const char *Txt_Next_QUESTION;
|
||||
|
@ -3560,13 +3583,14 @@ static void Gam_ShowBottonLeftColumnTch (struct Match *Match)
|
|||
extern const char *Txt_Resume;
|
||||
unsigned NxtQstInd;
|
||||
unsigned NumQsts;
|
||||
unsigned NumAnswerers;
|
||||
|
||||
/***** Start bottom left container *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BOTTOM_LEFT\">");
|
||||
/***** Start left container *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_LEFT\">");
|
||||
|
||||
/***** Write number of question *****/
|
||||
NumQsts = Gam_GetNumQstsGame (Match->GamCod);
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TCH_NUM_QST\">");
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_NUM_QST\">");
|
||||
if (Match->Status.Finished)
|
||||
fprintf (Gbl.F.Out,"%s",Txt_End);
|
||||
else
|
||||
|
@ -3599,7 +3623,7 @@ static void Gam_ShowBottonLeftColumnTch (struct Match *Match)
|
|||
else
|
||||
/* Put button to show answers */
|
||||
Gam_PutBigButton (ActNxtMchTch,Match->MchCod,
|
||||
"step-forward.svg",Txt_Answers);
|
||||
"list.svg",Txt_Answers);
|
||||
}
|
||||
else
|
||||
/* Put button to start / resume match */
|
||||
|
@ -3611,7 +3635,20 @@ static void Gam_ShowBottonLeftColumnTch (struct Match *Match)
|
|||
fprintf (Gbl.F.Out,"</div>"
|
||||
"</div>");
|
||||
|
||||
/***** End bottom left container *****/
|
||||
/***** Write number of users who have answered *****/
|
||||
if (!Match->Status.Finished &&
|
||||
Match->Status.BeingPlayed &&
|
||||
Match->Status.ShowingAnswers)
|
||||
{
|
||||
NumAnswerers = Gam_GetNumAnswerers (Match);
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_NUM_ANSWERERS\">"
|
||||
"responden<br />" // TODO: Need translation!!!
|
||||
"<strong>%u/%u</strong>"
|
||||
"</div>",
|
||||
NumAnswerers,NumPlayers);
|
||||
}
|
||||
|
||||
/***** End left container *****/
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
|
@ -3629,7 +3666,7 @@ static void Gam_ShowBottonLeftColumnStd (struct Match *Match)
|
|||
|
||||
/***** Write number of question *****/
|
||||
NumQsts = Gam_GetNumQstsGame (Match->GamCod);
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TCH_NUM_QST\">");
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_NUM_QST\">");
|
||||
if (Match->Status.Finished)
|
||||
fprintf (Gbl.F.Out,"%s",Txt_End);
|
||||
else
|
||||
|
@ -3928,18 +3965,6 @@ static void Gam_RegisterMeAsPlayerInMatch (long MchCod)
|
|||
MchCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
}
|
||||
|
||||
static void Gam_GetAndShowNumPlayersInMatch (long MchCod)
|
||||
{
|
||||
extern const char *Txt_Players;
|
||||
unsigned NumPlayers;
|
||||
|
||||
/***** Get number of players (students who have joined this match) *****/
|
||||
NumPlayers = Gam_GetNumPlayers (MchCod);
|
||||
|
||||
/***** Show number of players *****/
|
||||
fprintf (Gbl.F.Out,"%s: %u",Txt_Players,NumPlayers);
|
||||
}
|
||||
|
||||
static unsigned Gam_GetNumPlayers (long MchCod)
|
||||
{
|
||||
/***** Get number of players who are playing a match *****/
|
||||
|
|
Loading…
Reference in New Issue