Version19.194.1

This commit is contained in:
acanas 2020-04-25 01:36:53 +02:00
parent f882a3beca
commit f50dc57cb6
17 changed files with 861 additions and 341 deletions

View File

@ -539,6 +539,8 @@ CREATE TABLE IF NOT EXISTS exa_sets (
SetCod INT NOT NULL AUTO_INCREMENT,
ExaCod INT NOT NULL,
SetInd INT NOT NULL DEFAULT 0,
NumQstsToExam INT NOT NULL DEFAULT 0,
Title VARCHAR(2047) NOT NULL,
UNIQUE INDEX(SetCod),
INDEX(ExaCod,SetInd));
--

View File

@ -717,11 +717,15 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
[ActRemExa ] = {1882,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RemoveExam ,NULL},
[ActHidExa ] = {1883,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_HideExam ,NULL},
[ActShoExa ] = {1884,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_UnhideExam ,NULL},
[ActAddOneExaSet ] = {1892,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Exa_RequestNewSet ,NULL},
[ActReqRemExaSet ] = {1893,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RequestRemoveSet ,NULL},
[ActRemExaSet ] = {1894,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_RemoveSet ,NULL},
[ActUp_ExaSet ] = {1895,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_MoveUpSet ,NULL},
[ActDwnExaSet ] = {1896,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_MoveDownSet ,NULL},
[ActFrmNewExaSet ] = {1892,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,ExaSet_RequestCreatOrEditSet ,NULL},
[ActEdiOneExaSet ] = {1897,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_RequestCreatOrEditSet ,NULL},
[ActNewExaSet ] = {1898,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_RecFormSet ,NULL},
[ActChgExaSet ] = {1899,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_RecFormSet ,NULL},
[ActReqRemExaSet ] = {1893,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_RequestRemoveSet ,NULL},
[ActRemExaSet ] = {1894,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_RemoveSet ,NULL},
[ActUp_ExaSet ] = {1895,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_MoveUpSet ,NULL},
[ActDwnExaSet ] = {1896,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,ExaSet_MoveDownSet ,NULL},
[ActAddOneExaQst ] = {1885,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,Dat_SetIniEndDates ,Exa_RequestNewQuestion ,NULL},
[ActLstTstQstForExa ] = {1886,-1,TabUnk,ActSeeAllExa ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Exa_ListQuestionsToSelect ,NULL},
@ -3700,11 +3704,14 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActRemExaQst, // #1889
ActUp_ExaQst, // #1890
ActDwnExaQst, // #1891
ActAddOneExaSet, // #1892
ActFrmNewExaSet, // #1892
ActReqRemExaSet, // #1893
ActRemExaSet, // #1894
ActUp_ExaSet, // #1895
ActDwnExaSet, // #1896
ActEdiOneExaSet, // #1897
ActNewExaSet, // #1898
ActChgExaSet, // #1899
};
/*****************************************************************************/

View File

