mirror of https://github.com/acanas/swad-core.git
Version 23.55: Jan 16, 2024 Responsive design in exams. Changes in exam sessions and matches.
This commit is contained in:
parent
1ae3517481
commit
3a5446a560
|
@ -1779,7 +1779,7 @@ a:hover img.CENTER_PHOTO_SHOW
|
||||||
.PRG_DATE
|
.PRG_DATE
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
max-width:80px;
|
max-width:72px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
}
|
}
|
||||||
|
@ -1798,7 +1798,7 @@ a:hover img.CENTER_PHOTO_SHOW
|
||||||
.PRG_DATE
|
.PRG_DATE
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
max-width:132px;
|
max-width:120px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
}
|
}
|
||||||
|
@ -1813,7 +1813,7 @@ a:hover img.CENTER_PHOTO_SHOW
|
||||||
.PRG_DATE
|
.PRG_DATE
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
max-width:132px;
|
max-width:120px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
}
|
}
|
||||||
|
@ -2216,7 +2216,6 @@ a:hover img.CENTER_PHOTO_SHOW
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
width:100%;
|
width:100%;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
vertical-align:middle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.FRAME
|
.FRAME
|
||||||
|
@ -3258,21 +3257,21 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
||||||
.REC_C1_BOT
|
.REC_C1_BOT
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
width:170px;
|
width:150px;
|
||||||
max-width:170px;
|
max-width:150px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
.REC_C2_BOT
|
.REC_C2_BOT
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
width:366px;
|
width:386px;
|
||||||
max-width:366px;
|
max-width:386px;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
.REC_C2_BOT_INPUT
|
.REC_C2_BOT_INPUT
|
||||||
{
|
{
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
width:362px;
|
width:382px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3427,48 +3426,48 @@ legend {font-size:12pt;}
|
||||||
.DATE_RED_PURPLE,
|
.DATE_RED_PURPLE,
|
||||||
.DATE_RED_BLUE,
|
.DATE_RED_BLUE,
|
||||||
.DATE_RED_YELLOW,
|
.DATE_RED_YELLOW,
|
||||||
.DATE_RED_PINK {color:#660000; font-size:12pt;}
|
.DATE_RED_PINK {color:#660000; font-size:10pt;}
|
||||||
.DATE_RED_DARK {color:#f98a8a; font-size:12pt;}
|
.DATE_RED_DARK {color:#f98a8a; font-size:10pt;}
|
||||||
|
|
||||||
.DATE_RED_LIGHT_WHITE,
|
.DATE_RED_LIGHT_WHITE,
|
||||||
.DATE_RED_LIGHT_GREY,
|
.DATE_RED_LIGHT_GREY,
|
||||||
.DATE_RED_LIGHT_PURPLE,
|
.DATE_RED_LIGHT_PURPLE,
|
||||||
.DATE_RED_LIGHT_BLUE,
|
.DATE_RED_LIGHT_BLUE,
|
||||||
.DATE_RED_LIGHT_YELLOW,
|
.DATE_RED_LIGHT_YELLOW,
|
||||||
.DATE_RED_LIGHT_PINK {color:rgba(102, 0, 0,0.3); font-size:12pt;}
|
.DATE_RED_LIGHT_PINK {color:rgba(102, 0, 0,0.3); font-size:10pt;}
|
||||||
.DATE_RED_LIGHT_DARK {color:rgba(249,138,138,0.3); font-size:12pt;}
|
.DATE_RED_LIGHT_DARK {color:rgba(249,138,138,0.3); font-size:10pt;}
|
||||||
|
|
||||||
.DATE_GREEN_WHITE,
|
.DATE_GREEN_WHITE,
|
||||||
.DATE_GREEN_GREY,
|
.DATE_GREEN_GREY,
|
||||||
.DATE_GREEN_PURPLE,
|
.DATE_GREEN_PURPLE,
|
||||||
.DATE_GREEN_BLUE,
|
.DATE_GREEN_BLUE,
|
||||||
.DATE_GREEN_YELLOW,
|
.DATE_GREEN_YELLOW,
|
||||||
.DATE_GREEN_PINK {color:#246600; font-size:12pt;}
|
.DATE_GREEN_PINK {color:#246600; font-size:10pt;}
|
||||||
.DATE_GREEN_DARK {color:#80c040; font-size:12pt;}
|
.DATE_GREEN_DARK {color:#80c040; font-size:10pt;}
|
||||||
|
|
||||||
.DATE_GREEN_LIGHT_WHITE,
|
.DATE_GREEN_LIGHT_WHITE,
|
||||||
.DATE_GREEN_LIGHT_GREY,
|
.DATE_GREEN_LIGHT_GREY,
|
||||||
.DATE_GREEN_LIGHT_PURPLE,
|
.DATE_GREEN_LIGHT_PURPLE,
|
||||||
.DATE_GREEN_LIGHT_BLUE,
|
.DATE_GREEN_LIGHT_BLUE,
|
||||||
.DATE_GREEN_LIGHT_YELLOW,
|
.DATE_GREEN_LIGHT_YELLOW,
|
||||||
.DATE_GREEN_LIGHT_PINK {color:rgba( 36,100, 0,0.3); font-size:12pt;}
|
.DATE_GREEN_LIGHT_PINK {color:rgba( 36,100, 0,0.3); font-size:10pt;}
|
||||||
.DATE_GREEN_LIGHT_DARK {color:rgba(128,196, 64,0.3); font-size:12pt;}
|
.DATE_GREEN_LIGHT_DARK {color:rgba(128,196, 64,0.3); font-size:10pt;}
|
||||||
|
|
||||||
.DATE_BLUE_WHITE,
|
.DATE_BLUE_WHITE,
|
||||||
.DATE_BLUE_GREY,
|
.DATE_BLUE_GREY,
|
||||||
.DATE_BLUE_PURPLE,
|
.DATE_BLUE_PURPLE,
|
||||||
.DATE_BLUE_BLUE,
|
.DATE_BLUE_BLUE,
|
||||||
.DATE_BLUE_YELLOW,
|
.DATE_BLUE_YELLOW,
|
||||||
.DATE_BLUE_PINK {color:#4d88a1; font-size:12pt;}
|
.DATE_BLUE_PINK {color:#4d88a1; font-size:10pt;}
|
||||||
.DATE_BLUE_DARK {color:#afc4cc; font-size:12pt;}
|
.DATE_BLUE_DARK {color:#afc4cc; font-size:10pt;}
|
||||||
|
|
||||||
.DATE_BLUE_LIGHT_WHITE,
|
.DATE_BLUE_LIGHT_WHITE,
|
||||||
.DATE_BLUE_LIGHT_GREY,
|
.DATE_BLUE_LIGHT_GREY,
|
||||||
.DATE_BLUE_LIGHT_PURPLE,
|
.DATE_BLUE_LIGHT_PURPLE,
|
||||||
.DATE_BLUE_LIGHT_BLUE,
|
.DATE_BLUE_LIGHT_BLUE,
|
||||||
.DATE_BLUE_LIGHT_YELLOW,
|
.DATE_BLUE_LIGHT_YELLOW,
|
||||||
.DATE_BLUE_LIGHT_PINK {color:rgba( 77,136,161,0.3); font-size:12pt;}
|
.DATE_BLUE_LIGHT_PINK {color:rgba( 77,136,161,0.3); font-size:10pt;}
|
||||||
.DATE_BLUE_LIGHT_DARK {color:rgba(175,196,204,0.3); font-size:12pt;}
|
.DATE_BLUE_LIGHT_DARK {color:rgba(175,196,204,0.3); font-size:10pt;}
|
||||||
|
|
||||||
.ASG_LST_DATE_GREEN_WHITE,
|
.ASG_LST_DATE_GREEN_WHITE,
|
||||||
.ASG_LST_DATE_GREEN_GREY,
|
.ASG_LST_DATE_GREEN_GREY,
|
|
@ -2073,7 +2073,7 @@ void HTM_TD_Txt_Right (const char *Txt)
|
||||||
|
|
||||||
void HTM_TD_TxtColon (const char *Txt)
|
void HTM_TD_TxtColon (const char *Txt)
|
||||||
{
|
{
|
||||||
HTM_TD_Begin ("class=\"REC_C1_BOT RT FORM_IN_%s\"",The_GetSuffix ());
|
HTM_TD_Begin ("class=\"RT FORM_IN_%s\"",The_GetSuffix ());
|
||||||
HTM_TxtColon (Txt);
|
HTM_TxtColon (Txt);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -762,7 +762,7 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
|
||||||
[ActInvSetQst ] = {1910,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_InvalidateQst ,NULL},
|
[ActInvSetQst ] = {1910,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_InvalidateQst ,NULL},
|
||||||
|
|
||||||
[ActReqNewExaSes ] = {1852,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReqCreatOrEditSes ,NULL},
|
[ActReqNewExaSes ] = {1852,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReqCreatOrEditSes ,NULL},
|
||||||
[ActEdiOneExaSes ] = {1902,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReqCreatOrEditSes ,NULL},
|
[ActReqChgExaSes ] = {1902,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReqCreatOrEditSes ,NULL},
|
||||||
[ActNewExaSes ] = {1853,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReceiveFormSession ,NULL},
|
[ActNewExaSes ] = {1853,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReceiveFormSession ,NULL},
|
||||||
[ActChgExaSes ] = {1903,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReceiveFormSession ,NULL},
|
[ActChgExaSes ] = {1903,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReceiveFormSession ,NULL},
|
||||||
[ActReqRemExaSes ] = {1850,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReqRemSession ,NULL},
|
[ActReqRemExaSes ] = {1850,-1,TabUnk,ActSeeAllExa ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSes_ReqRemSession ,NULL},
|
||||||
|
@ -789,12 +789,12 @@ const struct Act_Actions ActLst_Actions[ActLst_NUM_ACTIONS] =
|
||||||
|
|
||||||
[ActSeeOneGam ] = {1650,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_SeeOneGame ,NULL},
|
[ActSeeOneGam ] = {1650,-1,TabUnk,ActSeeAllGam ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_SeeOneGame ,NULL},
|
||||||
|
|
||||||
|
[ActReqNewMch ] = {1670,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ReqCreatOrEditMatch ,NULL},
|
||||||
|
[ActReqChgMch ] = {1913,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ReqCreatOrEditMatch ,NULL},
|
||||||
|
[ActNewMch ] = {1671,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,Mch_CreateNewMatch ,Mch_ResumeMatch ,NULL},
|
||||||
|
[ActChgMch ] = {1914,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ChangeMatch ,NULL},
|
||||||
[ActReqRemMch ] = {1783,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ReqRemMatch ,NULL},
|
[ActReqRemMch ] = {1783,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ReqRemMatch ,NULL},
|
||||||
[ActRemMch ] = {1784,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_RemoveMatch ,NULL},
|
[ActRemMch ] = {1784,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_RemoveMatch ,NULL},
|
||||||
[ActEdiMch ] = {1913,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_EditMatch ,NULL},
|
|
||||||
[ActChgMch ] = {1914,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mch_ChangeMatch ,NULL},
|
|
||||||
[ActReqNewMch ] = {1670,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Gam_ReqNewMatch ,NULL},
|
|
||||||
[ActNewMch ] = {1671,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,Mch_CreateNewMatch ,Mch_ResumeMatch ,NULL},
|
|
||||||
[ActResMch ] = {1785,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,Mch_GetMatchBeingPlayed ,Mch_ResumeMatch ,NULL},
|
[ActResMch ] = {1785,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,Mch_GetMatchBeingPlayed ,Mch_ResumeMatch ,NULL},
|
||||||
[ActBckMch ] = {1790,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Mch_GetMatchBeingPlayed ,Mch_BackMatch ,NULL},
|
[ActBckMch ] = {1790,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Mch_GetMatchBeingPlayed ,Mch_BackMatch ,NULL},
|
||||||
[ActPlyPauMch ] = {1789,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Mch_GetMatchBeingPlayed ,Mch_PlayPauseMatch ,NULL},
|
[ActPlyPauMch ] = {1789,-1,TabUnk,ActSeeAllGam ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_2ND_TAB,Mch_GetMatchBeingPlayed ,Mch_PlayPauseMatch ,NULL},
|
||||||
|
@ -3797,7 +3797,7 @@ Act_Action_t ActLst_FromActCodToAction[1 + ActLst_MAX_ACTION_COD] = // Do not re
|
||||||
ActChgNumQstExaSet, // #1899
|
ActChgNumQstExaSet, // #1899
|
||||||
ActHidExaSes, // #1900
|
ActHidExaSes, // #1900
|
||||||
ActUnhExaSes, // #1901
|
ActUnhExaSes, // #1901
|
||||||
ActEdiOneExaSes, // #1902
|
ActReqChgExaSes, // #1902
|
||||||
ActChgExaSes, // #1903
|
ActChgExaSes, // #1903
|
||||||
ActSeeExaPrn, // #1904
|
ActSeeExaPrn, // #1904
|
||||||
-1, // #1905 (obsolete action)
|
-1, // #1905 (obsolete action)
|
||||||
|
@ -3808,7 +3808,7 @@ Act_Action_t ActLst_FromActCodToAction[1 + ActLst_MAX_ACTION_COD] = // Do not re
|
||||||
ActInvSetQst, // #1910
|
ActInvSetQst, // #1910
|
||||||
ActChgRooMAC, // #1911
|
ActChgRooMAC, // #1911
|
||||||
ActLstOneGam, // #1912
|
ActLstOneGam, // #1912
|
||||||
ActEdiMch, // #1913
|
ActReqChgMch, // #1913
|
||||||
ActChgMch, // #1914
|
ActChgMch, // #1914
|
||||||
-1, // #1915 (obsolete action)
|
-1, // #1915 (obsolete action)
|
||||||
-1, // #1916 (obsolete action)
|
-1, // #1916 (obsolete action)
|
||||||
|
|
|
@ -687,7 +687,7 @@
|
||||||
#define ActInvSetQst (ActChgCrsTT1stDay + 153)
|
#define ActInvSetQst (ActChgCrsTT1stDay + 153)
|
||||||
|
|
||||||
#define ActReqNewExaSes (ActChgCrsTT1stDay + 154)
|
#define ActReqNewExaSes (ActChgCrsTT1stDay + 154)
|
||||||
#define ActEdiOneExaSes (ActChgCrsTT1stDay + 155)
|
#define ActReqChgExaSes (ActChgCrsTT1stDay + 155)
|
||||||
#define ActNewExaSes (ActChgCrsTT1stDay + 156)
|
#define ActNewExaSes (ActChgCrsTT1stDay + 156)
|
||||||
#define ActChgExaSes (ActChgCrsTT1stDay + 157)
|
#define ActChgExaSes (ActChgCrsTT1stDay + 157)
|
||||||
#define ActReqRemExaSes (ActChgCrsTT1stDay + 158)
|
#define ActReqRemExaSes (ActChgCrsTT1stDay + 158)
|
||||||
|
@ -711,12 +711,12 @@
|
||||||
#define ActChgVisExaRes (ActChgCrsTT1stDay + 174)
|
#define ActChgVisExaRes (ActChgCrsTT1stDay + 174)
|
||||||
|
|
||||||
#define ActSeeOneGam (ActChgCrsTT1stDay + 175)
|
#define ActSeeOneGam (ActChgCrsTT1stDay + 175)
|
||||||
#define ActReqRemMch (ActChgCrsTT1stDay + 176)
|
#define ActReqNewMch (ActChgCrsTT1stDay + 176)
|
||||||
#define ActRemMch (ActChgCrsTT1stDay + 177)
|
#define ActReqChgMch (ActChgCrsTT1stDay + 177)
|
||||||
#define ActEdiMch (ActChgCrsTT1stDay + 178)
|
#define ActNewMch (ActChgCrsTT1stDay + 178)
|
||||||
#define ActChgMch (ActChgCrsTT1stDay + 179)
|
#define ActChgMch (ActChgCrsTT1stDay + 179)
|
||||||
#define ActReqNewMch (ActChgCrsTT1stDay + 180)
|
#define ActReqRemMch (ActChgCrsTT1stDay + 180)
|
||||||
#define ActNewMch (ActChgCrsTT1stDay + 181)
|
#define ActRemMch (ActChgCrsTT1stDay + 181)
|
||||||
#define ActResMch (ActChgCrsTT1stDay + 182)
|
#define ActResMch (ActChgCrsTT1stDay + 182)
|
||||||
#define ActBckMch (ActChgCrsTT1stDay + 183)
|
#define ActBckMch (ActChgCrsTT1stDay + 183)
|
||||||
#define ActPlyPauMch (ActChgCrsTT1stDay + 184)
|
#define ActPlyPauMch (ActChgCrsTT1stDay + 184)
|
||||||
|
|
|
@ -633,10 +633,11 @@ Me sale este error, no s
|
||||||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 23.54 (2023-12-20)"
|
#define Log_PLATFORM_VERSION "SWAD 23.55 (2024-01-16)"
|
||||||
#define CSS_FILE "swad23.54.css"
|
#define CSS_FILE "swad23.55.css"
|
||||||
#define JS_FILE "swad23.53.6.js"
|
#define JS_FILE "swad23.53.6.js"
|
||||||
/*
|
/*
|
||||||
|
Version 23.55: Jan 16, 2024 Responsive design in exams. Changes in exam sessions and matches. (335819 lines)
|
||||||
Version 23.54: Dec 20, 2023 Responsive design in games and matches. (335906 lines)
|
Version 23.54: Dec 20, 2023 Responsive design in games and matches. (335906 lines)
|
||||||
Version 23.53.7: Dec 20, 2023 Layout changes in hierarchy edition. (335883 lines)
|
Version 23.53.7: Dec 20, 2023 Layout changes in hierarchy edition. (335883 lines)
|
||||||
Version 23.53.6: Dec 19, 2023 Responsive design in questions. (335874 lines)
|
Version 23.53.6: Dec 19, 2023 Responsive design in questions. (335874 lines)
|
||||||
|
|
|
@ -1793,7 +1793,7 @@ void Dat_WriteLocalDateHMSFromUTC (const char *Id,time_t TimeUTC,
|
||||||
static const char *SeparatorStr[Dat_NUM_SEPARATORS] =
|
static const char *SeparatorStr[Dat_NUM_SEPARATORS] =
|
||||||
{
|
{
|
||||||
[Dat_SEPARATOR_NONE ] = "",
|
[Dat_SEPARATOR_NONE ] = "",
|
||||||
[Dat_SEPARATOR_COMMA] = ", ",
|
[Dat_SEPARATOR_COMMA] = ", ",
|
||||||
[Dat_SEPARATOR_BREAK] = "<br />",
|
[Dat_SEPARATOR_BREAK] = "<br />",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
17
swad_exam.c
17
swad_exam.c
|
@ -239,7 +239,7 @@ void Exa_ListAllExams (struct Exa_Exams *Exams)
|
||||||
Exams->CurrentPage = (unsigned) Pagination.CurrentPage;
|
Exams->CurrentPage = (unsigned) Pagination.CurrentPage;
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin ("100%",Txt_Exams,
|
Box_BoxBegin (NULL,Txt_Exams,
|
||||||
Exa_PutIconsListExams,Exams,
|
Exa_PutIconsListExams,Exams,
|
||||||
Hlp_ASSESSMENT_Exams,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Exams,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ void Exa_ListAllExams (struct Exa_Exams *Exams)
|
||||||
if (Exams->Num)
|
if (Exams->Num)
|
||||||
{
|
{
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
HTM_TABLE_BeginWideMarginPadding (5);
|
HTM_TABLE_Begin ("TBL_SCROLL");
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
HTM_TH_Span (NULL,HTM_HEAD_CENTER,1,1,"CONTEXT_COL"); // Column for contextual icons
|
HTM_TH_Span (NULL,HTM_HEAD_CENTER,1,1,"CONTEXT_COL"); // Column for contextual icons
|
||||||
|
|
||||||
|
@ -406,23 +406,20 @@ void Exa_SeeOneExam (void)
|
||||||
Exa_GetExamDataByCod (&Exams.Exam);
|
Exa_GetExamDataByCod (&Exams.Exam);
|
||||||
|
|
||||||
/***** Show exam *****/
|
/***** Show exam *****/
|
||||||
Exa_ShowOnlyOneExam (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExam (&Exams,Frm_DONT_PUT_FORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************************* Show one exam *******************************/
|
/******************************* Show one exam *******************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Exa_ShowOnlyOneExam (struct Exa_Exams *Exams,
|
void Exa_ShowOnlyOneExam (struct Exa_Exams *Exams,Frm_PutForm_t PutFormSession)
|
||||||
struct ExaSes_Session *Session,
|
|
||||||
Frm_PutForm_t PutFormSession)
|
|
||||||
{
|
{
|
||||||
Exa_ShowOnlyOneExamBegin (Exams,Session,PutFormSession);
|
Exa_ShowOnlyOneExamBegin (Exams,PutFormSession);
|
||||||
Exa_ShowOnlyOneExamEnd ();
|
Exa_ShowOnlyOneExamEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
||||||
struct ExaSes_Session *Session,
|
|
||||||
Frm_PutForm_t PutFormSession)
|
Frm_PutForm_t PutFormSession)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Exams;
|
extern const char *Hlp_ASSESSMENT_Exams;
|
||||||
|
@ -439,7 +436,7 @@ void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
||||||
true); // Show only this exam
|
true); // Show only this exam
|
||||||
|
|
||||||
/***** List sessions *****/
|
/***** List sessions *****/
|
||||||
ExaSes_ListSessions (Exams,Session,PutFormSession);
|
ExaSes_ListSessions (Exams,PutFormSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Exa_ShowOnlyOneExamEnd (void)
|
void Exa_ShowOnlyOneExamEnd (void)
|
||||||
|
@ -472,7 +469,7 @@ static void Exa_ShowOneExam (struct Exa_Exams *Exams,bool ShowOnlyThisExam)
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
if (ShowOnlyThisExam)
|
if (ShowOnlyThisExam)
|
||||||
HTM_TABLE_BeginWidePadding (2);
|
HTM_TABLE_Begin ("TBL_SCROLL");
|
||||||
|
|
||||||
/***** Begin first row of this exam *****/
|
/***** Begin first row of this exam *****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
|
@ -42,11 +42,8 @@ void Exa_ListAllExams (struct Exa_Exams *Exams);
|
||||||
bool Exa_CheckIfICanEditExams (void);
|
bool Exa_CheckIfICanEditExams (void);
|
||||||
|
|
||||||
void Exa_SeeOneExam (void);
|
void Exa_SeeOneExam (void);
|
||||||
void Exa_ShowOnlyOneExam (struct Exa_Exams *Exams,
|
void Exa_ShowOnlyOneExam (struct Exa_Exams *Exams,Frm_PutForm_t PutFormSession);
|
||||||
struct ExaSes_Session *Session,
|
|
||||||
Frm_PutForm_t PutFormSession);
|
|
||||||
void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
void Exa_ShowOnlyOneExamBegin (struct Exa_Exams *Exams,
|
||||||
struct ExaSes_Session *Session,
|
|
||||||
Frm_PutForm_t PutFormSession);
|
Frm_PutForm_t PutFormSession);
|
||||||
void Exa_ShowOnlyOneExamEnd (void);
|
void Exa_ShowOnlyOneExamEnd (void);
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ struct ExaRes_ICanView
|
||||||
|
|
||||||
static void ExaRes_ListMyResultsInCrs (struct Exa_Exams *Exams);
|
static void ExaRes_ListMyResultsInCrs (struct Exa_Exams *Exams);
|
||||||
static void ExaRes_ListMyResultsInExa (struct Exa_Exams *Exams);
|
static void ExaRes_ListMyResultsInExa (struct Exa_Exams *Exams);
|
||||||
static void ExaRes_ListMyResultsInSes (struct Exa_Exams *Exams,long SesCod);
|
static void ExaRes_ListMyResultsInSes (struct Exa_Exams *Exams);
|
||||||
|
|
||||||
static void ExaRes_PutFormToSelUsrsToViewResults (__attribute__((unused)) void *Args);
|
static void ExaRes_PutFormToSelUsrsToViewResults (__attribute__((unused)) void *Args);
|
||||||
static void ExaRes_ShowAllResultsInSelectedExams (void *Exams);
|
static void ExaRes_ShowAllResultsInSelectedExams (void *Exams);
|
||||||
|
@ -186,13 +186,11 @@ void ExaRes_ShowMyResultsInExa (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Results_of_exam_X;
|
extern const char *Txt_Results_of_exam_X;
|
||||||
struct Exa_Exams Exams;
|
struct Exa_Exams Exams;
|
||||||
struct ExaSes_Session Session;
|
|
||||||
char *Title;
|
char *Title;
|
||||||
|
|
||||||
/***** Reset exams context *****/
|
/***** Reset exams context *****/
|
||||||
Exa_ResetExams (&Exams);
|
Exa_ResetExams (&Exams);
|
||||||
Exa_ResetExam (&Exams.Exam);
|
Exa_ResetExam (&Exams.Exam);
|
||||||
ExaSes_ResetSession (&Session);
|
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Exa_GetPars (&Exams,Exa_CHECK_EXA_COD);
|
Exa_GetPars (&Exams,Exa_CHECK_EXA_COD);
|
||||||
|
@ -201,7 +199,7 @@ void ExaRes_ShowMyResultsInExa (void)
|
||||||
Exa_GetExamDataByCod (&Exams.Exam);
|
Exa_GetExamDataByCod (&Exams.Exam);
|
||||||
|
|
||||||
/***** Exam begin *****/
|
/***** Exam begin *****/
|
||||||
Exa_ShowOnlyOneExamBegin (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExamBegin (&Exams,Frm_DONT_PUT_FORM);
|
||||||
|
|
||||||
/***** List my sessions results in exam *****/
|
/***** List my sessions results in exam *****/
|
||||||
if (asprintf (&Title,Txt_Results_of_exam_X,Exams.Exam.Title) < 0)
|
if (asprintf (&Title,Txt_Results_of_exam_X,Exams.Exam.Title) < 0)
|
||||||
|
@ -243,33 +241,33 @@ void ExaRes_ShowMyResultsInSes (void)
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Exa_GetPars (&Exams,Exa_CHECK_EXA_COD);
|
Exa_GetPars (&Exams,Exa_CHECK_EXA_COD);
|
||||||
Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses);
|
Exams.SesCod = Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses);
|
||||||
Exa_GetExamDataByCod (&Exams.Exam);
|
Exa_GetExamDataByCod (&Exams.Exam);
|
||||||
ExaSes_GetSessionDataByCod (&Session);
|
ExaSes_GetSessionDataByCod (&Session);
|
||||||
|
|
||||||
/***** Exam begin *****/
|
/***** Exam begin *****/
|
||||||
Exa_ShowOnlyOneExamBegin (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExamBegin (&Exams,Frm_DONT_PUT_FORM);
|
||||||
|
|
||||||
/***** List my sessions results in session *****/
|
/***** List my sessions results in session *****/
|
||||||
if (asprintf (&Title,Txt_Results_of_session_X,Session.Title) < 0)
|
if (asprintf (&Title,Txt_Results_of_session_X,Session.Title) < 0)
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
ExaRes_ShowResultsBegin (&Exams,Title,false); // Do not list exams to select
|
ExaRes_ShowResultsBegin (&Exams,Title,false); // Do not list exams to select
|
||||||
free (Title);
|
free (Title);
|
||||||
ExaRes_ListMyResultsInSes (&Exams,Session.SesCod);
|
ExaRes_ListMyResultsInSes (&Exams);
|
||||||
ExaRes_ShowResultsEnd ();
|
ExaRes_ShowResultsEnd ();
|
||||||
|
|
||||||
/***** Exam end *****/
|
/***** Exam end *****/
|
||||||
Exa_ShowOnlyOneExamEnd ();
|
Exa_ShowOnlyOneExamEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ExaRes_ListMyResultsInSes (struct Exa_Exams *Exams,long SesCod)
|
static void ExaRes_ListMyResultsInSes (struct Exa_Exams *Exams)
|
||||||
{
|
{
|
||||||
/***** Table header *****/
|
/***** Table header *****/
|
||||||
ExaRes_ShowHeaderResults (Usr_ME);
|
ExaRes_ShowHeaderResults (Usr_ME);
|
||||||
|
|
||||||
/***** List my sessions results in exam *****/
|
/***** List my sessions results in exam *****/
|
||||||
TstCfg_GetConfig (); // Get feedback type
|
TstCfg_GetConfig (); // Get feedback type
|
||||||
ExaRes_ShowResults (Exams,Usr_ME,SesCod,-1L,NULL);
|
ExaRes_ShowResults (Exams,Usr_ME,Exams->SesCod,-1L,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -391,7 +389,7 @@ void ExaRes_ShowAllResultsInExa (void)
|
||||||
Exa_GetExamDataByCod (&Exams.Exam);
|
Exa_GetExamDataByCod (&Exams.Exam);
|
||||||
|
|
||||||
/***** Exam begin *****/
|
/***** Exam begin *****/
|
||||||
Exa_ShowOnlyOneExamBegin (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExamBegin (&Exams,Frm_DONT_PUT_FORM);
|
||||||
|
|
||||||
/***** List sessions results in exam *****/
|
/***** List sessions results in exam *****/
|
||||||
if (asprintf (&Title,Txt_Results_of_exam_X,Exams.Exam.Title) < 0)
|
if (asprintf (&Title,Txt_Results_of_exam_X,Exams.Exam.Title) < 0)
|
||||||
|
@ -455,14 +453,14 @@ void ExaRes_ShowAllResultsInSes (void)
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Exa_GetPars (&Exams,Exa_CHECK_EXA_COD);
|
Exa_GetPars (&Exams,Exa_CHECK_EXA_COD);
|
||||||
Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses);
|
Exams.SesCod = Session.SesCod = ParCod_GetAndCheckPar (ParCod_Ses);
|
||||||
|
|
||||||
/***** Get exam data and session *****/
|
/***** Get exam data and session *****/
|
||||||
Exa_GetExamDataByCod (&Exams.Exam);
|
Exa_GetExamDataByCod (&Exams.Exam);
|
||||||
ExaSes_GetSessionDataByCod (&Session);
|
ExaSes_GetSessionDataByCod (&Session);
|
||||||
|
|
||||||
/***** Exam begin *****/
|
/***** Exam begin *****/
|
||||||
Exa_ShowOnlyOneExamBegin (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExamBegin (&Exams,Frm_DONT_PUT_FORM);
|
||||||
|
|
||||||
/***** List sessions results in session *****/
|
/***** List sessions results in session *****/
|
||||||
if (asprintf (&Title,Txt_Results_of_session_X,Session.Title) < 0)
|
if (asprintf (&Title,Txt_Results_of_session_X,Session.Title) < 0)
|
||||||
|
|
|
@ -69,7 +69,7 @@ static void ExaSes_PutIconsInListOfSessions (void *Exams);
|
||||||
static void ExaSes_PutIconToCreateNewSession (struct Exa_Exams *Exams);
|
static void ExaSes_PutIconToCreateNewSession (struct Exa_Exams *Exams);
|
||||||
|
|
||||||
static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
||||||
long SesCodToBeEdited,
|
Frm_PutForm_t PutFormSession,
|
||||||
unsigned NumSessions,
|
unsigned NumSessions,
|
||||||
MYSQL_RES *mysql_res);
|
MYSQL_RES *mysql_res);
|
||||||
static void ExaSes_ListOneOrMoreSessionsHeading (bool ICanEditSessions);
|
static void ExaSes_ListOneOrMoreSessionsHeading (bool ICanEditSessions);
|
||||||
|
@ -136,7 +136,6 @@ void ExaSes_ResetSession (struct ExaSes_Session *Session)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
||||||
struct ExaSes_Session *Session,
|
|
||||||
Frm_PutForm_t PutFormSession)
|
Frm_PutForm_t PutFormSession)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Exams_sessions;
|
extern const char *Hlp_ASSESSMENT_Exams_sessions;
|
||||||
|
@ -144,61 +143,28 @@ void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
unsigned NumSessions;
|
unsigned NumSessions;
|
||||||
|
|
||||||
|
/***** Get data of sessions from database *****/
|
||||||
|
NumSessions = Exa_DB_GetSessions (&mysql_res,Exams->Exam.ExaCod);
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin ("100%",Txt_Sessions,
|
Box_BoxBegin (NULL,Txt_Sessions,
|
||||||
ExaSes_PutIconsInListOfSessions,Exams,
|
ExaSes_PutIconsInListOfSessions,Exams,
|
||||||
Hlp_ASSESSMENT_Exams_sessions,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Exams_sessions,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Select whether show only my groups or all groups *****/
|
/***** Select whether show only my groups or all groups *****/
|
||||||
switch (Gbl.Usrs.Me.Role.Logged)
|
if (Gbl.Crs.Grps.NumGrps && ExaSes_CheckIfICanEditSessions ())
|
||||||
{
|
{
|
||||||
case Rol_NET:
|
Set_BeginSettingsHead ();
|
||||||
case Rol_TCH:
|
|
||||||
case Rol_SYS_ADM:
|
|
||||||
if (Gbl.Crs.Grps.NumGrps)
|
|
||||||
{
|
|
||||||
Set_BeginSettingsHead ();
|
|
||||||
Grp_ShowFormToSelWhichGrps (ActSeeOneExa,Exa_PutPars,Exams);
|
Grp_ShowFormToSelWhichGrps (ActSeeOneExa,Exa_PutPars,Exams);
|
||||||
Set_EndSettingsHead ();
|
Set_EndSettingsHead ();
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Show the table with the sessions *****/
|
/***** Show the table with the sessions *****/
|
||||||
if ((NumSessions = Exa_DB_GetSessions (&mysql_res,Exams->Exam.ExaCod)))
|
ExaSes_ListOneOrMoreSessions (Exams,PutFormSession,
|
||||||
ExaSes_ListOneOrMoreSessions (Exams,
|
NumSessions,mysql_res);
|
||||||
PutFormSession &&
|
|
||||||
Session->SesCod > 0 ? Session->SesCod :
|
|
||||||
-1L,
|
|
||||||
NumSessions,mysql_res);
|
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
/***** Put button to create a new exam session in this exam *****/
|
|
||||||
switch (Gbl.Usrs.Me.Role.Logged)
|
|
||||||
{
|
|
||||||
case Rol_NET:
|
|
||||||
case Rol_TCH:
|
|
||||||
case Rol_SYS_ADM:
|
|
||||||
if (PutFormSession == Frm_PUT_FORM && Session->SesCod <= 0)
|
|
||||||
{
|
|
||||||
/* Reset session */
|
|
||||||
ExaSes_ResetSession (Session);
|
|
||||||
Session->ExaCod = Exams->Exam.ExaCod;
|
|
||||||
Session->TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC (); // Now
|
|
||||||
Session->TimeUTC[Dat_END_TIME] = Session->TimeUTC[Dat_STR_TIME] + (1 * 60 * 60); // Now + 1 hour
|
|
||||||
Str_Copy (Session->Title,Exams->Exam.Title,sizeof (Session->Title) - 1);
|
|
||||||
|
|
||||||
/* Put form to create new session */
|
|
||||||
ExaSes_PutFormSession (Session); // Form to create session
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
@ -264,28 +230,28 @@ static void ExaSes_PutIconToCreateNewSession (struct Exa_Exams *Exams)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
||||||
long SesCodToBeEdited,
|
Frm_PutForm_t PutFormSession,
|
||||||
unsigned NumSessions,
|
unsigned NumSessions,
|
||||||
MYSQL_RES *mysql_res)
|
MYSQL_RES *mysql_res)
|
||||||
{
|
{
|
||||||
unsigned NumSession;
|
unsigned NumSession;
|
||||||
unsigned UniqueId;
|
unsigned UniqueId;
|
||||||
char *Anchor;
|
|
||||||
struct ExaSes_Session Session;
|
struct ExaSes_Session Session;
|
||||||
|
char *Anchor;
|
||||||
bool ICanEditSessions = ExaSes_CheckIfICanEditSessions ();
|
bool ICanEditSessions = ExaSes_CheckIfICanEditSessions ();
|
||||||
|
long SesCodToBeEdited = PutFormSession == Frm_PUT_FORM &&
|
||||||
/***** Trivial check *****/
|
Exams->SesCod > 0 ? Exams->SesCod :
|
||||||
if (!NumSessions)
|
-1L;
|
||||||
return;
|
|
||||||
|
|
||||||
/***** Reset session *****/
|
/***** Reset session *****/
|
||||||
ExaSes_ResetSession (&Session);
|
ExaSes_ResetSession (&Session);
|
||||||
|
|
||||||
/***** Begin table with sessions *****/
|
/***** Begin table with sessions *****/
|
||||||
HTM_TABLE_BeginWidePadding (2);
|
HTM_TABLE_Begin ("TBL_SCROLL");
|
||||||
|
|
||||||
/***** Write the heading *****/
|
/***** Write the heading *****/
|
||||||
ExaSes_ListOneOrMoreSessionsHeading (ICanEditSessions);
|
if (NumSessions)
|
||||||
|
ExaSes_ListOneOrMoreSessionsHeading (ICanEditSessions);
|
||||||
|
|
||||||
/***** Write rows *****/
|
/***** Write rows *****/
|
||||||
for (NumSession = 0, UniqueId = 1, The_ResetRowColor ();
|
for (NumSession = 0, UniqueId = 1, The_ResetRowColor ();
|
||||||
|
@ -301,16 +267,13 @@ static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
||||||
if (asprintf (&Anchor,"evt_%ld_%ld",Exams->Exam.ExaCod,Session.SesCod) < 0)
|
if (asprintf (&Anchor,"evt_%ld_%ld",Exams->Exam.ExaCod,Session.SesCod) < 0)
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
|
|
||||||
/***** Begin row for this exam session ****/
|
/***** First row for this session ****/
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/* Icons */
|
/* Icons */
|
||||||
if (ICanEditSessions)
|
if (ICanEditSessions)
|
||||||
ExaSes_ListOneOrMoreSessionsIcons (Exams,&Session,Anchor);
|
ExaSes_ListOneOrMoreSessionsIcons (Exams,&Session,Anchor);
|
||||||
|
|
||||||
/* Session participant */
|
|
||||||
ExaSes_ListOneOrMoreSessionsAuthor (&Session);
|
|
||||||
|
|
||||||
/* Start/end date/time */
|
/* Start/end date/time */
|
||||||
ExaSes_ListOneOrMoreSessionsTimes (&Session,UniqueId);
|
ExaSes_ListOneOrMoreSessionsTimes (&Session,UniqueId);
|
||||||
|
|
||||||
|
@ -320,16 +283,21 @@ static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
||||||
/* Session result visible? */
|
/* Session result visible? */
|
||||||
ExaSes_ListOneOrMoreSessionsResult (Exams,&Session);
|
ExaSes_ListOneOrMoreSessionsResult (Exams,&Session);
|
||||||
|
|
||||||
/***** End row for this session ****/
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** For to edit this session ****/
|
/***** Second row: session author */
|
||||||
if (Session.SesCod == SesCodToBeEdited)
|
HTM_TR_Begin (NULL);
|
||||||
|
ExaSes_ListOneOrMoreSessionsAuthor (&Session);
|
||||||
|
HTM_TR_End ();
|
||||||
|
|
||||||
|
/***** Third row: form to edit this session ****/
|
||||||
|
if (ICanEditSessions && PutFormSession == Frm_PUT_FORM && // Editing...
|
||||||
|
Session.SesCod == SesCodToBeEdited) // ...this session
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
HTM_TD_Begin ("colspan=\"6\" class=\"CT %s\"",
|
HTM_TD_Begin ("colspan=\"5\" class=\"LT %s\"",
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
ExaSes_PutFormSession (&Session); // Form to edit existing session
|
ExaSes_PutFormSession (&Session); // Form to edit this session
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
}
|
}
|
||||||
|
@ -339,6 +307,25 @@ static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Put form to create a new exam session in this exam *****/
|
||||||
|
if (ICanEditSessions && PutFormSession == Frm_PUT_FORM &&
|
||||||
|
SesCodToBeEdited <= 0)
|
||||||
|
{
|
||||||
|
/* Reset session */
|
||||||
|
ExaSes_ResetSession (&Session);
|
||||||
|
Session.ExaCod = Exams->Exam.ExaCod;
|
||||||
|
Session.TimeUTC[Dat_STR_TIME] = Dat_GetStartExecutionTimeUTC (); // Now
|
||||||
|
Session.TimeUTC[Dat_END_TIME] = Session.TimeUTC[Dat_STR_TIME] + (1 * 60 * 60); // Now + 1 hour
|
||||||
|
Str_Copy (Session.Title,Exams->Exam.Title,sizeof (Session.Title) - 1);
|
||||||
|
|
||||||
|
/* Put form to create new session */
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
HTM_TD_Begin ("colspan=\"5\" class=\"LT %s\"",The_GetColorRows ());
|
||||||
|
ExaSes_PutFormSession (&Session); // Form to create session
|
||||||
|
HTM_TD_End ();
|
||||||
|
HTM_TR_End ();
|
||||||
|
}
|
||||||
|
|
||||||
/***** End table with sessions *****/
|
/***** End table with sessions *****/
|
||||||
HTM_TABLE_End ();
|
HTM_TABLE_End ();
|
||||||
}
|
}
|
||||||
|
@ -349,7 +336,6 @@ static void ExaSes_ListOneOrMoreSessions (struct Exa_Exams *Exams,
|
||||||
|
|
||||||
static void ExaSes_ListOneOrMoreSessionsHeading (bool ICanEditSessions)
|
static void ExaSes_ListOneOrMoreSessionsHeading (bool ICanEditSessions)
|
||||||
{
|
{
|
||||||
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_Session;
|
extern const char *Txt_Session;
|
||||||
extern const char *Txt_Results;
|
extern const char *Txt_Results;
|
||||||
|
@ -362,7 +348,6 @@ static void ExaSes_ListOneOrMoreSessionsHeading (bool ICanEditSessions)
|
||||||
HTM_TH_Empty (1);
|
HTM_TH_Empty (1);
|
||||||
|
|
||||||
/***** The rest of columns *****/
|
/***** The rest of columns *****/
|
||||||
HTM_TH (Txt_ROLES_SINGUL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],HTM_HEAD_LEFT );
|
|
||||||
HTM_TH (Txt_START_END_TIME[Exa_ORDER_BY_START_DATE] ,HTM_HEAD_LEFT );
|
HTM_TH (Txt_START_END_TIME[Exa_ORDER_BY_START_DATE] ,HTM_HEAD_LEFT );
|
||||||
HTM_TH (Txt_START_END_TIME[Exa_ORDER_BY_END_DATE ] ,HTM_HEAD_LEFT );
|
HTM_TH (Txt_START_END_TIME[Exa_ORDER_BY_END_DATE ] ,HTM_HEAD_LEFT );
|
||||||
HTM_TH (Txt_Session ,HTM_HEAD_LEFT );
|
HTM_TH (Txt_Session ,HTM_HEAD_LEFT );
|
||||||
|
@ -438,7 +423,7 @@ static void ExaSes_ListOneOrMoreSessionsIcons (struct Exa_Exams *Exams,
|
||||||
Exams->SesCod = Session->SesCod;
|
Exams->SesCod = Session->SesCod;
|
||||||
|
|
||||||
/***** Begin cell *****/
|
/***** Begin cell *****/
|
||||||
HTM_TD_Begin ("class=\"BT %s\"",The_GetColorRows ());
|
HTM_TD_Begin ("rowspan=\"2\" class=\"BT %s\"",The_GetColorRows ());
|
||||||
|
|
||||||
if (ExaSes_CheckIfICanEditThisSession (Session->UsrCod))
|
if (ExaSes_CheckIfICanEditThisSession (Session->UsrCod))
|
||||||
{
|
{
|
||||||
|
@ -452,7 +437,7 @@ static void ExaSes_ListOneOrMoreSessionsIcons (struct Exa_Exams *Exams,
|
||||||
Session->HiddenOrVisible);
|
Session->HiddenOrVisible);
|
||||||
|
|
||||||
/***** Icon to edit the exam session *****/
|
/***** Icon to edit the exam session *****/
|
||||||
Ico_PutContextualIconToEdit (ActEdiOneExaSes,Anchor,
|
Ico_PutContextualIconToEdit (ActReqChgExaSes,Anchor,
|
||||||
ExaSes_PutParsEdit,Exams);
|
ExaSes_PutParsEdit,Exams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -467,7 +452,7 @@ static void ExaSes_ListOneOrMoreSessionsIcons (struct Exa_Exams *Exams,
|
||||||
static void ExaSes_ListOneOrMoreSessionsAuthor (const struct ExaSes_Session *Session)
|
static void ExaSes_ListOneOrMoreSessionsAuthor (const struct ExaSes_Session *Session)
|
||||||
{
|
{
|
||||||
/***** Session author (teacher) *****/
|
/***** Session author (teacher) *****/
|
||||||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
HTM_TD_Begin ("colspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
|
||||||
Usr_WriteAuthor1Line (Session->UsrCod,Session->HiddenOrVisible);
|
Usr_WriteAuthor1Line (Session->UsrCod,Session->HiddenOrVisible);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
}
|
}
|
||||||
|
@ -516,7 +501,7 @@ static void ExaSes_ListOneOrMoreSessionsTitleGrps (struct Exa_Exams *Exams,
|
||||||
extern const char *Txt_Resume;
|
extern const char *Txt_Resume;
|
||||||
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
extern const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE];
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"LT %s\"",The_GetColorRows ());
|
HTM_TD_Begin ("rowspan=\"2\" class=\"LT %s\"",The_GetColorRows ());
|
||||||
|
|
||||||
/***** Session title *****/
|
/***** Session title *****/
|
||||||
HTM_ARTICLE_Begin (Anchor);
|
HTM_ARTICLE_Begin (Anchor);
|
||||||
|
@ -627,7 +612,7 @@ static void ExaSes_ListOneOrMoreSessionsResult (struct Exa_Exams *Exams,
|
||||||
[Rol_SYS_ADM] = ExaSes_ListOneOrMoreSessionsResultTch,
|
[Rol_SYS_ADM] = ExaSes_ListOneOrMoreSessionsResultTch,
|
||||||
};
|
};
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"CT DAT_%s %s\"",
|
HTM_TD_Begin ("rowspan=\"2\" class=\"CT DAT_%s %s\"",
|
||||||
The_GetSuffix (),The_GetColorRows ());
|
The_GetSuffix (),The_GetColorRows ());
|
||||||
|
|
||||||
if (Function[Gbl.Usrs.Me.Role.Logged])
|
if (Function[Gbl.Usrs.Me.Role.Logged])
|
||||||
|
@ -720,7 +705,7 @@ void ExaSes_ToggleVisResultsSesUsr (void)
|
||||||
Exa_DB_ToggleVisResultsSesUsr (&Session);
|
Exa_DB_ToggleVisResultsSesUsr (&Session);
|
||||||
|
|
||||||
/***** Show current exam *****/
|
/***** Show current exam *****/
|
||||||
Exa_ShowOnlyOneExam (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExam (&Exams,Frm_DONT_PUT_FORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -808,7 +793,7 @@ void ExaSes_ReqRemSession (void)
|
||||||
Session.Title);
|
Session.Title);
|
||||||
|
|
||||||
/***** Show current exam *****/
|
/***** Show current exam *****/
|
||||||
Exa_ShowOnlyOneExam (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExam (&Exams,Frm_DONT_PUT_FORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -853,7 +838,7 @@ void ExaSes_RemoveSession (void)
|
||||||
Exa_GetExamDataByCod (&Exams.Exam);
|
Exa_GetExamDataByCod (&Exams.Exam);
|
||||||
|
|
||||||
/***** Show current exam *****/
|
/***** Show current exam *****/
|
||||||
Exa_ShowOnlyOneExam (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExam (&Exams,Frm_DONT_PUT_FORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -891,7 +876,7 @@ static void ExaSes_HideUnhideSession (HidVis_HiddenOrVisible_t HiddenOrVisible)
|
||||||
Exa_DB_HideUnhideSession (&Session,HiddenOrVisible);
|
Exa_DB_HideUnhideSession (&Session,HiddenOrVisible);
|
||||||
|
|
||||||
/***** Show current exam *****/
|
/***** Show current exam *****/
|
||||||
Exa_ShowOnlyOneExam (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExam (&Exams,Frm_DONT_PUT_FORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -945,10 +930,10 @@ static void ExaSes_PutFormSession (struct ExaSes_Session *Session)
|
||||||
};
|
};
|
||||||
bool ItsANewSession = (Session->SesCod <= 0);
|
bool ItsANewSession = (Session->SesCod <= 0);
|
||||||
|
|
||||||
/***** Begin section for a new exam session *****/
|
/***** Begin section for exam session *****/
|
||||||
HTM_SECTION_Begin (ExaSes_NEW_SESSION_SECTION_ID);
|
HTM_SECTION_Begin (ExaSes_NEW_SESSION_SECTION_ID);
|
||||||
|
|
||||||
/***** Begin form to create *****/
|
/***** Begin form to create/edit *****/
|
||||||
Frm_BeginFormTable (ItsANewSession ? ActNewExaSes :
|
Frm_BeginFormTable (ItsANewSession ? ActNewExaSes :
|
||||||
ActChgExaSes,
|
ActChgExaSes,
|
||||||
ExaSes_NEW_SESSION_SECTION_ID,
|
ExaSes_NEW_SESSION_SECTION_ID,
|
||||||
|
@ -964,7 +949,7 @@ static void ExaSes_PutFormSession (struct ExaSes_Session *Session)
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
HTM_INPUT_TEXT ("Title",ExaSes_MAX_CHARS_TITLE,Session->Title,
|
HTM_INPUT_TEXT ("Title",ExaSes_MAX_CHARS_TITLE,Session->Title,
|
||||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||||
"id=\"Title\" size=\"45\" class=\"INPUT_%s\""
|
"id=\"Title\" class=\"REC_C2_BOT_INPUT INPUT_%s\""
|
||||||
" required=\"required\"",
|
" required=\"required\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -983,7 +968,7 @@ static void ExaSes_PutFormSession (struct ExaSes_Session *Session)
|
||||||
Frm_EndFormTable (ItsANewSession ? Btn_CREATE_BUTTON :
|
Frm_EndFormTable (ItsANewSession ? Btn_CREATE_BUTTON :
|
||||||
Btn_CONFIRM_BUTTON);
|
Btn_CONFIRM_BUTTON);
|
||||||
|
|
||||||
/***** End section for a new exam session *****/
|
/***** End section for exam session *****/
|
||||||
HTM_SECTION_End ();
|
HTM_SECTION_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1012,7 +997,7 @@ static void ExaSes_ShowLstGrpsToCreateSession (long SesCod)
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
HTM_TD_TxtColon (Txt_Groups);
|
HTM_TD_TxtColon (Txt_Groups);
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
Box_BoxTableBegin ("95%",NULL,
|
Box_BoxTableBegin ("100%",NULL,
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
NULL,Box_NOT_CLOSABLE,0);
|
NULL,Box_NOT_CLOSABLE,0);
|
||||||
|
|
||||||
|
@ -1055,7 +1040,7 @@ static void ExaSes_ShowLstGrpsToCreateSession (long SesCod)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** Request the creation of a new session ********************/
|
/*************** Request the creation or edition of a session ****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ExaSes_ReqCreatOrEditSes (void)
|
void ExaSes_ReqCreatOrEditSes (void)
|
||||||
|
@ -1094,7 +1079,7 @@ void ExaSes_ReqCreatOrEditSes (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Show exam *****/
|
/***** Show exam *****/
|
||||||
Exa_ShowOnlyOneExam (&Exams,&Session,Frm_PUT_FORM); // Put form for session
|
Exa_ShowOnlyOneExam (&Exams,Frm_PUT_FORM); // Put form for session
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1176,7 +1161,7 @@ void ExaSes_ReceiveFormSession (void)
|
||||||
Exa_GetExamDataByCod (&Exams.Exam);
|
Exa_GetExamDataByCod (&Exams.Exam);
|
||||||
|
|
||||||
/***** Show current exam *****/
|
/***** Show current exam *****/
|
||||||
Exa_ShowOnlyOneExam (&Exams,&Session,Frm_DONT_PUT_FORM);
|
Exa_ShowOnlyOneExam (&Exams,Frm_DONT_PUT_FORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -51,7 +51,6 @@ struct ExaSes_UsrAnswer
|
||||||
void ExaSes_ResetSession (struct ExaSes_Session *Session);
|
void ExaSes_ResetSession (struct ExaSes_Session *Session);
|
||||||
|
|
||||||
void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
void ExaSes_ListSessions (struct Exa_Exams *Exams,
|
||||||
struct ExaSes_Session *Session,
|
|
||||||
Frm_PutForm_t PutFormSession);
|
Frm_PutForm_t PutFormSession);
|
||||||
void ExaSes_GetSessionDataByCod (struct ExaSes_Session *Session);
|
void ExaSes_GetSessionDataByCod (struct ExaSes_Session *Session);
|
||||||
|
|
||||||
|
|
28
swad_game.c
28
swad_game.c
|
@ -180,8 +180,7 @@ void Gam_ResetGames (struct Gam_Games *Games)
|
||||||
Games->ListQuestions = NULL;
|
Games->ListQuestions = NULL;
|
||||||
Games->GamCodsSelected = NULL; // String with selected game codes separated by separator multiple
|
Games->GamCodsSelected = NULL; // String with selected game codes separated by separator multiple
|
||||||
Games->Game.GamCod = -1L; // Current/selected game code
|
Games->Game.GamCod = -1L; // Current/selected game code
|
||||||
Games->MchCod.Current =
|
Games->MchCod = -1L; // Current/selected match code
|
||||||
Games->MchCod.Selected = -1L; // Current/selected match code
|
|
||||||
Games->QstInd = 0; // Current question index
|
Games->QstInd = 0; // Current question index
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2158,31 +2157,6 @@ static bool Gam_CheckIfEditable (const struct Gam_Game *Game)
|
||||||
return false; // Questions are not editable
|
return false; // Questions are not editable
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/************* Request the creation of a new match as a teacher **************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void Gam_ReqNewMatch (void)
|
|
||||||
{
|
|
||||||
struct Gam_Games Games;
|
|
||||||
|
|
||||||
/***** Reset games context *****/
|
|
||||||
Gam_ResetGames (&Games);
|
|
||||||
|
|
||||||
/***** Reset game *****/
|
|
||||||
Gam_ResetGame (&Games.Game);
|
|
||||||
|
|
||||||
/***** Get parameters *****/
|
|
||||||
if ((Games.Game.GamCod = Gam_GetPars (&Games)) <= 0)
|
|
||||||
Err_WrongGameExit ();
|
|
||||||
Gam_GetGameDataByCod (&Games.Game);
|
|
||||||
|
|
||||||
/***** Show game *****/
|
|
||||||
Gam_ShowOnlyOneGame (&Games,
|
|
||||||
false, // Do not list game questions
|
|
||||||
Frm_PUT_FORM);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Show test tags in a game **************************/
|
/************************* Show test tags in a game **************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -97,11 +97,7 @@ struct Gam_Games
|
||||||
char *ListQuestions;
|
char *ListQuestions;
|
||||||
char *GamCodsSelected; // String with selected game codes separated by separator multiple
|
char *GamCodsSelected; // String with selected game codes separated by separator multiple
|
||||||
struct Gam_Game Game; // Selected/current game
|
struct Gam_Game Game; // Selected/current game
|
||||||
struct
|
long MchCod; // Selected/current match
|
||||||
{
|
|
||||||
long Selected; // Current match code
|
|
||||||
long Current;
|
|
||||||
} MchCod;
|
|
||||||
unsigned QstInd; // Current question index
|
unsigned QstInd; // Current question index
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -160,8 +156,6 @@ void Gam_RemoveQstFromGame (void);
|
||||||
void Gam_MoveUpQst (void);
|
void Gam_MoveUpQst (void);
|
||||||
void Gam_MoveDownQst (void);
|
void Gam_MoveDownQst (void);
|
||||||
|
|
||||||
void Gam_ReqNewMatch (void);
|
|
||||||
|
|
||||||
void Gam_ShowTstTagsPresentInAGame (long GamCod);
|
void Gam_ShowTstTagsPresentInAGame (long GamCod);
|
||||||
|
|
||||||
void Gam_GetScoreRange (long GamCod,double *MinScore,double *MaxScore);
|
void Gam_GetScoreRange (long GamCod,double *MinScore,double *MaxScore);
|
||||||
|
|
276
swad_match.c
276
swad_match.c
|
@ -100,6 +100,7 @@ static void Mch_PutIconsInListOfMatches (void *Games);
|
||||||
static void Mch_PutIconToCreateNewMatch (struct Gam_Games *Games);
|
static void Mch_PutIconToCreateNewMatch (struct Gam_Games *Games);
|
||||||
|
|
||||||
static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
|
Frm_PutForm_t PutFormMatch,
|
||||||
unsigned NumMatches,
|
unsigned NumMatches,
|
||||||
MYSQL_RES *mysql_res);
|
MYSQL_RES *mysql_res);
|
||||||
static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches);
|
static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches);
|
||||||
|
@ -135,10 +136,8 @@ static void Mch_ListOneOrMoreMatchesResultTch (struct Gam_Games *Games,
|
||||||
static void Mch_GetMatchDataFromRow (MYSQL_RES *mysql_res,
|
static void Mch_GetMatchDataFromRow (MYSQL_RES *mysql_res,
|
||||||
struct Mch_Match *Match);
|
struct Mch_Match *Match);
|
||||||
|
|
||||||
static void Mch_PutFormExistingMatch (struct Gam_Games *Games,
|
static void Mch_PutFormMatch (struct Mch_Match *Match);
|
||||||
const struct Mch_Match *Match,
|
static void Mch_ParsFormMatch (void *Match);
|
||||||
const char *Anchor);
|
|
||||||
static void Mch_PutFormNewMatch (const struct Gam_Game *Game);
|
|
||||||
static void Mch_ShowLstGrpsToEditMatch (long MchCod);
|
static void Mch_ShowLstGrpsToEditMatch (long MchCod);
|
||||||
static void Mch_UpdateMatchTitleAndGrps (const struct Mch_Match *Match);
|
static void Mch_UpdateMatchTitleAndGrps (const struct Mch_Match *Match);
|
||||||
|
|
||||||
|
@ -269,7 +268,8 @@ void Mch_ResetMatch (struct Mch_Match *Match)
|
||||||
/************************* List the matches of a game ************************/
|
/************************* List the matches of a game ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mch_ListMatches (struct Gam_Games *Games,Frm_PutForm_t PutFormNewMatch)
|
void Mch_ListMatches (struct Gam_Games *Games,
|
||||||
|
Frm_PutForm_t PutFormNewMatch)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Games_matches;
|
extern const char *Hlp_ASSESSMENT_Games_matches;
|
||||||
extern const char *Txt_Matches;
|
extern const char *Txt_Matches;
|
||||||
|
@ -285,33 +285,20 @@ void Mch_ListMatches (struct Gam_Games *Games,Frm_PutForm_t PutFormNewMatch)
|
||||||
Hlp_ASSESSMENT_Games_matches,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Games_matches,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Select whether show only my groups or all groups *****/
|
/***** Select whether show only my groups or all groups *****/
|
||||||
switch (Gbl.Usrs.Me.Role.Logged)
|
if (Gbl.Crs.Grps.NumGrps && Mch_CheckIfICanEditMatches ())
|
||||||
{
|
{
|
||||||
case Rol_NET:
|
Set_BeginSettingsHead ();
|
||||||
case Rol_TCH:
|
Grp_ShowFormToSelWhichGrps (ActSeeOneGam,Gam_PutPars,Games);
|
||||||
case Rol_SYS_ADM:
|
Set_EndSettingsHead ();
|
||||||
if (Gbl.Crs.Grps.NumGrps)
|
|
||||||
{
|
|
||||||
Set_BeginSettingsHead ();
|
|
||||||
Grp_ShowFormToSelWhichGrps (ActSeeOneGam,Gam_PutPars,Games);
|
|
||||||
Set_EndSettingsHead ();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Show the table with the matches *****/
|
/***** Show the table with the matches *****/
|
||||||
if (NumMatches)
|
Mch_ListOneOrMoreMatches (Games,PutFormNewMatch,
|
||||||
Mch_ListOneOrMoreMatches (Games,NumMatches,mysql_res);
|
NumMatches,mysql_res);
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
|
||||||
/***** Put button to play a new match in this game *****/
|
|
||||||
if (PutFormNewMatch == Frm_PUT_FORM)
|
|
||||||
Mch_PutFormNewMatch (&Games->Game); // Form to fill in data and start playing a new match
|
|
||||||
|
|
||||||
/***** End box *****/
|
/***** End box *****/
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
}
|
}
|
||||||
|
@ -368,6 +355,7 @@ static void Mch_PutIconToCreateNewMatch (struct Gam_Games *Games)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
|
Frm_PutForm_t PutFormMatch,
|
||||||
unsigned NumMatches,
|
unsigned NumMatches,
|
||||||
MYSQL_RES *mysql_res)
|
MYSQL_RES *mysql_res)
|
||||||
{
|
{
|
||||||
|
@ -376,10 +364,9 @@ static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
struct Mch_Match Match;
|
struct Mch_Match Match;
|
||||||
char *Anchor;
|
char *Anchor;
|
||||||
bool ICanEditMatches = Mch_CheckIfICanEditMatches ();
|
bool ICanEditMatches = Mch_CheckIfICanEditMatches ();
|
||||||
|
long MchCodToBeEdited = PutFormMatch == Frm_PUT_FORM &&
|
||||||
/***** Trivial check *****/
|
Games->MchCod > 0 ? Games->MchCod :
|
||||||
if (!NumMatches)
|
-1L;
|
||||||
return;
|
|
||||||
|
|
||||||
/***** Reset match *****/
|
/***** Reset match *****/
|
||||||
Mch_ResetMatch (&Match);
|
Mch_ResetMatch (&Match);
|
||||||
|
@ -388,7 +375,8 @@ static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
HTM_TABLE_Begin ("TBL_SCROLL");
|
HTM_TABLE_Begin ("TBL_SCROLL");
|
||||||
|
|
||||||
/***** Write the heading *****/
|
/***** Write the heading *****/
|
||||||
Mch_ListOneOrMoreMatchesHeading (ICanEditMatches);
|
if (NumMatches)
|
||||||
|
Mch_ListOneOrMoreMatchesHeading (ICanEditMatches);
|
||||||
|
|
||||||
/***** Write rows *****/
|
/***** Write rows *****/
|
||||||
for (NumMatch = 0, UniqueId = 1, The_ResetRowColor ();
|
for (NumMatch = 0, UniqueId = 1, The_ResetRowColor ();
|
||||||
|
@ -405,7 +393,6 @@ static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
Err_NotEnoughMemoryExit ();
|
Err_NotEnoughMemoryExit ();
|
||||||
|
|
||||||
/***** First row for this match with match data ****/
|
/***** First row for this match with match data ****/
|
||||||
/* Begin first row */
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/* Icons */
|
/* Icons */
|
||||||
|
@ -427,35 +414,24 @@ static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
/* Match result visible? */
|
/* Match result visible? */
|
||||||
Mch_ListOneOrMoreMatchesResult (Games,&Match);
|
Mch_ListOneOrMoreMatchesResult (Games,&Match);
|
||||||
|
|
||||||
/* End first row */
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** Second row for this match with author ****/
|
/***** Second row: match author ****/
|
||||||
/* Begin second row */
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/* Match author */
|
|
||||||
Mch_ListOneOrMoreMatchesAuthor (Games,&Match);
|
Mch_ListOneOrMoreMatchesAuthor (Games,&Match);
|
||||||
|
|
||||||
/* End second row */
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** Third row for this match used for edition ****/
|
/***** Third row for this match used for edition ****/
|
||||||
if (Gbl.Action.Act == ActEdiMch && // Editing...
|
if (ICanEditMatches && PutFormMatch == Frm_PUT_FORM && // Editing...
|
||||||
Match.MchCod == Games->MchCod.Selected) // ...this match
|
Match.MchCod == MchCodToBeEdited) // ...this match
|
||||||
/***** Check if I can edit this match *****/
|
/***** Check if I can edit this match *****/
|
||||||
if (Mch_CheckIfICanEditThisMatch (&Match))
|
if (Mch_CheckIfICanEditThisMatch (&Match))
|
||||||
{
|
{
|
||||||
/* Begin third row */
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/* Form to edit match */
|
|
||||||
HTM_TD_Begin ("colspan=\"7\" class=\"LT %s\"",
|
HTM_TD_Begin ("colspan=\"7\" class=\"LT %s\"",
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
Mch_PutFormExistingMatch (Games,&Match,Anchor); // Form to fill in data and edit this match
|
Mch_PutFormMatch (&Match); // Form to edit this match
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/* End third row */
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,6 +440,23 @@ static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Put button to play a new match in this game *****/
|
||||||
|
if (ICanEditMatches && PutFormMatch == Frm_PUT_FORM &&
|
||||||
|
MchCodToBeEdited <= 0)
|
||||||
|
{
|
||||||
|
/* Reset match */
|
||||||
|
Mch_ResetMatch (&Match);
|
||||||
|
Match.GamCod = Games->Game.GamCod;
|
||||||
|
Str_Copy (Match.Title,Games->Game.Title,sizeof (Match.Title) - 1);
|
||||||
|
|
||||||
|
/* Put form to create new match */
|
||||||
|
HTM_TR_Begin (NULL);
|
||||||
|
HTM_TD_Begin ("colspan=\"7\" class=\"LT %s\"",The_GetColorRows ());
|
||||||
|
Mch_PutFormMatch (&Match); // Form to create match
|
||||||
|
HTM_TD_End ();
|
||||||
|
HTM_TR_End ();
|
||||||
|
}
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
HTM_TABLE_End ();
|
HTM_TABLE_End ();
|
||||||
}
|
}
|
||||||
|
@ -523,6 +516,9 @@ static bool Mch_CheckIfICanEditMatches (void)
|
||||||
|
|
||||||
static bool Mch_CheckIfICanEditThisMatch (const struct Mch_Match *Match)
|
static bool Mch_CheckIfICanEditThisMatch (const struct Mch_Match *Match)
|
||||||
{
|
{
|
||||||
|
if (Match->MchCod <= 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.Role.Logged)
|
switch (Gbl.Usrs.Me.Role.Logged)
|
||||||
{
|
{
|
||||||
case Rol_NET:
|
case Rol_NET:
|
||||||
|
@ -561,15 +557,14 @@ static void Mch_ListOneOrMoreMatchesIcons (struct Gam_Games *Games,
|
||||||
|
|
||||||
if (Mch_CheckIfICanEditThisMatch (Match))
|
if (Mch_CheckIfICanEditThisMatch (Match))
|
||||||
{
|
{
|
||||||
// Games->Game.GamCod = Match->GamCod;
|
Games->MchCod = Match->MchCod;
|
||||||
Games->MchCod.Current = Match->MchCod;
|
|
||||||
|
|
||||||
/***** Put icon to remove the match *****/
|
/***** Put icon to remove the match *****/
|
||||||
Ico_PutContextualIconToRemove (ActReqRemMch,NULL,
|
Ico_PutContextualIconToRemove (ActReqRemMch,NULL,
|
||||||
Mch_PutParsEdit,Games);
|
Mch_PutParsEdit,Games);
|
||||||
|
|
||||||
/***** Put icon to edit the match *****/
|
/***** Put icon to edit the match *****/
|
||||||
Ico_PutContextualIconToEdit (ActEdiMch,Anchor,
|
Ico_PutContextualIconToEdit (ActReqChgMch,Anchor,
|
||||||
Mch_PutParsEdit,Games);
|
Mch_PutParsEdit,Games);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -820,16 +815,14 @@ static void Mch_ListOneOrMoreMatchesResult (struct Gam_Games *Games,
|
||||||
static void Mch_ListOneOrMoreMatchesResultStd (struct Gam_Games *Games,
|
static void Mch_ListOneOrMoreMatchesResultStd (struct Gam_Games *Games,
|
||||||
const struct Mch_Match *Match)
|
const struct Mch_Match *Match)
|
||||||
{
|
{
|
||||||
|
Games->MchCod = Match->MchCod;
|
||||||
|
|
||||||
/***** Is match result visible or hidden? *****/
|
/***** Is match result visible or hidden? *****/
|
||||||
if (Match->Status.ShowUsrResults)
|
if (Match->Status.ShowUsrResults)
|
||||||
{
|
|
||||||
/* Result is visible by me */
|
/* Result is visible by me */
|
||||||
Games->Game.GamCod = Match->GamCod;
|
|
||||||
Games->MchCod.Current = Match->MchCod;
|
|
||||||
Lay_PutContextualLinkOnlyIcon (ActSeeMyMchResMch,MchRes_RESULTS_BOX_ID,
|
Lay_PutContextualLinkOnlyIcon (ActSeeMyMchResMch,MchRes_RESULTS_BOX_ID,
|
||||||
Mch_PutParsEdit,Games,
|
Mch_PutParsEdit,Games,
|
||||||
"trophy.svg",Ico_BLACK);
|
"trophy.svg",Ico_BLACK);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
/* Result is forbidden to me */
|
/* Result is forbidden to me */
|
||||||
Ico_PutIconNotVisible ();
|
Ico_PutIconNotVisible ();
|
||||||
|
@ -841,8 +834,7 @@ static void Mch_ListOneOrMoreMatchesResultTch (struct Gam_Games *Games,
|
||||||
extern const char *Txt_Visible_results;
|
extern const char *Txt_Visible_results;
|
||||||
extern const char *Txt_Hidden_results;
|
extern const char *Txt_Hidden_results;
|
||||||
|
|
||||||
Games->Game.GamCod = Match->GamCod;
|
Games->MchCod = Match->MchCod;
|
||||||
Games->MchCod.Current = Match->MchCod;
|
|
||||||
|
|
||||||
/***** Show match results *****/
|
/***** Show match results *****/
|
||||||
if (Mch_CheckIfICanEditThisMatch (Match))
|
if (Mch_CheckIfICanEditThisMatch (Match))
|
||||||
|
@ -1118,10 +1110,10 @@ void Mch_RemoveMatchesMadeByUsrInCrs (long UsrCod,long CrsCod)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************ Edit a match (game instance) ***********************/
|
/**************** Request the creation or edition of a match *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mch_EditMatch (void)
|
void Mch_ReqCreatOrEditMatch (void)
|
||||||
{
|
{
|
||||||
struct Gam_Games Games;
|
struct Gam_Games Games;
|
||||||
struct Mch_Match Match;
|
struct Mch_Match Match;
|
||||||
|
@ -1138,10 +1130,10 @@ void Mch_EditMatch (void)
|
||||||
if (!Mch_CheckIfICanEditThisMatch (&Match))
|
if (!Mch_CheckIfICanEditThisMatch (&Match))
|
||||||
Err_NoPermissionExit ();
|
Err_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Show current game *****/
|
/***** Show game *****/
|
||||||
Gam_ShowOnlyOneGame (&Games,
|
Gam_ShowOnlyOneGame (&Games,
|
||||||
false, // Do not list game questions
|
false, // Do not list game questions
|
||||||
Frm_DONT_PUT_FORM);
|
Frm_PUT_FORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1153,7 +1145,7 @@ void Mch_PutParsEdit (void *Games)
|
||||||
if (Games)
|
if (Games)
|
||||||
{
|
{
|
||||||
Gam_PutPars (Games);
|
Gam_PutPars (Games);
|
||||||
ParCod_PutPar (ParCod_Mch,((struct Gam_Games *) Games)->MchCod.Current);
|
ParCod_PutPar (ParCod_Mch,((struct Gam_Games *) Games)->MchCod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1162,7 +1154,7 @@ void Mch_PutParsEdit (void *Games)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Mch_GetAndCheckPars (struct Gam_Games *Games,
|
void Mch_GetAndCheckPars (struct Gam_Games *Games,
|
||||||
struct Mch_Match *Match)
|
struct Mch_Match *Match)
|
||||||
{
|
{
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
/* Get parameters of game */
|
/* Get parameters of game */
|
||||||
|
@ -1170,150 +1162,76 @@ void Mch_GetAndCheckPars (struct Gam_Games *Games,
|
||||||
Err_WrongGameExit ();
|
Err_WrongGameExit ();
|
||||||
Grp_GetParWhichGroups ();
|
Grp_GetParWhichGroups ();
|
||||||
Gam_GetGameDataByCod (&Games->Game);
|
Gam_GetGameDataByCod (&Games->Game);
|
||||||
|
|
||||||
/* Get match code */
|
|
||||||
Match->MchCod = ParCod_GetAndCheckPar (ParCod_Mch);
|
|
||||||
Mch_GetMatchDataByCod (Match);
|
|
||||||
|
|
||||||
/***** Ensure parameters are correct *****/
|
|
||||||
if (Games->Game.GamCod != Match->GamCod)
|
|
||||||
Err_WrongGameExit ();
|
|
||||||
if (Games->Game.CrsCod != Gbl.Hierarchy.Node[Hie_CRS].HieCod)
|
if (Games->Game.CrsCod != Gbl.Hierarchy.Node[Hie_CRS].HieCod)
|
||||||
Err_WrongGameExit ();
|
Err_WrongGameExit ();
|
||||||
|
|
||||||
|
/* Get match code */
|
||||||
|
if ((Match->MchCod = ParCod_GetPar (ParCod_Mch)) > 0)
|
||||||
|
{
|
||||||
|
Mch_GetMatchDataByCod (Match);
|
||||||
|
if (Games->Game.GamCod != Match->GamCod)
|
||||||
|
Err_WrongGameExit ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Mch_ResetMatch (Match);
|
||||||
|
|
||||||
/***** Initialize context *****/
|
/***** Initialize context *****/
|
||||||
Games->MchCod.Current =
|
Games->MchCod = Match->MchCod;
|
||||||
Games->MchCod.Selected = Match->MchCod;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************* Put a form to change and existing match *****************/
|
/******************* Put a form to change and existing match *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Mch_PutFormExistingMatch (struct Gam_Games *Games,
|
static void Mch_PutFormMatch (struct Mch_Match *Match)
|
||||||
const struct Mch_Match *Match,
|
|
||||||
const char *Anchor)
|
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Games_matches;
|
extern const char *Hlp_ASSESSMENT_Games_matches;
|
||||||
extern const char *Txt_Title;
|
extern const char *Txt_Title;
|
||||||
extern const char *Txt_Save_changes;
|
bool ItsANewMatch = (Match->MchCod <= 0);
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin section for match *****/
|
||||||
Frm_BeginFormAnchor (ActChgMch,Anchor);
|
|
||||||
Mch_PutParsEdit (Games);
|
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
|
||||||
Box_BoxTableBegin (NULL,Match->Title,
|
|
||||||
NULL,NULL,
|
|
||||||
Hlp_ASSESSMENT_Games_matches,Box_CLOSABLE,2);
|
|
||||||
|
|
||||||
/***** Match title *****/
|
|
||||||
HTM_TR_Begin (NULL);
|
|
||||||
|
|
||||||
/* Label */
|
|
||||||
Frm_LabelColumn ("RT","Title",Txt_Title);
|
|
||||||
|
|
||||||
/* Data */
|
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
|
||||||
HTM_INPUT_TEXT ("Title",Mch_MAX_CHARS_TITLE,Match->Title,
|
|
||||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
|
||||||
"id=\"Title\" size=\"45\" class=\"INPUT_%s\""
|
|
||||||
" required=\"required\"",
|
|
||||||
The_GetSuffix ());
|
|
||||||
HTM_TD_End ();
|
|
||||||
|
|
||||||
HTM_TR_End ();
|
|
||||||
|
|
||||||
/***** Groups *****/
|
|
||||||
Mch_ShowLstGrpsToEditMatch (Match->MchCod);
|
|
||||||
|
|
||||||
/***** End table *****/
|
|
||||||
HTM_TABLE_End ();
|
|
||||||
|
|
||||||
/***** Put button to submit the form *****/
|
|
||||||
Btn_PutConfirmButton (Txt_Save_changes);
|
|
||||||
|
|
||||||
/***** End box *****/
|
|
||||||
Box_BoxEnd ();
|
|
||||||
|
|
||||||
/***** End form *****/
|
|
||||||
Frm_EndForm ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/********************** Put a form to create a new match *********************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static void Mch_PutFormNewMatch (const struct Gam_Game *Game)
|
|
||||||
{
|
|
||||||
extern const char *Hlp_ASSESSMENT_Games_matches;
|
|
||||||
extern const char *Txt_Match;
|
|
||||||
extern const char *Txt_Title;
|
|
||||||
extern const char *Txt_Play;
|
|
||||||
|
|
||||||
/***** Trivial check: roles allowed *****/
|
|
||||||
switch (Gbl.Usrs.Me.Role.Logged)
|
|
||||||
{
|
|
||||||
case Rol_NET:
|
|
||||||
case Rol_TCH:
|
|
||||||
case Rol_SYS_ADM:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Err_NoPermissionExit ();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Begin section for a new match *****/
|
|
||||||
HTM_SECTION_Begin (Mch_NEW_MATCH_SECTION_ID);
|
HTM_SECTION_Begin (Mch_NEW_MATCH_SECTION_ID);
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form to create/edit *****/
|
||||||
Frm_BeginForm (ActNewMch);
|
Frm_BeginFormTable (ItsANewMatch ? ActNewMch :
|
||||||
ParCod_PutPar (ParCod_Gam,Game->GamCod);
|
ActChgMch,
|
||||||
Gam_PutParQstInd (0); // Start by first question in game
|
Mch_NEW_MATCH_SECTION_ID,
|
||||||
|
Mch_ParsFormMatch,Match);
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Match title *****/
|
||||||
Box_BoxTableBegin (NULL,Txt_Match,
|
HTM_TR_Begin (NULL);
|
||||||
NULL,NULL,
|
|
||||||
Hlp_ASSESSMENT_Games_matches,Box_NOT_CLOSABLE,2);
|
|
||||||
|
|
||||||
/***** Match title *****/
|
/* Label */
|
||||||
HTM_TR_Begin (NULL);
|
Frm_LabelColumn ("RT","Title",Txt_Title);
|
||||||
|
|
||||||
/* Label */
|
/* Data */
|
||||||
Frm_LabelColumn ("RT","Title",Txt_Title);
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
|
HTM_INPUT_TEXT ("Title",Mch_MAX_CHARS_TITLE,Match->Title,
|
||||||
/* Data */
|
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
|
||||||
HTM_INPUT_TEXT ("Title",Mch_MAX_CHARS_TITLE,Game->Title,
|
|
||||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||||
"id=\"Title\" size=\"45\" class=\"INPUT_%s\""
|
"id=\"Title\" size=\"45\" class=\"INPUT_%s\""
|
||||||
" required=\"required\"",
|
" required=\"required\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
|
||||||
/***** Groups *****/
|
/***** Groups *****/
|
||||||
Mch_ShowLstGrpsToEditMatch (-1L);
|
Mch_ShowLstGrpsToEditMatch (Match->MchCod);
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End form to create *****/
|
||||||
HTM_TABLE_End ();
|
Frm_EndFormTable (ItsANewMatch ? Btn_CREATE_BUTTON :
|
||||||
|
Btn_CONFIRM_BUTTON);
|
||||||
|
|
||||||
/***** Put icon to submit the form *****/
|
/***** End section for exam session *****/
|
||||||
HTM_INPUT_IMAGE (Cfg_URL_ICON_PUBLIC,"play.svg",
|
|
||||||
Txt_Play,
|
|
||||||
"class=\"CONTEXT_OPT ICO_HIGHLIGHT ICO64x64\"");
|
|
||||||
|
|
||||||
/***** End box *****/
|
|
||||||
Box_BoxEnd ();
|
|
||||||
|
|
||||||
/***** End form *****/
|
|
||||||
Frm_EndForm ();
|
|
||||||
|
|
||||||
/***** End section for a new match *****/
|
|
||||||
HTM_SECTION_End ();
|
HTM_SECTION_End ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Mch_ParsFormMatch (void *Match)
|
||||||
|
{
|
||||||
|
ParCod_PutPar (ParCod_Gam,((struct Mch_Match *) Match)->GamCod);
|
||||||
|
ParCod_PutPar (ParCod_Mch,((struct Mch_Match *) Match)->MchCod);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Show list of groups to create a new match *****************/
|
/***************** Show list of groups to create a new match *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1334,7 +1252,7 @@ static void Mch_ShowLstGrpsToEditMatch (long MchCod)
|
||||||
HTM_TD_TxtColon (Txt_Groups);
|
HTM_TD_TxtColon (Txt_Groups);
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
|
|
||||||
Box_BoxTableBegin ("95%",NULL,
|
Box_BoxTableBegin ("100%",NULL,
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
NULL,Box_NOT_CLOSABLE,0);
|
NULL,Box_NOT_CLOSABLE,0);
|
||||||
|
|
||||||
|
@ -2759,7 +2677,7 @@ static void Mch_PutIfAnswered (const struct Mch_Match *Match,bool Answered)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************** Put checkbox to select if show results ********************/
|
/******************** Put checkbox to remove my answer ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Mch_PutIconToRemoveMyAnswer (const struct Mch_Match *Match)
|
static void Mch_PutIconToRemoveMyAnswer (const struct Mch_Match *Match)
|
||||||
|
@ -2771,7 +2689,7 @@ static void Mch_PutIconToRemoveMyAnswer (const struct Mch_Match *Match)
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
Frm_BeginForm (ActRemMchAnsQstStd);
|
Frm_BeginForm (ActRemMchAnsQstStd);
|
||||||
ParCod_PutPar (ParCod_Mch,Match->MchCod); // Current match being played
|
ParCod_PutPar (ParCod_Mch,Match->MchCod); // Current match being played
|
||||||
Gam_PutParQstInd (Match->Status.QstInd); // Current question index shown
|
Gam_PutParQstInd (Match->Status.QstInd); // Current question index shown
|
||||||
|
|
||||||
/***** Put icon with link *****/
|
/***** Put icon with link *****/
|
||||||
|
@ -3027,9 +2945,9 @@ static void Mch_ShowQuestionAndAnswersStd (const struct Mch_Match *Match,
|
||||||
is necessary in order to be fast
|
is necessary in order to be fast
|
||||||
and not lose clicks due to refresh */
|
and not lose clicks due to refresh */
|
||||||
Frm_BeginForm (ActAnsMchQstStd);
|
Frm_BeginForm (ActAnsMchQstStd);
|
||||||
ParCod_PutPar (ParCod_Mch,Match->MchCod); // Current match being played
|
ParCod_PutPar (ParCod_Mch,Match->MchCod); // Current match being played
|
||||||
Gam_PutParQstInd (Match->Status.QstInd); // Current question index shown
|
Gam_PutParQstInd (Match->Status.QstInd); // Current question index shown
|
||||||
Mch_PutParNumOpt (NumOpt); // Number of button
|
Mch_PutParNumOpt (NumOpt); // Number of button
|
||||||
|
|
||||||
HTM_BUTTON_Submit_Begin (NULL,
|
HTM_BUTTON_Submit_Begin (NULL,
|
||||||
"class=\"MCH_STD_BUTTON%s BT_%c\""
|
"class=\"MCH_STD_BUTTON%s BT_%c\""
|
||||||
|
|
|
@ -94,7 +94,8 @@ long Mch_GetMchCodBeingPlayed (void);
|
||||||
|
|
||||||
void Mch_ResetMatch (struct Mch_Match *Match);
|
void Mch_ResetMatch (struct Mch_Match *Match);
|
||||||
|
|
||||||
void Mch_ListMatches (struct Gam_Games *Games,Frm_PutForm_t PutFormNewMatch);
|
void Mch_ListMatches (struct Gam_Games *Games,
|
||||||
|
Frm_PutForm_t PutFormNewMatch);
|
||||||
void Mch_GetMatchDataByCod (struct Mch_Match *Match);
|
void Mch_GetMatchDataByCod (struct Mch_Match *Match);
|
||||||
|
|
||||||
void Mch_ToggleVisResultsMchUsr (void);
|
void Mch_ToggleVisResultsMchUsr (void);
|
||||||
|
@ -107,11 +108,11 @@ void Mch_RemoveMatchesInCourseFromAllTables (long CrsCod);
|
||||||
void Mch_RemoveMatchesMadeByUsrInAllCrss (long UsrCod);
|
void Mch_RemoveMatchesMadeByUsrInAllCrss (long UsrCod);
|
||||||
void Mch_RemoveMatchesMadeByUsrInCrs (long UsrCod,long CrsCod);
|
void Mch_RemoveMatchesMadeByUsrInCrs (long UsrCod,long CrsCod);
|
||||||
|
|
||||||
void Mch_EditMatch (void);
|
void Mch_ReqCreatOrEditMatch (void);
|
||||||
|
|
||||||
void Mch_PutParsEdit (void *Games);
|
void Mch_PutParsEdit (void *Games);
|
||||||
void Mch_GetAndCheckPars (struct Gam_Games *Games,
|
void Mch_GetAndCheckPars (struct Gam_Games *Games,
|
||||||
struct Mch_Match *Match);
|
struct Mch_Match *Match);
|
||||||
|
|
||||||
void Mch_CreateNewMatch (void);
|
void Mch_CreateNewMatch (void);
|
||||||
void Mch_ChangeMatch (void);
|
void Mch_ChangeMatch (void);
|
||||||
|
|
|
@ -874,8 +874,8 @@ static void MchRes_ShowMchResults (struct Gam_Games *Games,
|
||||||
The_GetColorRows ());
|
The_GetColorRows ());
|
||||||
if (ICanView.Result)
|
if (ICanView.Result)
|
||||||
{
|
{
|
||||||
Games->Game.GamCod = Match.GamCod;
|
Games->Game.GamCod = Match.GamCod;
|
||||||
Games->MchCod.Current = Match.MchCod;
|
Games->MchCod = Match.MchCod;
|
||||||
switch (MeOrOther)
|
switch (MeOrOther)
|
||||||
{
|
{
|
||||||
case Usr_ME:
|
case Usr_ME:
|
||||||
|
|
|
@ -1822,7 +1822,7 @@ static void Svy_ShowLstGrpsToEditSurvey (long SvyCod)
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
HTM_TD_TxtColon (Txt_Groups);
|
HTM_TD_TxtColon (Txt_Groups);
|
||||||
HTM_TD_Begin ("class=\"LT\"");
|
HTM_TD_Begin ("class=\"LT\"");
|
||||||
Box_BoxTableBegin ("95%",NULL,
|
Box_BoxTableBegin ("100%",NULL,
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
NULL,Box_NOT_CLOSABLE,0);
|
NULL,Box_NOT_CLOSABLE,0);
|
||||||
|
|
||||||
|
|
|
@ -12459,7 +12459,7 @@ const char *Txt_Actions[ActLst_NUM_ACTIONS] =
|
||||||
"Request new exam session" // Çeviri lazim!
|
"Request new exam session" // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[ActEdiOneExaSes] =
|
[ActReqChgExaSes] =
|
||||||
#if L==1 // ca
|
#if L==1 // ca
|
||||||
"Edit exam session" // Necessita traducció
|
"Edit exam session" // Necessita traducció
|
||||||
#elif L==2 // de
|
#elif L==2 // de
|
||||||
|
@ -12940,52 +12940,6 @@ const char *Txt_Actions[ActLst_NUM_ACTIONS] =
|
||||||
"See game" // Precisa de tradução
|
"See game" // Precisa de tradução
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"See game" // Çeviri lazim!
|
"See game" // Çeviri lazim!
|
||||||
#endif
|
|
||||||
,
|
|
||||||
[ActReqRemMch] =
|
|
||||||
#if L==1 // ca
|
|
||||||
"Request removal of match" // Necessita traducció
|
|
||||||
#elif L==2 // de
|
|
||||||
"Request removal of match" // Need Übersetzung
|
|
||||||
#elif L==3 // en
|
|
||||||
"Request removal of match"
|
|
||||||
#elif L==4 // es
|
|
||||||
"Solicitar eliminación de partida"
|
|
||||||
#elif L==5 // fr
|
|
||||||
"Request removal of match" // Besoin de traduction
|
|
||||||
#elif L==6 // gn
|
|
||||||
"Solicitar eliminación de partida" // Okoteve traducción
|
|
||||||
#elif L==7 // it
|
|
||||||
"Request removal of match" // Bisogno di traduzione
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Request removal of match" // Potrzebujesz tlumaczenie
|
|
||||||
#elif L==9 // pt
|
|
||||||
"Request removal of match" // Precisa de tradução
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Request removal of match" // Çeviri lazim!
|
|
||||||
#endif
|
|
||||||
,
|
|
||||||
[ActRemMch] =
|
|
||||||
#if L==1 // ca
|
|
||||||
"Eliminar partida"
|
|
||||||
#elif L==2 // de
|
|
||||||
"Spiel entfernen"
|
|
||||||
#elif L==3 // en
|
|
||||||
"Remove match"
|
|
||||||
#elif L==4 // es
|
|
||||||
"Eliminar partida"
|
|
||||||
#elif L==5 // fr
|
|
||||||
"Supprimer match"
|
|
||||||
#elif L==6 // gn
|
|
||||||
"Eliminar partida" // Okoteve traducción
|
|
||||||
#elif L==7 // it
|
|
||||||
"Rimuovere partita"
|
|
||||||
#elif L==8 // pl
|
|
||||||
"Usuń mecz"
|
|
||||||
#elif L==9 // pt
|
|
||||||
"Remover jogo"
|
|
||||||
#elif L==10 // tr
|
|
||||||
"Eşleşmeyi kaldır"
|
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[ActReqNewMch] =
|
[ActReqNewMch] =
|
||||||
|
@ -13009,6 +12963,29 @@ const char *Txt_Actions[ActLst_NUM_ACTIONS] =
|
||||||
"Request creation of new match" // Precisa de tradução
|
"Request creation of new match" // Precisa de tradução
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"Request creation of new match" // Çeviri lazim!
|
"Request creation of new match" // Çeviri lazim!
|
||||||
|
#endif
|
||||||
|
,
|
||||||
|
[ActReqChgMch] =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Request edition of match" // Necessita traducció
|
||||||
|
#elif L==2 // de
|
||||||
|
"Request edition of match" // Need Übersetzung
|
||||||
|
#elif L==3 // en
|
||||||
|
"Request edition of match"
|
||||||
|
#elif L==4 // es
|
||||||
|
"Solicitar creación de nueva partida"
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Request edition of match" // Besoin de traduction
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Solicitar creación de nueva partida" // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Request edition of match" // Bisogno di traduzione
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Request edition of match" // Potrzebujesz tlumaczenie
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Request edition of match" // Precisa de tradução
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Request edition of match" // Çeviri lazim!
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[ActNewMch] =
|
[ActNewMch] =
|
||||||
|
@ -13055,6 +13032,52 @@ const char *Txt_Actions[ActLst_NUM_ACTIONS] =
|
||||||
"Change match" // Precisa de tradução
|
"Change match" // Precisa de tradução
|
||||||
#elif L==10 // tr
|
#elif L==10 // tr
|
||||||
"Change match" // Çeviri lazim!
|
"Change match" // Çeviri lazim!
|
||||||
|
#endif
|
||||||
|
,
|
||||||
|
[ActReqRemMch] =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Request removal of match" // Necessita traducció
|
||||||
|
#elif L==2 // de
|
||||||
|
"Request removal of match" // Need Übersetzung
|
||||||
|
#elif L==3 // en
|
||||||
|
"Request removal of match"
|
||||||
|
#elif L==4 // es
|
||||||
|
"Solicitar eliminación de partida"
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Request removal of match" // Besoin de traduction
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Solicitar eliminación de partida" // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Request removal of match" // Bisogno di traduzione
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Request removal of match" // Potrzebujesz tlumaczenie
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Request removal of match" // Precisa de tradução
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Request removal of match" // Çeviri lazim!
|
||||||
|
#endif
|
||||||
|
,
|
||||||
|
[ActRemMch] =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Eliminar partida"
|
||||||
|
#elif L==2 // de
|
||||||
|
"Spiel entfernen"
|
||||||
|
#elif L==3 // en
|
||||||
|
"Remove match"
|
||||||
|
#elif L==4 // es
|
||||||
|
"Eliminar partida"
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Supprimer match"
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Eliminar partida" // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Rimuovere partita"
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Usuń mecz"
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Remover jogo"
|
||||||
|
#elif L==10 // tr
|
||||||
|
"Eşleşmeyi kaldır"
|
||||||
#endif
|
#endif
|
||||||
,
|
,
|
||||||
[ActResMch] =
|
[ActResMch] =
|
||||||
|
|
Loading…
Reference in New Issue