mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-17 05:55:43 +02:00
Version19.5.2
This commit is contained in:
parent
e07fbb1e72
commit
48f4764e78
|
@ -469,12 +469,14 @@ Type of answer not valid in a game.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.5 (2019-09-17)"
|
#define Log_PLATFORM_VERSION "SWAD 19.5.2 (2019-09-17)"
|
||||||
#define CSS_FILE "swad19.3.css"
|
#define CSS_FILE "swad19.3.css"
|
||||||
#define JS_FILE "swad18.130.2.js"
|
#define JS_FILE "swad18.130.2.js"
|
||||||
/*
|
/*
|
||||||
|
Version 19.5.2: Sep 17, 2019 New column with number of players in listing of matches of a game. (244711 lines)
|
||||||
|
Version 19.5.1: Sep 17, 2019 Removed icon to play a new match in a game. (244685 lines)
|
||||||
Version 19.5: Sep 17, 2019 Fixed bugs related with edition of games.
|
Version 19.5: Sep 17, 2019 Fixed bugs related with edition of games.
|
||||||
Fixed bugs related with behaviour of matches. (244691 lines)
|
Fixed bugs related with behaviour of matches. (244691 lines)
|
||||||
2 changes necessary in database:
|
2 changes necessary in database:
|
||||||
ALTER TABLE mch_matches DROP COLUMN Showing;
|
ALTER TABLE mch_matches DROP COLUMN Showing;
|
||||||
ALTER TABLE mch_matches ADD COLUMN Showing ENUM('nothing','stem','answers','results') NOT NULL DEFAULT 'nothing' AFTER ShowResults;
|
ALTER TABLE mch_matches ADD COLUMN Showing ENUM('nothing','stem','answers','results') NOT NULL DEFAULT 'nothing' AFTER ShowResults;
|
||||||
|
|
|
@ -351,7 +351,6 @@ void Gam_ShowOneGame (long GamCod,
|
||||||
extern const char *Txt_Today;
|
extern const char *Txt_Today;
|
||||||
extern const char *Txt_View_game;
|
extern const char *Txt_View_game;
|
||||||
extern const char *Txt_No_of_questions;
|
extern const char *Txt_No_of_questions;
|
||||||
extern const char *Txt_New_match;
|
|
||||||
char *Anchor = NULL;
|
char *Anchor = NULL;
|
||||||
static unsigned UniqueId = 0;
|
static unsigned UniqueId = 0;
|
||||||
struct Game Game;
|
struct Game Game;
|
||||||
|
@ -388,13 +387,6 @@ void Gam_ShowOneGame (long GamCod,
|
||||||
/* Icons to remove/edit this game */
|
/* Icons to remove/edit this game */
|
||||||
Gam_PutFormsToRemEditOneGame (&Game,Anchor);
|
Gam_PutFormsToRemEditOneGame (&Game,Anchor);
|
||||||
|
|
||||||
if (ShowOnlyThisGame)
|
|
||||||
/* Icon to start a new match */
|
|
||||||
Lay_PutContextualLinkOnlyIcon (ActReqNewMchTch,Mch_NEW_MATCH_SECTION_ID,
|
|
||||||
Gam_PutParams,
|
|
||||||
"play.svg",
|
|
||||||
Txt_New_match);
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
30
swad_match.c
30
swad_match.c
|
@ -192,6 +192,7 @@ static void Mch_GetNumPlayers (struct Match *Match);
|
||||||
static int Mch_GetQstAnsFromDB (long MchCod,unsigned QstInd);
|
static int Mch_GetQstAnsFromDB (long MchCod,unsigned QstInd);
|
||||||
|
|
||||||
static unsigned Mch_GetNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd);
|
static unsigned Mch_GetNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsigned AnsInd);
|
||||||
|
static unsigned Mch_GetNumUsrsWhoHaveAnswerMch (long MchCod);
|
||||||
static void Mch_DrawBarNumUsrs (unsigned NumAnswerersAns,unsigned NumAnswerersQst,bool Correct);
|
static void Mch_DrawBarNumUsrs (unsigned NumAnswerersAns,unsigned NumAnswerersQst,bool Correct);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -358,6 +359,7 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game,
|
||||||
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||||
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
|
extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME];
|
||||||
extern const char *Txt_Match;
|
extern const char *Txt_Match;
|
||||||
|
extern const char *Txt_Players;
|
||||||
extern const char *Txt_Status;
|
extern const char *Txt_Status;
|
||||||
extern const char *Txt_Play;
|
extern const char *Txt_Play;
|
||||||
extern const char *Txt_Resume;
|
extern const char *Txt_Resume;
|
||||||
|
@ -388,12 +390,16 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game,
|
||||||
"<th class=\"RIGHT_TOP\">"
|
"<th class=\"RIGHT_TOP\">"
|
||||||
"%s"
|
"%s"
|
||||||
"</th>"
|
"</th>"
|
||||||
|
"<th class=\"RIGHT_TOP\">"
|
||||||
|
"%s"
|
||||||
|
"</th>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_No_INDEX,
|
Txt_No_INDEX,
|
||||||
Txt_ROLES_SINGUL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],
|
Txt_ROLES_SINGUL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],
|
||||||
Txt_START_END_TIME[Gam_ORDER_BY_START_DATE],
|
Txt_START_END_TIME[Gam_ORDER_BY_START_DATE],
|
||||||
Txt_START_END_TIME[Gam_ORDER_BY_END_DATE],
|
Txt_START_END_TIME[Gam_ORDER_BY_END_DATE],
|
||||||
Txt_Match,
|
Txt_Match,
|
||||||
|
Txt_Players,
|
||||||
Txt_Status);
|
Txt_Status);
|
||||||
|
|
||||||
/***** Write rows *****/
|
/***** Write rows *****/
|
||||||
|
@ -471,6 +477,13 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game,
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
|
/***** 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));
|
||||||
|
|
||||||
/***** Match status ******/
|
/***** Match status ******/
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_TOP COLOR%u\">",Gbl.RowEvenOdd);
|
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_TOP COLOR%u\">",Gbl.RowEvenOdd);
|
||||||
|
|
||||||
|
@ -2330,7 +2343,7 @@ void Mch_GetAndDrawBarNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsig
|
||||||
unsigned Mch_GetNumUsrsWhoHaveAnswerQst (long MchCod,unsigned QstInd)
|
unsigned Mch_GetNumUsrsWhoHaveAnswerQst (long MchCod,unsigned QstInd)
|
||||||
{
|
{
|
||||||
/***** Get number of users who have answered
|
/***** Get number of users who have answered
|
||||||
a question in a match from database *****/
|
a question in match from database *****/
|
||||||
return
|
return
|
||||||
(unsigned) DB_QueryCOUNT ("can not get number of users who hasve answered a question",
|
(unsigned) DB_QueryCOUNT ("can not get number of users who hasve answered a question",
|
||||||
"SELECT COUNT(*) FROM mch_answers"
|
"SELECT COUNT(*) FROM mch_answers"
|
||||||
|
@ -2353,6 +2366,21 @@ static unsigned Mch_GetNumUsrsWhoHaveChosenAns (long MchCod,unsigned QstInd,unsi
|
||||||
MchCod,QstInd,AnsInd);
|
MchCod,QstInd,AnsInd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/****** Get number of users who have answered any question in a match ********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static unsigned Mch_GetNumUsrsWhoHaveAnswerMch (long MchCod)
|
||||||
|
{
|
||||||
|
/***** Get number of users who have answered
|
||||||
|
any question in match from database *****/
|
||||||
|
return
|
||||||
|
(unsigned) DB_QueryCOUNT ("can not get number of users who hasve answered a match",
|
||||||
|
"SELECT COUNT(DISTINCT UsrCod) FROM mch_answers"
|
||||||
|
" WHERE MchCod=%ld",
|
||||||
|
MchCod);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Draw a bar with the percentage of answers *****************/
|
/***************** Draw a bar with the percentage of answers *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user