From 48902a0d33e401b2d41cd00b2e9e3250ac2549c8 Mon Sep 17 00:00:00 2001 From: acanas Date: Sun, 27 Sep 2020 17:45:23 +0200 Subject: [PATCH] Version20.2.2 --- swad_changelog.h | 3 ++- swad_exam_print.c | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 49bc23100..0b73dc4cf 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -555,7 +555,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 20.2.1 (2020-09-27)" +#define Log_PLATFORM_VERSION "SWAD 20.2.2 (2020-09-27)" #define CSS_FILE "swad20.1.1.css" #define JS_FILE "swad19.254.js" /* @@ -573,6 +573,7 @@ TODO: Que al generar un examen s TODO: Create module swad_test_result "sudo apt install webp" en Ubuntu, y "yum install libwebp libwebp-tools" en CentOS, para decodificar imágenes Web/ug reportado por Javier Fernández Baldomero. + Version 20.2.2: Sep 27, 2020 Fixed bug in exam. (304448 lines) Version 20.2.1: Sep 27, 2020 Fixed bug in exam, reported by Nuria Torres Rosell. (304442 lines) Version 20.2: Sep 26, 2020 Removed unused action. Contextual menu in box used to write a new message. diff --git a/swad_exam_print.c b/swad_exam_print.c index 1225995d2..6e245e400 100644 --- a/swad_exam_print.c +++ b/swad_exam_print.c @@ -199,8 +199,15 @@ void ExaPrn_ShowExamPrint (void) Print.SesCod = Session.SesCod; Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; + /***** Get exam print data from database *****/ + ExaPrn_GetDataOfPrintBySesCodAndUsrCod (&Print); + if (Print.PrnCod <= 0) // Print does not exists ==> create it { + /***** Set again basic data of exam print *****/ + Print.SesCod = Session.SesCod; + Print.UsrCod = Gbl.Usrs.Me.UsrDat.UsrCod; + /***** Get questions from database *****/ ExaPrn_GetQuestionsForNewPrintFromDB (&Print,Exam.ExaCod); @@ -363,13 +370,13 @@ static void ExaPrn_GetQuestionsForNewPrintFromDB (struct ExaPrn_Print *Print,lon /***** Get data of set of questions from database *****/ NumSets = (unsigned) DB_QuerySELECT (&mysql_res,"can not get sets of questions", - "SELECT SetCod," // row[0] - "NumQstsToPrint," // row[1] - "Title" // row[2] - " FROM exa_sets" - " WHERE ExaCod=%ld" - " ORDER BY SetInd", - ExaCod); + "SELECT SetCod," // row[0] + "NumQstsToPrint," // row[1] + "Title" // row[2] + " FROM exa_sets" + " WHERE ExaCod=%ld" + " ORDER BY SetInd", + ExaCod); /***** Get questions from all sets *****/ Print->NumQsts.All = 0;