@ -64,7 +64,7 @@ typedef enum
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_MAX_ACTION_COD 1896
#define Act_MAX_ACTION_COD 1899
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
@ -683,95 +683,98 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActRemExa (ActChgCrsTT1stDay + 156)
#define ActHidExa (ActChgCrsTT1stDay + 157)
#define ActShoExa (ActChgCrsTT1stDay + 158)
#define ActAddOneExaSet (ActChgCrsTT1stDay + 159)
#define ActReqRemExaSet (ActChgCrsTT1stDay + 160)
#define ActRemExaSet (ActChgCrsTT1stDay + 161)
#define ActUp_ExaSet (ActChgCrsTT1stDay + 162)
#define ActDwnExaSet (ActChgCrsTT1stDay + 163)
#define ActFrmNewExaSet (ActChgCrsTT1stDay + 159)
#define ActEdiOneExaSet (ActChgCrsTT1stDay + 160)
#define ActNewExaSet (ActChgCrsTT1stDay + 161)
#define ActChgExaSet (ActChgCrsTT1stDay + 162)
#define ActReqRemExaSet (ActChgCrsTT1stDay + 163)
#define ActRemExaSet (ActChgCrsTT1stDay + 164)
#define ActUp_ExaSet (ActChgCrsTT1stDay + 165)
#define ActDwnExaSet (ActChgCrsTT1stDay + 166)
#define ActAddOneExaQst (ActChgCrsTT1stDay + 164)
#define ActLstTstQstForExa (ActChgCrsTT1stDay + 165)
#define ActAddQstToExa (ActChgCrsTT1stDay + 166)
#define ActReqRemExaQst (ActChgCrsTT1stDay + 167)
#define ActRemExaQst (ActChgCrsTT1stDay + 168)
#define ActUp_ExaQst (ActChgCrsTT1stDay + 169)
#define ActDwnExaQst (ActChgCrsTT1stDay + 170)
#define ActAddOneExaQst (ActChgCrsTT1stDay + 167)
#define ActLstTstQstForExa (ActChgCrsTT1stDay + 168)
#define ActAddQstToExa (ActChgCrsTT1stDay + 169)
#define ActReqRemExaQst (ActChgCrsTT1stDay + 170)
#define ActRemExaQst (ActChgCrsTT1stDay + 171)
#define ActUp_ExaQst (ActChgCrsTT1stDay + 172)
#define ActDwnExaQst (ActChgCrsTT1stDay + 173)
#define ActSeeGam (ActChgCrsTT1stDay + 171)
#define ActReqRemMch (ActChgCrsTT1stDay + 172)
#define ActRemMch (ActChgCrsTT1stDay + 173)
#define ActReqNewMch (ActChgCrsTT1stDay + 174)
#define ActNewMch (ActChgCrsTT1stDay + 175)
#define ActResMch (ActChgCrsTT1stDay + 176)
#define ActBckMch (ActChgCrsTT1stDay + 177)
#define ActPlyPauMch (ActChgCrsTT1stDay + 178)
#define ActFwdMch (ActChgCrsTT1stDay + 179)
#define ActChgNumColMch (ActChgCrsTT1stDay + 180)
#define ActChgVisResMchQst (ActChgCrsTT1stDay + 181)
#define ActMchCntDwn (ActChgCrsTT1stDay + 182)
#define ActRefMchTch (ActChgCrsTT1stDay + 183)
#define ActSeeGam (ActChgCrsTT1stDay + 174)
#define ActReqRemMch (ActChgCrsTT1stDay + 175)
#define ActRemMch (ActChgCrsTT1stDay + 176)
#define ActReqNewMch (ActChgCrsTT1stDay + 177)
#define ActNewMch (ActChgCrsTT1stDay + 178)
#define ActResMch (ActChgCrsTT1stDay + 179)
#define ActBckMch (ActChgCrsTT1stDay + 180)
#define ActPlyPauMch (ActChgCrsTT1stDay + 181)
#define ActFwdMch (ActChgCrsTT1stDay + 182)
#define ActChgNumColMch (ActChgCrsTT1stDay + 183)
#define ActChgVisResMchQst (ActChgCrsTT1stDay + 184)
#define ActMchCntDwn (ActChgCrsTT1stDay + 185)
#define ActRefMchTch (ActChgCrsTT1stDay + 186)
#define ActJoiMch (ActChgCrsTT1stDay + 184)
#define ActSeeMchAnsQstStd (ActChgCrsTT1stDay + 185)
#define ActRemMchAnsQstStd (ActChgCrsTT1stDay + 186)
#define ActAnsMchQstStd (ActChgCrsTT1stDay + 187)
#define ActRefMchStd (ActChgCrsTT1stDay + 188)
#define ActJoiMch (ActChgCrsTT1stDay + 187)
#define ActSeeMchAnsQstStd (ActChgCrsTT1stDay + 188)
#define ActRemMchAnsQstStd (ActChgCrsTT1stDay + 189)
#define ActAnsMchQstStd (ActChgCrsTT1stDay + 190)
#define ActRefMchStd (ActChgCrsTT1stDay + 191)
#define ActSeeMyMchResCrs (ActChgCrsTT1stDay + 189)
#define ActSeeMyMchResGam (ActChgCrsTT1stDay + 190)
#define ActSeeMyMchResMch (ActChgCrsTT1stDay + 191)
#define ActSeeOneMchResMe (ActChgCrsTT1stDay + 192)
#define ActSeeMyMchResCrs (ActChgCrsTT1stDay + 192)
#define ActSeeMyMchResGam (ActChgCrsTT1stDay + 193)
#define ActSeeMyMchResMch (ActChgCrsTT1stDay + 194)
#define ActSeeOneMchResMe (ActChgCrsTT1stDay + 195)
#define ActReqSeeAllMchRes (ActChgCrsTT1stDay + 193)
#define ActSeeAllMchResCrs (ActChgCrsTT1stDay + 194)
#define ActSeeAllMchResGam (ActChgCrsTT1stDay + 195)
#define ActSeeAllMchResMch (ActChgCrsTT1stDay + 196)
#define ActSeeOneMchResOth (ActChgCrsTT1stDay + 197)
#define ActReqSeeAllMchRes (ActChgCrsTT1stDay + 196)
#define ActSeeAllMchResCrs (ActChgCrsTT1stDay + 197)
#define ActSeeAllMchResGam (ActChgCrsTT1stDay + 198)
#define ActSeeAllMchResMch (ActChgCrsTT1stDay + 199)
#define ActSeeOneMchResOth (ActChgCrsTT1stDay + 200)
#define ActChgVisResMchUsr (ActChgCrsTT1stDay + 198)
#define ActChgVisResMchUsr (ActChgCrsTT1stDay + 201)
#define ActFrmNewGam (ActChgCrsTT1stDay + 199)
#define ActEdiOneGam (ActChgCrsTT1stDay + 200)
#define ActNewGam (ActChgCrsTT1stDay + 201)
#define ActChgGam (ActChgCrsTT1stDay + 202)
#define ActReqRemGam (ActChgCrsTT1stDay + 203)
#define ActRemGam (ActChgCrsTT1stDay + 204)
#define ActHidGam (ActChgCrsTT1stDay + 205)
#define ActShoGam (ActChgCrsTT1stDay + 206)
#define ActAddOneGamQst (ActChgCrsTT1stDay + 207)
#define ActGamLstTstQst (ActChgCrsTT1stDay + 208)
#define ActAddTstQstToGam (ActChgCrsTT1stDay + 209)
#define ActReqRemGamQst (ActChgCrsTT1stDay + 210)
#define ActRemGamQst (ActChgCrsTT1stDay + 211)
#define ActUp_GamQst (ActChgCrsTT1stDay + 212)
#define ActDwnGamQst (ActChgCrsTT1stDay + 213)
#define ActFrmNewGam (ActChgCrsTT1stDay + 202)
#define ActEdiOneGam (ActChgCrsTT1stDay + 203)
#define ActNewGam (ActChgCrsTT1stDay + 204)
#define ActChgGam (ActChgCrsTT1stDay + 205)
#define ActReqRemGam (ActChgCrsTT1stDay + 206)
#define ActRemGam (ActChgCrsTT1stDay + 207)
#define ActHidGam (ActChgCrsTT1stDay + 208)
#define ActShoGam (ActChgCrsTT1stDay + 209)
#define ActAddOneGamQst (ActChgCrsTT1stDay + 210)
#define ActGamLstTstQst (ActChgCrsTT1stDay + 211)
#define ActAddTstQstToGam (ActChgCrsTT1stDay + 212)
#define ActReqRemGamQst (ActChgCrsTT1stDay + 213)
#define ActRemGamQst (ActChgCrsTT1stDay + 214)
#define ActUp_GamQst (ActChgCrsTT1stDay + 215)
#define ActDwnGamQst (ActChgCrsTT1stDay + 216)
#define ActSeeSvy (ActChgCrsTT1stDay + 214)
#define ActAnsSvy (ActChgCrsTT1stDay + 215)
#define ActFrmNewSvy (ActChgCrsTT1stDay + 216)
#define ActEdiOneSvy (ActChgCrsTT1stDay + 217)
#define ActNewSvy (ActChgCrsTT1stDay + 218)
#define ActChgSvy (ActChgCrsTT1stDay + 219)
#define ActReqRemSvy (ActChgCrsTT1stDay + 220)
#define ActRemSvy (ActChgCrsTT1stDay + 221)
#define ActReqRstSvy (ActChgCrsTT1stDay + 222)
#define ActRstSvy (ActChgCrsTT1stDay + 223)
#define ActHidSvy (ActChgCrsTT1stDay + 224)
#define ActShoSvy (ActChgCrsTT1stDay + 225)
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 226)
#define ActRcvSvyQst (ActChgCrsTT1stDay + 227)
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 228)
#define ActRemSvyQst (ActChgCrsTT1stDay + 229)
#define ActSeeSvy (ActChgCrsTT1stDay + 217)
#define ActAnsSvy (ActChgCrsTT1stDay + 218)
#define ActFrmNewSvy (ActChgCrsTT1stDay + 219)
#define ActEdiOneSvy (ActChgCrsTT1stDay + 220)
#define ActNewSvy (ActChgCrsTT1stDay + 221)
#define ActChgSvy (ActChgCrsTT1stDay + 222)
#define ActReqRemSvy (ActChgCrsTT1stDay + 223)
#define ActRemSvy (ActChgCrsTT1stDay + 224)
#define ActReqRstSvy (ActChgCrsTT1stDay + 225)
#define ActRstSvy (ActChgCrsTT1stDay + 226)
#define ActHidSvy (ActChgCrsTT1stDay + 227)
#define ActShoSvy (ActChgCrsTT1stDay + 228)
#define ActEdiOneSvyQst (ActChgCrsTT1stDay + 229)
#define ActRcvSvyQst (ActChgCrsTT1stDay + 230)
#define ActReqRemSvyQst (ActChgCrsTT1stDay + 231)
#define ActRemSvyQst (ActChgCrsTT1stDay + 232)
#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 230)
#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 231)
#define ActEdiExaAnn (ActChgCrsTT1stDay + 232)
#define ActRcvExaAnn (ActChgCrsTT1stDay + 233)
#define ActPrnExaAnn (ActChgCrsTT1stDay + 234)
#define ActReqRemExaAnn (ActChgCrsTT1stDay + 235)
#define ActRemExaAnn (ActChgCrsTT1stDay + 236)
#define ActHidExaAnn (ActChgCrsTT1stDay + 237)
#define ActShoExaAnn (ActChgCrsTT1stDay + 238)
#define ActSeeOneExaAnn (ActChgCrsTT1stDay + 233)
#define ActSeeDatExaAnn (ActChgCrsTT1stDay + 234)
#define ActEdiExaAnn (ActChgCrsTT1stDay + 235)
#define ActRcvExaAnn (ActChgCrsTT1stDay + 236)
#define ActPrnExaAnn (ActChgCrsTT1stDay + 237)
#define ActReqRemExaAnn (ActChgCrsTT1stDay + 238)
#define ActRemExaAnn (ActChgCrsTT1stDay + 239)
#define ActHidExaAnn (ActChgCrsTT1stDay + 240)
#define ActShoExaAnn (ActChgCrsTT1stDay + 241)
/*****************************************************************************/
/******************************** Files tab **********************************/

