mirror of https://github.com/acanas/swad-core.git
Version18.141.1
This commit is contained in:
parent
450d45fb45
commit
238583e362
|
@ -2579,7 +2579,6 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
border:1px solid red;
|
||||
}
|
||||
.MATCH_RIGHT
|
||||
{
|
||||
|
@ -2587,34 +2586,40 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
display:table;
|
||||
float:left;
|
||||
width:75%;
|
||||
border:1px solid blue;
|
||||
}
|
||||
.MATCH_TOP
|
||||
{
|
||||
box-sizing:border-box;
|
||||
width:100%;
|
||||
height:60px;
|
||||
color:#808080;
|
||||
font-size:18pt;
|
||||
font-weight:bold;
|
||||
text-align:center;
|
||||
text-overflow:ellipsis;
|
||||
border:1px solid pink;
|
||||
}
|
||||
.MATCH_BOTTOM
|
||||
{
|
||||
box-sizing:border-box;
|
||||
width:100%;
|
||||
border:1px solid pink;
|
||||
padding-left:24px;
|
||||
}
|
||||
|
||||
.MATCH_NUM_QST
|
||||
{
|
||||
text-align:center;
|
||||
vertical-align:top;
|
||||
padding-bottom:48pt;
|
||||
color:#808080;
|
||||
font-size:36pt;
|
||||
font-weight:bold;
|
||||
border:1px solid green;
|
||||
text-align:center;
|
||||
vertical-align:top;
|
||||
}
|
||||
.MATCH_TIME_QST
|
||||
{
|
||||
color:#808080;
|
||||
font-size:18pt;
|
||||
font-weight:bold;
|
||||
text-align:center;
|
||||
vertical-align:top;
|
||||
}
|
||||
.MATCH_NUM_PLAYERS
|
||||
{
|
||||
|
@ -2642,24 +2647,21 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
display:table-cell;
|
||||
box-sizing:border-box;
|
||||
float:left;
|
||||
width:33%;
|
||||
/* border:1px solid green; */
|
||||
width:35%;
|
||||
}
|
||||
.MATCH_BUTTON_CENTER_CONTAINER
|
||||
{
|
||||
display:table-cell;
|
||||
box-sizing:border-box;
|
||||
float:left;
|
||||
width:34%;
|
||||
/* border:1px solid green; */
|
||||
width:30%;
|
||||
}
|
||||
.MATCH_BUTTON_RIGHT_CONTAINER
|
||||
{
|
||||
display:table-cell;
|
||||
box-sizing:border-box;
|
||||
float:left;
|
||||
width:33%;
|
||||
/* border:1px solid green; */
|
||||
width:35%;
|
||||
}
|
||||
|
||||
.MATCH_BUTTON_CONTAINER
|
||||
|
@ -2667,8 +2669,8 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
box-sizing:border-box;
|
||||
display:table;
|
||||
width:100%;
|
||||
height:100px;
|
||||
vertical-align:middle;
|
||||
height:128px;
|
||||
font-size:36pt;
|
||||
}
|
||||
.MATCH_BUTTON_CONTAINER a
|
||||
{
|
||||
|
@ -2679,10 +2681,8 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
{
|
||||
display:table-cell;
|
||||
width:100%;
|
||||
font-size:48pt;
|
||||
text-align:center;
|
||||
vertical-align:middle;
|
||||
/* margin:auto; */
|
||||
opacity:0.7;
|
||||
}
|
||||
.MATCH_BUTTON_ON:hover
|
||||
|
@ -2693,10 +2693,8 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
{
|
||||
display:table-cell;
|
||||
width:100%;
|
||||
font-size:48pt;
|
||||
text-align:center;
|
||||
vertical-align:middle;
|
||||
/* margin:auto; */
|
||||
opacity:0.1;
|
||||
}
|
||||
|
||||
|
@ -2743,7 +2741,6 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
{
|
||||
text-align:center;
|
||||
vertical-align:middle;
|
||||
border:1px solid green;
|
||||
}
|
||||
.MATCH_STD_BUTTON
|
||||
{
|
||||
|
|
|
@ -460,10 +460,11 @@ En OpenSWAD:
|
|||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.141 (2019-09-09)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.141.1 (2019-09-09)"
|
||||
#define CSS_FILE "swad18.138.css"
|
||||
#define JS_FILE "swad18.130.2.js"
|
||||
/*
|
||||
Version 18.141.1: Sep 09, 2019 Display question elapsed time. (244329 lines)
|
||||
Version 18.141: Sep 09, 2019 New action to pause a match. (244312 lines)
|
||||
1 change necessary in database:
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1791','es','N','Pausar partida (como profesor)');
|
||||
|
|
20
swad_date.c
20
swad_date.c
|
@ -1559,7 +1559,6 @@ void Dat_WriteScriptMonths (void)
|
|||
/*****************************************************************************/
|
||||
/********* Write time difference in seconds as hours:minutes:seconds *********/
|
||||
/*****************************************************************************/
|
||||
// TimeDiff must be in seconds
|
||||
|
||||
void Dat_WriteHoursMinutesSecondsFromSeconds (time_t Seconds)
|
||||
{
|
||||
|
@ -1581,3 +1580,22 @@ void Dat_WriteHoursMinutesSecondsFromSeconds (time_t Seconds)
|
|||
(long) Seconds);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Write time as hours:minutes:seconds *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dat_WriteHoursMinutesSeconds (struct Time *Time)
|
||||
{
|
||||
if (Time->Hour)
|
||||
fprintf (Gbl.F.Out,"%u:%02u'%02u"",
|
||||
Time->Hour,
|
||||
Time->Minute,
|
||||
Time->Second);
|
||||
else if (Time->Minute)
|
||||
fprintf (Gbl.F.Out,"%u'%02u"",
|
||||
Time->Minute,
|
||||
Time->Second);
|
||||
else
|
||||
fprintf (Gbl.F.Out,"%u"",
|
||||
Time->Second);
|
||||
}
|
||||
|
|
|
@ -191,5 +191,6 @@ void Dat_AssignDate (struct Date *DateDst,struct Date *DateSrc);
|
|||
void Dat_WriteScriptMonths (void);
|
||||
|
||||
void Dat_WriteHoursMinutesSecondsFromSeconds (time_t Seconds);
|
||||
void Dat_WriteHoursMinutesSeconds (struct Time *Time);
|
||||
|
||||
#endif
|
||||
|
|
46
swad_game.c
46
swad_game.c
|
@ -209,11 +209,11 @@ static void Gam_UpdateMatchStatusInDB (struct Match *Match);
|
|||
|
||||
static void Gam_UpdateElapsedTimeInQuestion (struct Match *Match);
|
||||
static void Gam_GetElapsedTimeInQuestion (struct Match *Match,
|
||||
char HHHMMSS[3 + 1 + 2 + 1 + 2 + 1]);
|
||||
struct Time *Time);
|
||||
static void Gam_GetElapsedTimeInMatch (struct Match *Match,
|
||||
char HHHMMSS[3 + 1 + 2 + 1 + 2 + 1]);
|
||||
struct Time *Time);
|
||||
static void Gam_GetElapsedTime (unsigned NumRows,MYSQL_RES *mysql_res,
|
||||
char HHHMMSS[3 + 1 + 2 + 1 + 2 + 1]);
|
||||
struct Time *Time);
|
||||
|
||||
static void Gam_SetMatchStatusToPrevQuestion (struct Match *Match);
|
||||
static void Gam_SetMatchStatusToNextQuestion (struct Match *Match);
|
||||
|
@ -3396,7 +3396,7 @@ static void Gam_UpdateElapsedTimeInQuestion (struct Match *Match)
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Gam_GetElapsedTimeInQuestion (struct Match *Match,
|
||||
char HHHMMSS[3 + 1 + 2 + 1 + 2 + 1])
|
||||
struct Time *Time)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned NumRows;
|
||||
|
@ -3409,7 +3409,7 @@ static void Gam_GetElapsedTimeInQuestion (struct Match *Match,
|
|||
Match->MchCod,Match->Status.QstInd);
|
||||
|
||||
/***** Get elapsed time from query result *****/
|
||||
Gam_GetElapsedTime (NumRows,mysql_res,HHHMMSS);
|
||||
Gam_GetElapsedTime (NumRows,mysql_res,Time);
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
@ -3420,7 +3420,7 @@ static void Gam_GetElapsedTimeInQuestion (struct Match *Match,
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Gam_GetElapsedTimeInMatch (struct Match *Match,
|
||||
char HHHMMSS[3 + 1 + 2 + 1 + 2 + 1])
|
||||
struct Time *Time)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned NumRows;
|
||||
|
@ -3432,7 +3432,7 @@ static void Gam_GetElapsedTimeInMatch (struct Match *Match,
|
|||
Match->MchCod);
|
||||
|
||||
/***** Get elapsed time from query result *****/
|
||||
Gam_GetElapsedTime (NumRows,mysql_res,HHHMMSS);
|
||||
Gam_GetElapsedTime (NumRows,mysql_res,Time);
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
@ -3443,31 +3443,27 @@ static void Gam_GetElapsedTimeInMatch (struct Match *Match,
|
|||
/*****************************************************************************/
|
||||
|
||||
static void Gam_GetElapsedTime (unsigned NumRows,MYSQL_RES *mysql_res,
|
||||
char HHHMMSS[3 + 1 + 2 + 1 + 2 + 1])
|
||||
struct Time *Time)
|
||||
{
|
||||
MYSQL_ROW row;
|
||||
bool ElapsedTimeGotFromDB = false;
|
||||
|
||||
/***** Get time from H...H:MM:SS string *****/
|
||||
if (NumRows)
|
||||
{
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
if (row[0])
|
||||
{
|
||||
/* Get the elapsed time (row[0]) */
|
||||
if (strlen (row[0]) > 2 + 1 + 2 + 1 + 2)
|
||||
Str_Copy (HHHMMSS,"+99:59:59",
|
||||
Gam_MAX_BYTES_TITLE);
|
||||
else
|
||||
Str_Copy (HHHMMSS,row[0],
|
||||
Gam_MAX_BYTES_TITLE);
|
||||
ElapsedTimeGotFromDB = true;
|
||||
}
|
||||
if (sscanf (row[0],"%u:%02u:%02u",&Time->Hour,&Time->Minute,&Time->Second) == 3)
|
||||
ElapsedTimeGotFromDB = true;
|
||||
}
|
||||
|
||||
/***** Initialize time to default value (0) *****/
|
||||
if (!ElapsedTimeGotFromDB)
|
||||
Str_Copy (HHHMMSS,"00:00:00",
|
||||
Gam_MAX_BYTES_TITLE);
|
||||
Time->Hour =
|
||||
Time->Minute =
|
||||
Time->Second = 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -3752,7 +3748,7 @@ static void Gam_ShowLeftColumnTch (struct Match *Match)
|
|||
extern const char *Txt_Next_QUESTION;
|
||||
extern const char *Txt_Finish;
|
||||
extern const char *Txt_Answers;
|
||||
char HHHMMSS[3 + 1 + 2 + 1 + 2 + 1];
|
||||
struct Time Time;
|
||||
unsigned PrvQstInd; // Previous question index
|
||||
unsigned NxtQstInd; // Next question index
|
||||
unsigned NumAnswerers;
|
||||
|
@ -3764,14 +3760,20 @@ static void Gam_ShowLeftColumnTch (struct Match *Match)
|
|||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TOP\">");
|
||||
|
||||
/* Write elapsed time in match */
|
||||
Gam_GetElapsedTimeInMatch (Match,HHHMMSS);
|
||||
fprintf (Gbl.F.Out,"%s",HHHMMSS);
|
||||
Gam_GetElapsedTimeInMatch (Match,&Time);
|
||||
Dat_WriteHoursMinutesSeconds (&Time);
|
||||
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/***** Write number of question *****/
|
||||
Gam_ShowNumQstInGame (Match);
|
||||
|
||||
/***** Write elapsed time in question *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_TIME_QST\">");
|
||||
Gam_GetElapsedTimeInQuestion (Match,&Time);
|
||||
Dat_WriteHoursMinutesSeconds (&Time);
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/***** Buttons *****/
|
||||
/* Start buttons container */
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BUTTONS_CONTAINER\">");
|
||||
|
|
Loading…
Reference in New Issue