Version19.204.4

This commit is contained in:
acanas 2020-04-28 12:34:56 +02:00
parent 1e13bec455
commit 1bae89e3e7
6 changed files with 34 additions and 84 deletions

View File

@ -544,10 +544,11 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.204.3 (2020-04-28)"
#define Log_PLATFORM_VERSION "SWAD 19.204.4 (2020-04-28)"
#define CSS_FILE "swad19.193.1.css"
#define JS_FILE "swad19.193.1.js"
/*
Version 19.204.4: Apr 28, 2020 Fixed bug in creation of new exam. (300470 lines)
Version 19.204.3: Apr 28, 2020 List updated exam events after creation. (300521 lines)
Version 19.204.2: Apr 28, 2020 Changes in creation of exam events. (300503 lines)
Version 19.204.1: Apr 28, 2020 Fixed problem in listing of set questions when questions have been removed. (300480 lines)

View File

@ -1535,11 +1535,6 @@ void Exa_RequestCreatOrEditExam (void)
/***** Put form to create/edit an exam and show sets *****/
Exa_PutFormsOneExam (&Exams,&Exam,&Set,ItsANewExam);
/***** Show exams or questions *****/
if (ItsANewExam)
/* Show exams again */
Exa_ListAllExams (&Exams);
}
/*****************************************************************************/
@ -1983,8 +1978,6 @@ void Exa_RecFormExam (void)
/***** Get parameters *****/
Exa_GetParams (&Exams);
if (Exams.ExaCod <= 0)
Lay_WrongExamExit ();
Exam.ExaCod = Exams.ExaCod;
ItsANewExam = (Exam.ExaCod <= 0);
@ -2691,7 +2684,6 @@ static void ExaSet_ListExamSets (struct Exa_Exams *Exams,
{
extern const char *Hlp_ASSESSMENT_Exams_question_sets;
extern const char *Txt_Sets_of_questions;
extern const char *Txt_This_exam_has_no_sets_of_questions;
MYSQL_RES *mysql_res;
unsigned MaxSetInd;
unsigned NumSets;
@ -2724,8 +2716,6 @@ static void ExaSet_ListExamSets (struct Exa_Exams *Exams,
MaxSetInd,
NumSets,mysql_res,
ICanEditSets);
else // This exam has no sets
Ale_ShowAlert (Ale_INFO,Txt_This_exam_has_no_sets_of_questions);
/***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res);
@ -2808,6 +2798,10 @@ static void ExaSet_ListOneOrMoreSetsForEdition (struct Exa_Exams *Exams,
char *Anchor;
char StrSetInd[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
/***** Trivial check *****/
if (!NumSets)
return;
/***** Write the heading *****/
HTM_TABLE_BeginWideMarginPadding (2);
ExaSet_PutTableHeadingForSets ();
@ -3433,7 +3427,6 @@ void ExaSet_MoveUpSet (void)
void ExaSet_MoveDownSet (void)
{
extern const char *Txt_Movement_not_allowed;
extern const char *Txt_This_exam_has_no_sets_of_questions;
struct Exa_Exams Exams;
struct Exa_Exam Exam;
struct ExaSet_Set Set;
@ -3474,23 +3467,18 @@ void ExaSet_MoveDownSet (void)
MaxSetInd = ExaSet_GetMaxSetIndexInExam (Exam.ExaCod);
/***** Move down set *****/
if (MaxSetInd)
if (SetIndTop < MaxSetInd)
{
if (SetIndTop < MaxSetInd)
{
/* Indexes of sets to be exchanged */
SetIndBottom = ExaSet_GetNextSetIndexInExam (Exam.ExaCod,SetIndTop);
if (!SetIndBottom)
Lay_ShowErrorAndExit ("Wrong index of set.");
/* Indexes of sets to be exchanged */
SetIndBottom = ExaSet_GetNextSetIndexInExam (Exam.ExaCod,SetIndTop);
if (!SetIndBottom)
Lay_ShowErrorAndExit ("Wrong index of set.");
/* Exchange sets */
ExaSet_ExchangeSets (Exam.ExaCod,SetIndTop,SetIndBottom);
}
else
Ale_ShowAlert (Ale_WARNING,Txt_Movement_not_allowed);
/* Exchange sets */
ExaSet_ExchangeSets (Exam.ExaCod,SetIndTop,SetIndBottom);
}
else
Ale_ShowAlert (Ale_WARNING,Txt_This_exam_has_no_sets_of_questions);
Ale_ShowAlert (Ale_WARNING,Txt_Movement_not_allowed);
/***** Show current exam and its sets *****/
Exa_PutFormsOneExam (&Exams,&Exam,&Set,

View File

@ -490,6 +490,10 @@ static void ExaEvt_ListOneOrMoreEvents (struct Exa_Exams *Exams,
struct ExaEvt_Event Event;
bool ICanEditEvents = ExaEvt_CheckIfICanEditEvents ();
/***** Trivial check *****/
if (!NumEvents)
return;
/***** Reset event *****/
ExaEvt_ResetEvent (&Event);

View File

@ -1929,7 +1929,6 @@ static void Gam_ListGameQuestions (struct Gam_Games *Games,struct Gam_Game *Game
{
extern const char *Hlp_ASSESSMENT_Games_questions;
extern const char *Txt_Questions;
extern const char *Txt_This_game_has_no_questions;
MYSQL_RES *mysql_res;
unsigned NumQsts;
bool ICanEditQuestions = Gam_CheckIfEditable (Game);
@ -1960,8 +1959,6 @@ static void Gam_ListGameQuestions (struct Gam_Games *Games,struct Gam_Game *Game
Gam_ListOneOrMoreQuestionsForEdition (Games,
Game->GamCod,NumQsts,mysql_res,
ICanEditQuestions);
else // This game has no questions
Ale_ShowAlert (Ale_INFO,Txt_This_game_has_no_questions);
/***** Put button to add a new question in this game *****/
if (ICanEditQuestions) // I can edit questions
@ -2000,6 +1997,10 @@ static void Gam_ListOneOrMoreQuestionsForEdition (struct Gam_Games *Games,
bool QuestionExists;
char *Anchor = NULL;
/***** Trivial check *****/
if (!NumQsts)
return;
/***** Get maximum question index *****/
MaxQstInd = Gam_GetMaxQuestionIndexInGame (GamCod); // 0 is no questions in game
@ -2427,7 +2428,6 @@ void Gam_MoveUpQst (void)
void Gam_MoveDownQst (void)
{
extern const char *Txt_Movement_not_allowed;
extern const char *Txt_This_game_has_no_questions;
struct Gam_Games Games;
struct Gam_Game Game;
unsigned QstIndTop;
@ -2456,23 +2456,18 @@ void Gam_MoveDownQst (void)
MaxQstInd = Gam_GetMaxQuestionIndexInGame (Game.GamCod); // 0 is no questions in game
/***** Move down question *****/
if (MaxQstInd)
if (QstIndTop < MaxQstInd)
{
if (QstIndTop < MaxQstInd)
{
/* Indexes of questions to be exchanged */
QstIndBottom = Gam_GetNextQuestionIndexInGame (Game.GamCod,QstIndTop);
if (!QstIndBottom)
Lay_ShowErrorAndExit ("Wrong index of question.");
/* Indexes of questions to be exchanged */
QstIndBottom = Gam_GetNextQuestionIndexInGame (Game.GamCod,QstIndTop);
if (!QstIndBottom)
Lay_ShowErrorAndExit ("Wrong index of question.");
/* Exchange questions */
Gam_ExchangeQuestions (Game.GamCod,QstIndTop,QstIndBottom);
}
else
Ale_ShowAlert (Ale_WARNING,Txt_Movement_not_allowed);
/* Exchange questions */
Gam_ExchangeQuestions (Game.GamCod,QstIndTop,QstIndBottom);
}
else
Ale_ShowAlert (Ale_WARNING,Txt_This_game_has_no_questions);
Ale_ShowAlert (Ale_WARNING,Txt_Movement_not_allowed);
/***** Show current game *****/
Gam_ShowOnlyOneGame (&Games,&Game,

View File

@ -478,6 +478,10 @@ static void Mch_ListOneOrMoreMatches (struct Gam_Games *Games,
struct Mch_Match Match;
bool ICanEditMatches = Mch_CheckIfICanEditMatches ();
/***** Trivial check *****/
if (!NumMatches)
return;
/***** Reset match *****/
Mch_ResetMatch (&Match);

View File

@ -51586,27 +51586,6 @@ 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 set 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.";
@ -51628,27 +51607,6 @@ const char *Txt_This_exam_has_no_questions =
"Este exame n&atilde;o tem perguntas.";
#endif
const char *Txt_This_game_has_no_questions =
#if L==1 // ca
"Aquest joc no t&eacute; preguntes.";
#elif L==2 // de
"Dieses Spiel hat keine Fragen.";
#elif L==3 // en
"This game has no questions.";
#elif L==4 // es
"Este juego no tiene preguntas.";
#elif L==5 // fr
"Ce jeu n'a pas de questions.";
#elif L==6 // gn
"Este juego no tiene preguntas."; // Okoteve traducción
#elif L==7 // it
"Questo gioco non ha domande.";
#elif L==8 // pl
"Ta gra nie ma pytania.";
#elif L==9 // pt
"Este jogo n&atilde;o tem perguntas.";
#endif
const char *Txt_This_link_will_remain_active_as_long_as_your_user_s_account_exists =
#if L==1 // ca
"Aquest enlla&ccedil; romandr&agrave; actiu mentre existeixi el seu compte de l'usuari.";