View File

@ -544,11 +544,18 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.194 (2020-04-24)"
#define Log_PLATFORM_VERSION "SWAD 19.195 (2020-04-25)"
#define CSS_FILE "swad19.193.1.css"
#define JS_FILE "swad19.193.1.js"
/*
Version 19.194: Apr 24, 2020 New database table for question sets in exams. (298257 lines)
Version 19.195: Apr 25, 2020 Changes in sets of questions. (298699 lines)
2 changes necessary in database:
ALTER TABLE exa_sets ADD COLUMN NumQstsToExam INT NOT NULL DEFAULT 0 AFTER SetInd;
ALTER TABLE exa_sets ADD COLUMN Title VARCHAR(2047) NOT NULL AFTER NumQstsToExam;
Version 19.194.1: Apr 24, 2020 Translate messages related to sets of questions. (? lines)
Version 19.194: Apr 24, 2020 New database table for set of questions in exams. (298257 lines)
1 change necessary in database:
CREATE TABLE IF NOT EXISTS exa_sets (SetCod INT NOT NULL AUTO_INCREMENT,ExaCod INT NOT NULL,SetInd INT NOT NULL DEFAULT 0,UNIQUE INDEX(SetCod),INDEX(ExaCod,SetInd));

View File

@ -1185,19 +1185,23 @@ mysql> DESCRIBE exa_results;
/***** Table exa_sets *****/
/*
mysql> DESCRIBE exa_sets;
+--------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+---------+------+-----+---------+-------+
| ExaCod | int(11) | NO | MUL | NULL | |
| QstCod | int(11) | NO | MUL | NULL | |
| QstInd | int(11) | NO | | 0 | |
+--------+---------+------+-----+---------+-------+
3 rows in set (0.01 sec)
+---------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------+------+-----+---------+----------------+
| SetCod | int(11) | NO | PRI | NULL | auto_increment |
| ExaCod | int(11) | NO | MUL | NULL | |
| SetInd | int(11) | NO | | 0 | |
| NumQstsToExam | int(11) | NO | | 0 | |
| Title | varchar(2047) | NO | | NULL | |
+---------------+---------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS exa_sets ("
"SetCod INT NOT NULL AUTO_INCREMENT,"
"ExaCod INT NOT NULL,"
"SetInd INT NOT NULL DEFAULT 0,"
"NumQstsToExam INT NOT NULL DEFAULT 0,"
"Title VARCHAR(2047) NOT NULL," // ExaSet_MAX_BYTES_TITLE
"UNIQUE INDEX(SetCod),"
"INDEX(ExaCod,SetInd))");

File diff suppressed because it is too large Load Diff

View File

@ -38,6 +38,9 @@
#define Exa_MAX_CHARS_TITLE (128 - 1) // 127
#define Exa_MAX_BYTES_TITLE ((Exa_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
#define ExaSet_MAX_CHARS_TITLE (128 - 1) // 127
#define ExaSet_MAX_BYTES_TITLE ((ExaSet_MAX_CHARS_TITLE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
#define Exa_NUM_ORDERS 3
typedef enum
{
@ -61,6 +64,7 @@ struct Exa_ExamSelected
bool Selected; // Is this exam selected when seeing match results?
};
/* Exams context */
struct Exa_Exams
{
bool LstIsRead; // Is the list already read from database...
@ -73,6 +77,7 @@ struct Exa_Exams
char *ListQuestions;
char *ExaCodsSelected; // String with selected exam codes separated by separator multiple
long ExaCod; // Selected/current exam code
long SetCod; // Selected/current set code
long EvtCod; // Selected/current match code
unsigned SetInd; // Current set index
unsigned QstInd; // Current question index
@ -95,9 +100,13 @@ struct Exa_Exam
unsigned NumUnfinishedEvts; // Number of unfinished events in the exam
};
struct Exa_Set
struct ExaSet_Set
{
long SetCod;
long ExaCod; // Exam code
long SetCod; // Set code
unsigned SetInd; // Set index (position in the exam)
unsigned NumQstsToExam; // Number of questions in this set taht will appear in the exam
char Title[ExaSet_MAX_BYTES_TITLE + 1]; // Title of the set
};
/*****************************************************************************/
@ -123,7 +132,8 @@ void Exa_SetCurrentExaCod (long ExaCod);
void Exa_PutParams (void *Exams);
void Exa_PutParamExamCod (long ExaCod);
long Exa_GetParamExamCod (void);
long Exa_GetParams (struct Exa_Exams *Exams);
long ExaSet_GetParamSetCod (void);
void Exa_GetParams (struct Exa_Exams *Exams);
void Exa_GetListExams (struct Exa_Exams *Exams,Exa_Order_t SelectedOrder);
void Exa_GetListSelectedExaCods (struct Exa_Exams *Exams);
@ -140,6 +150,7 @@ void Exa_UnhideExam (void);
void Exa_RequestCreatOrEditExam (void);
void ExaSet_RecFormSet (void);
void Exa_RecFormExam (void);
bool Mch_CheckIfMatchIsAssociatedToGrp (long EvtCod,long GrpCod);
@ -147,6 +158,7 @@ unsigned Exa_GetNumQstsExam (long ExaCod);
void Exa_RequestNewSet (void);
void ExaSet_RequestCreatOrEditSet (void);
void Exa_RequestNewQuestion (void);
void Exa_ListQuestionsToSelect (void);
@ -159,11 +171,11 @@ unsigned Exa_GetNextQuestionIndexInExam (long ExaCod,unsigned QstInd);
void Exa_AddQuestionsToExam (void);
void Exa_RequestRemoveSet (void);
void Exa_RemoveSet (void);
void ExaSet_RequestRemoveSet (void);
void ExaSet_RemoveSet (void);
void Exa_MoveUpSet (void);
void Exa_MoveDownSet (void);
void ExaSet_MoveUpSet (void);
void ExaSet_MoveDownSet (void);
void Exa_RequestRemoveQst (void);
void Exa_RemoveQst (void);

