Version19.13.3

This commit is contained in:
Antonio Cañas Vargas 2019-09-25 09:29:44 +02:00
parent 27fb49de8f
commit aa6d36d72c
2 changed files with 76 additions and 29 deletions

View File

@ -470,10 +470,14 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.13.2 (2019-09-25)"
#define Log_PLATFORM_VERSION "SWAD 19.13.3 (2019-09-25)"
#define CSS_FILE "swad19.3.css"
#define JS_FILE "swad18.130.2.js"
/*
// TODO: Poner columna en listado de juegos que indique el número de partidas
// TODO: Imposibilitar la edición de preguntas de un juego cuando tenga partidas
Version 19.13.3: Sep 25, 2019 Code refactoring in match listing. (246123 lines)
Version 19.13.2: Sep 25, 2019 Code refactoring in match listing. (246086 lines)
Version 19.13.1: Sep 25, 2019 Code refactoring in match listing. (246061 lines)
Version 19.13: Sep 25, 2019 Column for visibility in match listing. (246044 lines)

View File

@ -136,9 +136,13 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game,
unsigned NumMatches,
MYSQL_RES *mysql_res);
static void Mch_ListOneOrMoreMatchesHeading (void);
static void Mch_ListOneOrMoreMatchesIcons (const struct Match *Match);
static void Mch_ListOneOrMoreMatchesNumMatch (unsigned NumMatch);
static void Mch_ListOneOrMoreMatchesAuthor (const struct Match *Match);
static void Mch_ListOneOrMoreMatchesTimes (const struct Match *Match,unsigned UniqueId);
static void Mch_ListOneOrMoreMatchesTitleGrps (const struct Match *Match);
static void Mch_GetAndWriteNamesOfGrpsAssociatedToMatch (const struct Match *Match);
static void Mch_ListOneOrMoreMatchesNumPlayers (const struct Match *Match);
static void Mch_ListOneOrMoreMatchesStatus (const struct Match *Match,unsigned NumQsts);
static void Mch_ListOneOrMoreMatchesResult (const struct Match *Match);
@ -412,45 +416,31 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game,
/***** Get match data from row *****/
Mch_GetMatchDataFromRow (mysql_res,&Match);
/***** Icons *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"BT%u\">",Gbl.RowEvenOdd);
/***** Write row for this match ****/
fprintf (Gbl.F.Out,"<tr>");
/* Put icon to remove the match */
Frm_StartForm (ActReqRemMchTch);
Mch_PutParamMchCod (Match.MchCod);
Ico_PutIconRemove ();
Frm_EndForm ();
/* Icons */
Mch_ListOneOrMoreMatchesIcons (&Match);
fprintf (Gbl.F.Out,"</td>");
/* Number of match **/
Mch_ListOneOrMoreMatchesNumMatch (NumMatch);
/***** Number of match ******/
fprintf (Gbl.F.Out,"<td class=\"BIG_INDEX RIGHT_TOP COLOR%u\">%u</td>",
Gbl.RowEvenOdd,NumMatch + 1);
/* Match player */
Mch_ListOneOrMoreMatchesAuthor (&Match);
/***** Match player *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
Gbl.RowEvenOdd);
Usr_WriteAuthor1Line (Match.UsrCod,false);
fprintf (Gbl.F.Out,"</td>");
/***** Start/end date/time *****/
/* Start/end date/time */
Mch_ListOneOrMoreMatchesTimes (&Match,UniqueId);
/***** Title and groups *****/
/* Title and groups */
Mch_ListOneOrMoreMatchesTitleGrps (&Match);
/***** Number of players who have answered any question in the match ******/
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_TOP COLOR%u\">"
"%u"
"</td>",
Gbl.RowEvenOdd,
Mch_GetNumUsrsWhoHaveAnswerMch (Match.MchCod));
/* Number of players who have answered any question in the match */
Mch_ListOneOrMoreMatchesNumPlayers (&Match);
/***** Match status ******/
/* Match status */
Mch_ListOneOrMoreMatchesStatus (&Match,Game->NumQsts);
/***** Match result visible? *****/
/* Match result visible? */
Mch_ListOneOrMoreMatchesResult (&Match);
fprintf (Gbl.F.Out,"</tr>");
@ -511,6 +501,45 @@ static void Mch_ListOneOrMoreMatchesHeading (void)
Txt_Result);
}
/*****************************************************************************/
/************************* Put a column for icons ****************************/
/*****************************************************************************/
static void Mch_ListOneOrMoreMatchesIcons (const struct Match *Match)
{
fprintf (Gbl.F.Out,"<td class=\"BT%u\">",Gbl.RowEvenOdd);
/* Put icon to remove the match */
Frm_StartForm (ActReqRemMchTch);
Mch_PutParamMchCod (Match->MchCod);
Ico_PutIconRemove ();
Frm_EndForm ();
fprintf (Gbl.F.Out,"</td>");
}
/*****************************************************************************/
/********************* Put a column for number of match **********************/
/*****************************************************************************/
static void Mch_ListOneOrMoreMatchesNumMatch (unsigned NumMatch)
{
fprintf (Gbl.F.Out,"<td class=\"BIG_INDEX RIGHT_TOP COLOR%u\">%u</td>",
Gbl.RowEvenOdd,NumMatch + 1);
}
/*****************************************************************************/
/************* Put a column for teacher who created the match ****************/
/*****************************************************************************/
static void Mch_ListOneOrMoreMatchesAuthor (const struct Match *Match)
{
/***** Match author (teacher) *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",Gbl.RowEvenOdd);
Usr_WriteAuthor1Line (Match->UsrCod,false);
fprintf (Gbl.F.Out,"</td>");
}
/*****************************************************************************/
/***************** Put a column for match start and end times ****************/
/*****************************************************************************/
@ -623,6 +652,20 @@ static void Mch_GetAndWriteNamesOfGrpsAssociatedToMatch (const struct Match *Mat
DB_FreeMySQLResult (&mysql_res);
}
/*****************************************************************************/
/******************* Put a column for number of players **********************/
/*****************************************************************************/
static void Mch_ListOneOrMoreMatchesNumPlayers (const struct Match *Match)
{
/***** Number of players who have answered any question in the match ******/
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_TOP COLOR%u\">"
"%u"
"</td>",
Gbl.RowEvenOdd,
Mch_GetNumUsrsWhoHaveAnswerMch (Match->MchCod));
}
/*****************************************************************************/
/********************** Put a column for match status ************************/
/*****************************************************************************/