mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-01 06:15:31 +02:00
Version18.143
This commit is contained in:
parent
bbd30962ce
commit
bb06a558ea
|
@ -90,7 +90,7 @@ a:hover /* Default ==> underlined */
|
|||
{
|
||||
text-decoration:underline;
|
||||
}
|
||||
.TAB_OFF a, .TAB_ON a, .MENU_LIST_ITEM a /* Tabs and menus are the exceptions */
|
||||
.TAB_OFF a, .TAB_ON a, .MENU_LIST_ITEM a, .CONTEXT_OPT a /* Tabs and menus are the exceptions */
|
||||
{
|
||||
text-decoration:none;
|
||||
}
|
||||
|
@ -2621,6 +2621,12 @@ a:hover img.CENTRE_PHOTO_SHOW
|
|||
text-align:center;
|
||||
vertical-align:top;
|
||||
}
|
||||
.MATCH_SHOW_RESULTS
|
||||
{
|
||||
text-align:center;
|
||||
padding-bottom:16pt;
|
||||
font-size:13pt;
|
||||
}
|
||||
.MATCH_NUM_PLAYERS
|
||||
{
|
||||
text-align:center;
|
||||
|
|
|
@ -640,6 +640,7 @@ CREATE TABLE IF NOT EXISTS gam_matches (
|
|||
QstCod INT NOT NULL DEFAULT -1,
|
||||
QstStartTime DATETIME NOT NULL,
|
||||
ShowingAnswers ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
ShowResults ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
UNIQUE INDEX(MchCod),
|
||||
INDEX(GamCod));
|
||||
--
|
||||
|
|
|
@ -617,6 +617,7 @@ Assessment:
|
|||
NEW. ActShoAnsMchTch Show full current question, including answers, when playing a match (by a teacher)
|
||||
NEW. ActPrvQstMchTch Show previous question when playing a match (by a teacher)
|
||||
457. ActNxtQstMchTch Show next question when playing a match (by a teacher)
|
||||
NEW. ActChgDisResMchTch Change display of results when playing a match (by a teacher)
|
||||
NEW. ActRefMchTch Refresh current question when playing a match (as teacher)
|
||||
NEW. ActShoMchTch Show finished match results
|
||||
|
||||
|
@ -2162,6 +2163,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
|||
/* ActShoAnsMchTch */{1793,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_ShowAnssQstMatchTch ,NULL},
|
||||
/* ActPrvQstMchTch */{1790,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_PrevQstMatchTch ,NULL},
|
||||
/* ActNxtQstMchTch */{1672,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_NextQstMatchTch ,NULL},
|
||||
/* ActChgDisResMchTch*/{1794,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Gam_GetMatchBeingPlayed ,Gam_CurrQstMatchTch ,NULL},
|
||||
/* ActRefMchTch */{1788,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_AJAX_RFRESH,Gam_GetMatchBeingPlayed ,Gam_RefreshMatchTch ,NULL},
|
||||
/* ActShoMchTch */{1786,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_ShowFinishedMatchResults ,NULL},
|
||||
|
||||
|
@ -5013,6 +5015,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
|
|||
ActPauMchTch, // #1791
|
||||
ActShoSteMchTch, // #1792
|
||||
ActShoAnsMchTch, // #1793
|
||||
ActChgDisResMchTch, // #1794
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -64,9 +64,9 @@ typedef enum
|
|||
|
||||
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||
|
||||
#define Act_NUM_ACTIONS (1 + 4 + 64 + 38 + 12 + 42 + 36 + 19 + 110 + 174 + 437 + 176 + 169 + 16 + 68)
|
||||
#define Act_NUM_ACTIONS (1 + 4 + 64 + 38 + 12 + 42 + 36 + 19 + 110 + 175 + 437 + 176 + 169 + 16 + 68)
|
||||
|
||||
#define Act_MAX_ACTION_COD 1793
|
||||
#define Act_MAX_ACTION_COD 1794
|
||||
|
||||
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
|
||||
|
||||
|
@ -618,55 +618,56 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
|
|||
#define ActShoAnsMchTch (ActChgCrsTT1stDay + 125)
|
||||
#define ActPrvQstMchTch (ActChgCrsTT1stDay + 126)
|
||||
#define ActNxtQstMchTch (ActChgCrsTT1stDay + 127)
|
||||
#define ActRefMchTch (ActChgCrsTT1stDay + 128)
|
||||
#define ActShoMchTch (ActChgCrsTT1stDay + 129)
|
||||
#define ActPlyMchStd (ActChgCrsTT1stDay + 130)
|
||||
#define ActRefMchStd (ActChgCrsTT1stDay + 131)
|
||||
#define ActAnsMchQstStd (ActChgCrsTT1stDay + 132)
|
||||
#define ActFrmNewGam (ActChgCrsTT1stDay + 133)
|
||||
#define ActEdiOneGam (ActChgCrsTT1stDay + 134)
|
||||
#define ActNewGam (ActChgCrsTT1stDay + 135)
|
||||
#define ActChgGam (ActChgCrsTT1stDay + 136)
|
||||
#define ActReqRemGam (ActChgCrsTT1stDay + 137)
|
||||
#define ActRemGam (ActChgCrsTT1stDay + 138)
|
||||
#define ActReqRstGam (ActChgCrsTT1stDay + 139)
|
||||
#define ActRstGam (ActChgCrsTT1stDay + 140)
|
||||
#define ActHidGam (ActChgCrsTT1stDay + 141)
|
||||
#define ActShoGam (ActChgCrsTT1stDay + 142)
|
||||
#define ActAddOneGamQst (ActChgCrsTT1stDay + 143)
|
||||
#define ActGamLstTstQst (ActChgCrsTT1stDay + 144)
|
||||
#define ActAddTstQstToGam (ActChgCrsTT1stDay + 145)
|
||||
#define ActReqRemGamQst (ActChgCrsTT1stDay + 146)
|
||||
#define ActRemGamQst (ActChgCrsTT1stDay + 147)
|
||||
#define ActUp_GamQst (ActChgCrsTT1stDay + 148)
|
||||
#define ActDwnGamQst (ActChgCrsTT1stDay + 149)
|
||||
#define ActChgDisResMchTch (ActChgCrsTT1stDay + 128)
|
||||
#define ActRefMchTch (ActChgCrsTT1stDay + 129)
|
||||
#define ActShoMchTch (ActChgCrsTT1stDay + 130)
|
||||
#define ActPlyMchStd (ActChgCrsTT1stDay + 131)
|
||||
#define ActRefMchStd (ActChgCrsTT1stDay + 132)
|
||||
#define ActAnsMchQstStd (ActChgCrsTT1stDay + 133)
|
||||
#define ActFrmNewGam (ActChgCrsTT1stDay + 134)
|
||||
#define ActEdiOneGam (ActChgCrsTT1stDay + 135)
|
||||
#define ActNewGam (ActChgCrsTT1stDay + 136)
|
||||
#define ActChgGam (ActChgCrsTT1stDay + 137)
|
||||
#define ActReqRemGam (ActChgCrsTT1stDay + 138)
|
||||
#define ActRemGam (ActChgCrsTT1stDay + 139)
|
||||
#define ActReqRstGam (ActChgCrsTT1stDay + 140)
|
||||
#define ActRstGam (ActChgCrsTT1stDay + 141)
|
||||
#define ActHidGam (ActChgCrsTT1stDay + 142)
|
||||
#define ActShoGam (ActChgCrsTT1stDay + 143)
|
||||
#define ActAddOneGamQst (ActChgCrsTT1stDay + 144)
|
||||
#define ActGamLstTstQst (ActChgCrsTT1stDay + 145)
|
||||
#define ActAddTstQstToGam (ActChgCrsTT1stDay + 146)
|
||||
#define ActReqRemGamQst (ActChgCrsTT1stDay + 147)
|
||||
#define ActRemGamQst (ActChgCrsTT1stDay + 148)
|
||||
#define ActUp_GamQst (ActChgCrsTT1stDay + 149)
|
||||
#define ActDwnGamQst (ActChgCrsTT1stDay + 150)
|
||||
|
||||
#define ActSeeSvy (ActChgCrsTT1stDay + 150)
|
||||
#define ActAnsSvy (ActChgCrsTT1stDay + 151)
|
||||
#define ActFrmNewSvy (ActChgCrsTT1stDay + 152)
|
||||
#define ActEdiOneSvy (ActChgCrsTT1stDay + 153)
|
||||
#define ActNewSvy (ActChgCrsTT1stDay + 154)
|
||||
#define ActChgSvy (ActChgCrsTT1stDay + 155)
|
||||
#define ActReqRemSvy (ActChgCrsTT1stDay + 156)
|
||||
#define ActRemSvy (ActChgCrsTT1stDay + 157)
|
||||
#define ActReqRstSvy (ActChgCrsTT1stDay + 158)
|
||||
#define ActRstSvy (ActChgCrsTT1stDay + 159)
|
||||
#define ActHidSvy (ActChgCrsTT1stDay + 160)
|
||||
#define ActShoSvy (ActChgCrsTT1stDay + 161)
|
||||
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 162)
|
||||
#define ActRcvSvyQst (ActChgCrsTT1stDay + 163)
|
||||
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 164)
|
||||
#define ActRemSvyQst (ActChgCrsTT1stDay + 165)
|
||||
#define ActSeeSvy (ActChgCrsTT1stDay + 151)
|
||||
#define ActAnsSvy (ActChgCrsTT1stDay + 152)
|
||||
#define ActFrmNewSvy (ActChgCrsTT1stDay + 153)
|
||||
#define ActEdiOneSvy (ActChgCrsTT1stDay + 154)
|
||||
#define ActNewSvy (ActChgCrsTT1stDay + 155)
|
||||
#define ActChgSvy (ActChgCrsTT1stDay + 156)
|
||||
#define ActReqRemSvy (ActChgCrsTT1stDay + 157)
|
||||
#define ActRemSvy (ActChgCrsTT1stDay + 158)
|
||||
#define ActReqRstSvy (ActChgCrsTT1stDay + 159)
|
||||
#define ActRstSvy (ActChgCrsTT1stDay + 160)
|
||||
#define ActHidSvy (ActChgCrsTT1stDay + 161)
|
||||
#define ActShoSvy (ActChgCrsTT1stDay + 162)
|
||||
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 163)
|
||||
#define ActRcvSvyQst (ActChgCrsTT1stDay + 164)
|
||||
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 165)
|
||||
#define ActRemSvyQst (ActChgCrsTT1stDay + 166)
|
||||
|
||||
#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 166)
|
||||
#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 167)
|
||||
#define ActEdiExaAnn (ActChgCrsTT1stDay + 168)
|
||||
#define ActRcvExaAnn (ActChgCrsTT1stDay + 169)
|
||||
#define ActPrnExaAnn (ActChgCrsTT1stDay + 170)
|
||||
#define ActReqRemExaAnn (ActChgCrsTT1stDay + 171)
|
||||
#define ActRemExaAnn (ActChgCrsTT1stDay + 172)
|
||||
#define ActHidExaAnn (ActChgCrsTT1stDay + 173)
|
||||
#define ActShoExaAnn (ActChgCrsTT1stDay + 174)
|
||||
#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 167)
|
||||
#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 168)
|
||||
#define ActEdiExaAnn (ActChgCrsTT1stDay + 169)
|
||||
#define ActRcvExaAnn (ActChgCrsTT1stDay + 170)
|
||||
#define ActPrnExaAnn (ActChgCrsTT1stDay + 171)
|
||||
#define ActReqRemExaAnn (ActChgCrsTT1stDay + 172)
|
||||
#define ActRemExaAnn (ActChgCrsTT1stDay + 173)
|
||||
#define ActHidExaAnn (ActChgCrsTT1stDay + 174)
|
||||
#define ActShoExaAnn (ActChgCrsTT1stDay + 175)
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************** Files tab **********************************/
|
||||
|
|
|
@ -460,10 +460,15 @@ En OpenSWAD:
|
|||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.142.3 (2019-09-10)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.143 (2019-09-10)"
|
||||
#define CSS_FILE "swad18.138.css"
|
||||
#define JS_FILE "swad18.130.2.js"
|
||||
/*
|
||||
Version 18.143: Sep 10, 2019 Checkbox to show results in matches. (244543 lines)
|
||||
2 changes necessary in database:
|
||||
ALTER TABLE gam_matches ADD COLUMN ShowResults ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER ShowingAnswers;
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1794','es','N','Cambiar presentación de resultados en partida (como profesor)');
|
||||
|
||||
Version 18.142.3: Sep 10, 2019 Animation on teacher's screen when match paused.
|
||||
Code refactoring in matches. (244454 lines)
|
||||
Version 18.142.2: Sep 10, 2019 Elapsed time in question not shown in start and end. (244391 lines)
|
||||
|
|
|
@ -1382,8 +1382,9 @@ mysql> DESCRIBE gam_matches;
|
|||
| QstCod | int(11) | NO | | -1 | |
|
||||
| QstStartTime | datetime | NO | | NULL | |
|
||||
| ShowingAnswers | enum('N','Y') | NO | | N | |
|
||||
| ShowResults | enum('N','Y') | NO | | N | |
|
||||
+----------------+---------------+------+-----+---------+----------------+
|
||||
10 rows in set (0.00 sec)
|
||||
11 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS gam_matches ("
|
||||
"MchCod INT NOT NULL AUTO_INCREMENT,"
|
||||
|
@ -1396,6 +1397,7 @@ mysql> DESCRIBE gam_matches;
|
|||
"QstCod INT NOT NULL DEFAULT -1,"
|
||||
"QstStartTime DATETIME NOT NULL,"
|
||||
"ShowingAnswers ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"ShowResults ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"UNIQUE INDEX(MchCod),"
|
||||
"INDEX(GamCod)");
|
||||
|
||||
|
|
119
swad_game.c
119
swad_game.c
|
@ -114,6 +114,7 @@ struct Match
|
|||
long QstCod;
|
||||
time_t QstStartTimeUTC;
|
||||
bool ShowingAnswers;
|
||||
bool ShowResults;
|
||||
bool BeingPlayed;
|
||||
unsigned NumPlayers;
|
||||
} Status;
|
||||
|
@ -223,7 +224,8 @@ static void Gam_ShowMatchStatusForTch (struct Match *Match);
|
|||
static void Gam_ShowMatchStatusForStd (struct Match *Match);
|
||||
static void Gam_ShowLeftColumnTch (struct Match *Match);
|
||||
static void Gam_ShowLeftColumnStd (struct Match *Match);
|
||||
static void Gam_ShowButtons (struct Match *Match);
|
||||
static void Gam_PutMatchControlButtons (struct Match *Match);
|
||||
static void Gam_PutCheckboxResult (struct Match *Match);
|
||||
static void Gam_ShowNumQstInGame (struct Match *Match);
|
||||
static void Gam_ShowNumPlayers (struct Match *Match);
|
||||
static void Gam_ShowMatchTitle (struct Match *Match);
|
||||
|
@ -2701,7 +2703,8 @@ static void Gam_ListMatches (struct Game *Game,bool PutFormNewMatch)
|
|||
"QstInd," // row[ 6]
|
||||
"QstCod," // row[ 7]
|
||||
"UNIX_TIMESTAMP(QstStartTime)," // row[ 8]
|
||||
"ShowingAnswers" // row[ 9]
|
||||
"ShowingAnswers," // row[ 9]
|
||||
"ShowResults" // row[10]
|
||||
" FROM gam_matches"
|
||||
" WHERE GamCod=%ld%s"
|
||||
" ORDER BY MchCod",
|
||||
|
@ -2762,7 +2765,8 @@ void Gam_GetDataOfMatchByCod (struct Match *Match)
|
|||
"QstInd," // row[ 6]
|
||||
"QstCod," // row[ 7]
|
||||
"UNIX_TIMESTAMP(QstStartTime)," // row[ 8]
|
||||
"ShowingAnswers" // row[ 9]
|
||||
"ShowingAnswers," // row[ 9]
|
||||
"ShowResults" // row[10]
|
||||
" FROM gam_matches"
|
||||
" WHERE MchCod=%ld"
|
||||
" AND GamCod IN" // Extra check
|
||||
|
@ -2786,6 +2790,7 @@ void Gam_GetDataOfMatchByCod (struct Match *Match)
|
|||
Match->Status.QstCod = -1L;
|
||||
Match->Status.QstStartTimeUTC = (time_t) 0;
|
||||
Match->Status.ShowingAnswers = false;
|
||||
Match->Status.ShowResults = false;
|
||||
Match->Status.BeingPlayed = false;
|
||||
}
|
||||
|
||||
|
@ -3027,6 +3032,7 @@ static void Gam_GetMatchDataFromRow (MYSQL_RES *mysql_res,
|
|||
row[ 7] QstCod
|
||||
row[ 8] UNIX_TIMESTAMP(QstStartTime)
|
||||
row[ 9] ShowingAnswers
|
||||
row[10] ShowResults
|
||||
*/
|
||||
/* Current question index (row[6]) */
|
||||
Match->Status.QstInd = Gam_GetQstIndFromStr (row[6]);
|
||||
|
@ -3040,6 +3046,9 @@ static void Gam_GetMatchDataFromRow (MYSQL_RES *mysql_res,
|
|||
/* Get whether to show question answers or not (row(9)) */
|
||||
Match->Status.ShowingAnswers = (row[9][0] == 'Y');
|
||||
|
||||
/* Get whether to show results or not (row(10)) */
|
||||
Match->Status.ShowResults = (row[10][0] == 'Y');
|
||||
|
||||
/***** Get whether the match is being played or not *****/
|
||||
if (Match->Status.QstInd >= Gam_AFTER_LAST_QUESTION) // Finished
|
||||
Match->Status.BeingPlayed = false;
|
||||
|
@ -3324,7 +3333,8 @@ static long Gam_CreateMatch (long GamCod,char Title[Gam_MAX_BYTES_TITLE + 1])
|
|||
MchCod = DB_QueryINSERTandReturnCode ("can not create match",
|
||||
"INSERT gam_matches"
|
||||
" (GamCod,UsrCod,StartTime,EndTime,Title,"
|
||||
"QstInd,QstCod,QstStartTime,ShowingAnswers)"
|
||||
"QstInd,QstCod,QstStartTime,"
|
||||
"ShowingAnswers,ShowResults)"
|
||||
" VALUES"
|
||||
" (%ld," // GamCod
|
||||
"%ld," // UsrCod
|
||||
|
@ -3334,7 +3344,8 @@ static long Gam_CreateMatch (long GamCod,char Title[Gam_MAX_BYTES_TITLE + 1])
|
|||
"0," // QstInd: Match has not started, so not the first question yet
|
||||
"-1," // QstCod: Non-existent question
|
||||
"NOW()," // QstStartTime
|
||||
"'N')", // ShowingAnswers: Don't show answers initially
|
||||
"'N'," // ShowingAnswers: Don't show answers initially
|
||||
"'N')", // ShowResults: Don't show results initially
|
||||
GamCod,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod, // Game creator
|
||||
Title);
|
||||
|
@ -3359,13 +3370,16 @@ static void Gam_UpdateMatchStatusInDB (struct Match *Match)
|
|||
"gam_matches.QstInd=%u,"
|
||||
"gam_matches.QstCod=%ld,"
|
||||
"gam_matches.QstStartTime=NOW(),"
|
||||
"gam_matches.ShowingAnswers='%c'"
|
||||
"gam_matches.ShowingAnswers='%c',"
|
||||
"gam_matches.ShowResults='%c'"
|
||||
" WHERE gam_matches.MchCod=%ld"
|
||||
" AND gam_matches.GamCod=games.GamCod"
|
||||
" AND games.CrsCod=%ld", // Extra check
|
||||
Match->Status.QstInd,Match->Status.QstCod,
|
||||
Match->Status.ShowingAnswers ? 'Y' :
|
||||
'N',
|
||||
Match->Status.ShowResults ? 'Y' :
|
||||
'N',
|
||||
Match->MchCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||
|
||||
if (Match->Status.BeingPlayed)
|
||||
|
@ -3589,7 +3603,7 @@ void Gam_ShowAnssQstMatchTch (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Show previous match status (previous question, answers...) (by a teacher) */
|
||||
/************* Show previous question in a match (by a teacher) **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Gam_PrevQstMatchTch (void)
|
||||
|
@ -3617,7 +3631,7 @@ void Gam_PrevQstMatchTch (void)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***** Show next match status (next question, answers...) (by a teacher) *****/
|
||||
/*************** Show next question in a match (by a teacher) ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Gam_NextQstMatchTch (void)
|
||||
|
@ -3644,6 +3658,35 @@ void Gam_NextQstMatchTch (void)
|
|||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************** Show current question in a match (by a teacher) **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Gam_CurrQstMatchTch (void)
|
||||
{
|
||||
struct Match Match;
|
||||
|
||||
/***** Remove old players.
|
||||
This function must be called before getting match status. *****/
|
||||
Gam_RemoveOldPlayers ();
|
||||
|
||||
/***** Get data of the match from database *****/
|
||||
Match.MchCod = Gbl.Games.MchCodBeingPlayed;
|
||||
Gam_GetDataOfMatchByCod (&Match);
|
||||
|
||||
/***** Get if results should be displayed *****/
|
||||
// Match.Status.ShowResults = Par_GetParToBool ("ShowResults");
|
||||
Match.Status.ShowResults = !Match.Status.ShowResults;
|
||||
|
||||
/***** Update match status in database *****/
|
||||
Gam_UpdateMatchStatusInDB (&Match);
|
||||
|
||||
/***** Show current match status *****/
|
||||
fprintf (Gbl.F.Out,"<div id=\"game\" class=\"MATCH_CONT\">");
|
||||
Gam_ShowMatchStatusForTch (&Match);
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************* Set match status to previous question *******************/
|
||||
/*****************************************************************************/
|
||||
|
@ -3803,7 +3846,10 @@ static void Gam_ShowLeftColumnTch (struct Match *Match)
|
|||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/***** Buttons *****/
|
||||
Gam_ShowButtons (Match);
|
||||
Gam_PutMatchControlButtons (Match);
|
||||
|
||||
/***** Checkbox to show results *****/
|
||||
Gam_PutCheckboxResult (Match);
|
||||
|
||||
/***** Number of players *****/
|
||||
Gam_ShowNumPlayers (Match);
|
||||
|
@ -3845,10 +3891,10 @@ static void Gam_ShowLeftColumnStd (struct Match *Match)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Show buttons to control a match ***********************/
|
||||
/********************** Put buttons to control a match ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Gam_ShowButtons (struct Match *Match)
|
||||
static void Gam_PutMatchControlButtons (struct Match *Match)
|
||||
{
|
||||
extern const char *Txt_Stem;
|
||||
extern const char *Txt_MATCH_Start;
|
||||
|
@ -3862,10 +3908,10 @@ static void Gam_ShowButtons (struct Match *Match)
|
|||
unsigned PrvQstInd; // Previous question index
|
||||
unsigned NxtQstInd; // Next question index
|
||||
|
||||
/* Start buttons container */
|
||||
/***** Start buttons container *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BUTTONS_CONTAINER\">");
|
||||
|
||||
/* Left button */
|
||||
/***** Left button *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BUTTON_LEFT_CONTAINER\">");
|
||||
if (Match->Status.QstInd < Gam_AFTER_LAST_QUESTION) // Unfinished
|
||||
{
|
||||
|
@ -3906,7 +3952,7 @@ static void Gam_ShowButtons (struct Match *Match)
|
|||
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* Center button */
|
||||
/***** Center button *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BUTTON_CENTER_CONTAINER\">");
|
||||
if (Match->Status.BeingPlayed)
|
||||
/* Put button to pause match */
|
||||
|
@ -3926,7 +3972,7 @@ static void Gam_ShowButtons (struct Match *Match)
|
|||
}
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* Right button */
|
||||
/***** Right button *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_BUTTON_RIGHT_CONTAINER\">");
|
||||
if (Match->Status.QstInd >= Gam_AFTER_LAST_QUESTION) // Finished
|
||||
/* Put button to close browser tab */
|
||||
|
@ -3962,7 +4008,48 @@ static void Gam_ShowButtons (struct Match *Match)
|
|||
}
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
|
||||
/* End buttons container */
|
||||
/***** End buttons container *****/
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Put checkbox to select if show results ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Gam_PutCheckboxResult (struct Match *Match)
|
||||
{
|
||||
extern const char *Txt_View_results;
|
||||
|
||||
/***** Start container *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"MATCH_SHOW_RESULTS\">");
|
||||
|
||||
/***** Start form *****/
|
||||
Frm_StartForm (ActChgDisResMchTch);
|
||||
Gam_PutParamMatchCod (Match->MchCod); // Current match being played
|
||||
|
||||
/***** Put icon with link *****/
|
||||
/* Submitting onmousedown instead of default onclick
|
||||
is necessary in order to be fast
|
||||
and not lose clicks due to refresh */
|
||||
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_OPT\">"
|
||||
"<a href=\"\" class=\"ICO_HIGHLIGHT\""
|
||||
" title=\"%s\" "
|
||||
" onmousedown=\"document.getElementById('%s').submit();"
|
||||
" return false;\">"
|
||||
"<i class=\"%s\"></i>"
|
||||
" %s"
|
||||
"</a>"
|
||||
"</div>",
|
||||
Txt_View_results,
|
||||
Gbl.Form.Id,
|
||||
Match->Status.ShowResults ? "fas fa-toggle-on" :
|
||||
"fas fa-toggle-off",
|
||||
Txt_View_results);
|
||||
|
||||
/***** End form *****/
|
||||
Frm_EndForm ();
|
||||
|
||||
/***** End container *****/
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ void Gam_ShowStemQstMatchTch (void);
|
|||
void Gam_ShowAnssQstMatchTch (void);
|
||||
void Gam_PrevQstMatchTch (void);
|
||||
void Gam_NextQstMatchTch (void);
|
||||
void Gam_CurrQstMatchTch (void);
|
||||
|
||||
void Gam_ShowFinishedMatchResults (void);
|
||||
|
||||
|
|
|
@ -702,6 +702,7 @@ static void Lay_WriteScriptInit (void)
|
|||
case ActShoAnsMchTch:
|
||||
case ActPrvQstMchTch:
|
||||
case ActNxtQstMchTch:
|
||||
case ActChgDisResMchTch:
|
||||
case ActPlyMchStd:
|
||||
case ActAnsMchQstStd:
|
||||
RefreshGame = true;
|
||||
|
@ -826,6 +827,7 @@ static void Lay_WriteScriptParamsAJAX (void)
|
|||
case ActShoAnsMchTch:
|
||||
case ActPrvQstMchTch:
|
||||
case ActNxtQstMchTch:
|
||||
case ActChgDisResMchTch:
|
||||
fprintf (Gbl.F.Out,"var RefreshParamNxtActGam = \"act=%ld\";\n"
|
||||
"var RefreshParamMchCod = \"MchCod=%ld\";\n",
|
||||
Act_GetActCod (ActRefMchTch),
|
||||
|
|
44
swad_text.c
44
swad_text.c
|
@ -52722,28 +52722,7 @@ const char *Txt_View_game =
|
|||
#elif L==9 // pt
|
||||
"Ver jogo";
|
||||
#endif
|
||||
/*
|
||||
const char *Txt_View_game_results =
|
||||
#if L==1 // ca
|
||||
"Veure resultats";
|
||||
#elif L==2 // de
|
||||
"Anzeigen Ergebnisse";
|
||||
#elif L==3 // en
|
||||
"View game results";
|
||||
#elif L==4 // es
|
||||
"Ver resultados";
|
||||
#elif L==5 // fr
|
||||
"Voir résultats";
|
||||
#elif L==6 // gn
|
||||
"Ver resultados"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Vedi risultati";
|
||||
#elif L==8 // pl
|
||||
"Wyświetl wyniki ankiety";
|
||||
#elif L==9 // pt
|
||||
"Ver resultados";
|
||||
#endif
|
||||
*/
|
||||
|
||||
const char *Txt_View_in_a_new_window =
|
||||
#if L==1 // ca
|
||||
"Mostrar en una finestra nova";
|
||||
|
@ -52828,6 +52807,27 @@ const char *Txt_View_records =
|
|||
"Ver cartões";
|
||||
#endif
|
||||
|
||||
const char *Txt_View_results =
|
||||
#if L==1 // ca
|
||||
"Veure resultats";
|
||||
#elif L==2 // de
|
||||
"Anzeigen Ergebnisse";
|
||||
#elif L==3 // en
|
||||
"View results";
|
||||
#elif L==4 // es
|
||||
"Ver resultados";
|
||||
#elif L==5 // fr
|
||||
"Voir résultats";
|
||||
#elif L==6 // gn
|
||||
"Ver resultados"; // Okoteve traducción
|
||||
#elif L==7 // it
|
||||
"Vedi risultati";
|
||||
#elif L==8 // pl
|
||||
"Wyświetl wyniki ankiety";
|
||||
#elif L==9 // pt
|
||||
"Ver resultados";
|
||||
#endif
|
||||
|
||||
const char *Txt_View_survey =
|
||||
#if L==1 // ca
|
||||
"Veure enquesta";
|
||||
|
|
Loading…
Reference in New Issue
Block a user