View File

@ -1292,22 +1292,22 @@ void ExaEvt_GetAndCheckParameters (struct Exa_Exams *Exams,
struct ExaEvt_Event *Event)
{
/***** Get parameters *****/
/* Get parameters of exam */
if ((Exam->ExaCod = Exa_GetParams (Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetParams (Exams);
if (Exams->ExaCod <= 0)
Lay_WrongExamExit ();
Exam->ExaCod = Exams->ExaCod;
Grp_GetParamWhichGroups ();
Exa_GetDataOfExamByCod (Exam);
/* Get exam event code */
if ((Event->EvtCod = ExaEvt_GetParamEvtCod ()) <= 0)
Lay_ShowErrorAndExit ("Code of exam event is missing.");
Lay_WrongEventExit ();
/***** Get data of exam and event from database *****/
Exa_GetDataOfExamByCod (Exam);
ExaEvt_GetDataOfEventByCod (Event);
/***** Ensure parameters are correct *****/
if (Exam->ExaCod != Event->ExaCod)
Lay_ShowErrorAndExit ("Wrong exam code.");
if (Exam->CrsCod != Gbl.Hierarchy.Crs.CrsCod)
Lay_ShowErrorAndExit ("Event does not belong to this course.");
if (Exam->ExaCod != Event->ExaCod ||
Exam->CrsCod != Gbl.Hierarchy.Crs.CrsCod)
Lay_WrongExamExit ();
}
/*****************************************************************************/

View File

@ -164,8 +164,12 @@ void ExaRes_ShowMyExaResultsInExa (void)
Exa_ResetExam (&Exam);
/***** Get parameters *****/
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetParams (&Exams);
if (Exams.ExaCod <= 0)
Lay_WrongExamExit ();
Exam.ExaCod = Exams.ExaCod;
/***** Get data of exam from database *****/
Exa_GetDataOfExamByCod (&Exam);
/***** Exam begin *****/
@ -214,10 +218,12 @@ void ExaRes_ShowMyExaResultsInEvt (void)
ExaEvt_ResetEvent (&Event);
/***** Get parameters *****/
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetParams (&Exams);
if (Exams.ExaCod <= 0)
Lay_WrongExamExit ();
Exam.ExaCod = Exams.ExaCod;
if ((Event.EvtCod = ExaEvt_GetParamEvtCod ()) <= 0)
Lay_ShowErrorAndExit ("Code of event is missing.");
Lay_WrongEventExit ();
Exa_GetDataOfExamByCod (&Exam);
ExaEvt_GetDataOfEventByCod (&Event);
@ -366,8 +372,10 @@ void ExaRes_ShowAllExaResultsInExa (void)
Exa_ResetExam (&Exam);
/***** Get parameters *****/
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetParams (&Exams);
if (Exams.ExaCod <= 0)
Lay_WrongExamExit ();
Exam.ExaCod = Exams.ExaCod;
Exa_GetDataOfExamByCod (&Exam);
/***** Exam begin *****/
@ -457,10 +465,14 @@ void ExaRes_ShowAllExaResultsInEvt (void)
ExaEvt_ResetEvent (&Event);
/***** Get parameters *****/
if ((Exam.ExaCod = Exa_GetParams (&Exams)) <= 0)
Lay_ShowErrorAndExit ("Code of exam is missing.");
Exa_GetParams (&Exams);
if (Exams.ExaCod <= 0)
Lay_WrongExamExit ();
Exam.ExaCod = Exams.ExaCod;
if ((Event.EvtCod = ExaEvt_GetParamEvtCod ()) <= 0)
Lay_ShowErrorAndExit ("Code of event is missing.");
Lay_WrongEventExit ();
/***** Get data of exam and event *****/
Exa_GetDataOfExamByCod (&Exam);
ExaEvt_GetDataOfEventByCod (&Event);

View File

@ -4361,7 +4361,7 @@ static long For_GetThrInMyClipboard (void)
MYSQL_RES *mysql_res;
MYSQL_ROW row;
unsigned long NumRows;
long ThrCod = -1L;;
long ThrCod = -1L;
/***** Get if there is a thread ready to move in my clipboard from database *****/
NumRows = DB_QuerySELECT (&mysql_res,"can not check if there is"

View File

@ -1484,6 +1484,24 @@ void Lay_WrongTypeOfViewExit (void)
Lay_ShowErrorAndExit ("Wrong type of view.");
}
/*****************************************************************************/
/************** Write error message and exit when wrong exam *****************/
/*****************************************************************************/
void Lay_WrongExamExit (void)
{
Lay_ShowErrorAndExit ("Wrong exam.");
}
/*****************************************************************************/
/************** Write error message and exit when wrong event ****************/
/*****************************************************************************/
void Lay_WrongEventExit (void)
{
Lay_ShowErrorAndExit ("Wrong event.");
}
/*****************************************************************************/
/******* Write error message, close files, remove lock file, and exit ********/
/*****************************************************************************/

View File

@ -73,6 +73,8 @@ void Lay_NotEnoughMemoryExit (void);
void Lay_WrongScopeExit (void);
void Lay_WrongOrderExit (void);
void Lay_WrongTypeOfViewExit (void);
void Lay_WrongExamExit (void);
void Lay_WrongEventExit (void);
void Lay_NoPermissionExit (void);
void Lay_ShowErrorAndExit (const char *Txt);

View File

@ -304,7 +304,7 @@ void Lnk_GetListLinks (void)
/***** Create list with places *****/
if ((Gbl.Links.Lst = (struct Link *) calloc (NumRows,sizeof (struct Link))) == NULL)
Lay_NotEnoughMemoryExit ();;
Lay_NotEnoughMemoryExit ();
/***** Get the links *****/
for (NumLnk = 0;

View File

@ -2352,7 +2352,7 @@ void TstRes_GetExamQuestionsFromDB (struct TstRes_Result *Result)
DB_FreeMySQLResult (&mysql_res);
if (NumQsts != Result->NumQsts)
Lay_ShowErrorAndExit ("Wrong exam.");
Lay_WrongExamExit ();
}
/*****************************************************************************/

View File

@ -931,6 +931,69 @@ const char *Txt_Action =
"A&ccedil;&atilde;o";
#endif
const char *Txt_Add_questions =
#if L==1 // ca
"Afegir preguntes";
#elif L==2 // de
"F&uuml;gen Fragen";
#elif L==3 // en
"Add questions";
#elif L==4 // es
"A&ntilde;adir preguntas";
#elif L==5 // fr
"Ajouter questions";
#elif L==6 // gn
"A&ntilde;adir preguntas"; // Okoteve traducción
#elif L==7 // it
"Aggiungere domande";
#elif L==8 // pl
"Dodaj pytania";
#elif L==9 // pt
"Adicionar perguntas";
#endif
const char *Txt_Add_this_ID =
#if L==1 // ca
"Afegir aquest ID";
#elif L==2 // de
"F&uuml;gen Sie diese Ausweis-Nr.";
#elif L==3 // en
"Add this ID";
#elif L==4 // es
"A&ntilde;adir este ID";
#elif L==5 // fr
"Ajouter ce num&eacute;ro d'identit&eacute;";
#elif L==6 // gn
"A&ntilde;adir este ID"; // Okoteve traducción
#elif L==7 // it
"Aggiungere questa carta d'identit&agrave;";
#elif L==8 // pl
"Dodaj ten identyfikator";
#elif L==9 // pt
"Adicionar este n&ordm; identif.";
#endif
const char *Txt_Add_USERS = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Afegir %s";
#elif L==2 // de
"F&uuml;gen %s";
#elif L==3 // en
"Add %s";
#elif L==4 // es
"A&ntilde;adir %s";
#elif L==5 // fr
"Ajouter %s";
#elif L==6 // gn
"A&ntilde;adir %s"; // Okoteve traducción
#elif L==7 // it
"Aggiungere %s";
#elif L==8 // pl
"Dodaj %s";
#elif L==9 // pt
"Adicionar %s";
#endif
const char *Txt_Administer_me =
#if L==1 // ca
"Administrarme";
@ -1843,69 +1906,6 @@ const char *Txt_Another_user_s_profile =
"Perfil de outro usu&aacute;rio";
#endif
const char *Txt_Add_questions =
#if L==1 // ca
"Afegir preguntes";
#elif L==2 // de
"F&uuml;gen Fragen";
#elif L==3 // en
"Add questions";
#elif L==4 // es
"A&ntilde;adir preguntas";
#elif L==5 // fr
"Ajouter questions";
#elif L==6 // gn
"A&ntilde;adir preguntas"; // Okoteve traducción
#elif L==7 // it
"Aggiungere domande";
#elif L==8 // pl
"Dodaj pytania";
#elif L==9 // pt
"Adicionar perguntas";
#endif
const char *Txt_Add_this_ID =
#if L==1 // ca
"Afegir aquest ID";
#elif L==2 // de
"F&uuml;gen Sie diese Ausweis-Nr.";
#elif L==3 // en
"Add this ID";
#elif L==4 // es
"A&ntilde;adir este ID";
#elif L==5 // fr
"Ajouter ce num&eacute;ro d'identit&eacute;";
#elif L==6 // gn
"A&ntilde;adir este ID"; // Okoteve traducción
#elif L==7 // it
"Aggiungere questa carta d'identit&agrave;";
#elif L==8 // pl
"Dodaj ten identyfikator";
#elif L==9 // pt
"Adicionar este n&ordm; identif.";
#endif
const char *Txt_Add_USERS = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Afegir %s";
#elif L==2 // de
"F&uuml;gen %s";
#elif L==3 // en
"Add %s";
#elif L==4 // es
"A&ntilde;adir %s";
#elif L==5 // fr
"Ajouter %s";
#elif L==6 // gn
"A&ntilde;adir %s"; // Okoteve traducción
#elif L==7 // it
"Aggiungere %s";
#elif L==8 // pl
"Dodaj %s";
#elif L==9 // pt
"Adicionar %s";
#endif
const char *Txt_Announcement_created =
#if L==1 // ca
"Anunci creat.";
@ -25328,6 +25328,27 @@ const char *Txt_New_room =
"Nova sala";
#endif
const char *Txt_New_set_of_questions =
#if L==1 // ca
"Nou conjunt de preguntes";
#elif L==2 // de
"Neue Satz von Fragen";
#elif L==3 // en
"New set of questions";
#elif L==4 // es
"Nuevo conjunto de preguntas";
#elif L==5 // fr
"Nouveau ensemble de questions";
#elif L==6 // gn
"Nuevo conjunto de preguntas"; // Okoteve traducción
#elif L==7 // it
"Nuova serie di domande";
#elif L==8 // pl
"Nowy zestaw pyta&nacute;";
#elif L==9 // pt
"Novo conjunto de perguntas";
#endif
const char *Txt_New_TIMELINE_comment =
#if L==1 // ca
"Nou comentari";
@ -40836,6 +40857,27 @@ const char *Txt_sessions =
"sess&otilde;es";
#endif
const char *Txt_Set_of_questions =
#if L==1 // ca
"Conjunt de preguntes";
#elif L==2 // de
"Satz von Fragen";
#elif L==3 // en
"Set of questions";
#elif L==4 // es
"Conjunto de preguntas";
#elif L==5 // fr
"Ensemble de questions";
#elif L==6 // gn
"Conjunto de preguntas"; // Okoteve traducción
#elif L==7 // it
"Serie di domande";
#elif L==8 // pl
"Zestaw pyta&nacute;";
#elif L==9 // pt
"Conjunto de perguntas";
#endif
const char *Txt_Set_password =
#if L==1 // ca
"Establir contrasenya";
@ -40878,6 +40920,27 @@ const char *Txt_Set_up =
"Instalar";
#endif
const char *Txt_Sets_of_questions =
#if L==1 // ca
"Conjunts de preguntes";
#elif L==2 // de
"S&auml;tze von Fragen";
#elif L==3 // en
"Sets of questions";
#elif L==4 // es
"Conjuntos de preguntas";
#elif L==5 // fr
"Ensembles de questions";
#elif L==6 // gn
"Conjuntos de preguntas"; // Okoteve traducción
#elif L==7 // it
"Serie di domande";
#elif L==8 // pl
"Zestaw&oacute;w pyta&nacute;";
#elif L==9 // pt
"Conjuntos de perguntas";
#endif
const char *Txt_Settings =
#if L==1 // ca
"Configuraci&oacute;";
@ -51313,6 +51376,27 @@ const char *Txt_There_was_a_problem_sending_an_email_automatically =
"Ocorreu um problema ao enviar um email automaticamente.";
#endif
const char *Txt_This_exam_has_no_sets_of_questions =
#if L==1 // ca
"Aquest examen no t&eacute; conjunts de preguntes.";
#elif L==2 // de
"Dieses Pr&uuml;fung hat keine s&auml;tze von Fragen.";
#elif L==3 // en
"This exam has no sets of questions.";
#elif L==4 // es
"Este examen no tiene conjuntos de preguntas.";
#elif L==5 // fr
"Cet examen n'a pas d'ensembles de questions.";
#elif L==6 // gn
"Este examen no tiene conjuntos de preguntas."; // Okoteve traducción
#elif L==7 // it
"Questo esame non ha serie di domande.";
#elif L==8 // pl
"Ten egzamin nie ma zestaw&oacute;w pyta&nacute;.";
#elif L==9 // pt
"Este exame n&atilde;o tem conjuntos de perguntas.";
#endif
const char *Txt_This_exam_has_no_questions =
#if L==1 // ca
"Aquest examen no t&eacute; preguntes.";

View File

@ -4664,7 +4664,7 @@ static void TL_RemoveCommentMediaAndDBEntries (long PubCod)
{
MYSQL_RES *mysql_res;
MYSQL_ROW row;
long MedCod;;
long MedCod;
/***** Remove media associated to comment *****/
if (DB_QuerySELECT (&mysql_res,"can not get media",

View File

@ -329,7 +329,7 @@ void TT_ShowClassTimeTable (void)
};
struct TT_Timetable Timetable;
bool PrintView = (Gbl.Action.Act == ActPrnCrsTT ||
Gbl.Action.Act == ActPrnMyTT);;
Gbl.Action.Act == ActPrnMyTT);
Grp_WhichGroups_t WhichGroups;
/***** Initializations *****/