From d91e3c8dc28e13d16e8b3ae6d8e1b27e08a1de98 Mon Sep 17 00:00:00 2001 From: acanas Date: Wed, 20 May 2020 02:59:49 +0200 Subject: [PATCH] Version19.239.3 --- swad_changelog.h | 4 +++- swad_enrolment.c | 2 +- swad_exam_print.c | 37 +++++++++++++++++++++++++------------ 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index ba8f6a089..d7695393c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -557,10 +557,12 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.239.2 (2020-05-20)" +#define Log_PLATFORM_VERSION "SWAD 19.239.3 (2020-05-20)" #define CSS_FILE "swad19.238.2.css" #define JS_FILE "swad19.239.js" /* + Version 19.239.3: May 20, 2020 Fixed bugs removing exam prints in a course. + Don't remove user's production in a course when removing the user individually. (301316 lines) Version 19.239.2: May 20, 2020 Fixed bug removing media. (301301 lines) Version 19.239.1: May 19, 2020 Changes in timeout message. (301300 lines) Version 19.239: May 19, 2020 Fixed issue due to network timeout while answering exams. Reported by Nuria Torres Rosell. (301316 lines) diff --git a/swad_enrolment.c b/swad_enrolment.c index b6bc55d40..c95dad69c 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -3450,7 +3450,7 @@ void Enr_RemUsrFromCrs1 (void) { if (Enr_CheckIfICanRemUsrFromCrs ()) Enr_EffectivelyRemUsrFromCrs (&Gbl.Usrs.Other.UsrDat,&Gbl.Hierarchy.Crs, - Enr_REMOVE_USR_PRODUCTION, + Enr_DO_NOT_REMOVE_USR_PRODUCTION, Cns_VERBOSE); else Ale_CreateAlertUserNotFoundOrYouDoNotHavePermission (); diff --git a/swad_exam_print.c b/swad_exam_print.c index 5b414b4fd..a1679c247 100644 --- a/swad_exam_print.c +++ b/swad_exam_print.c @@ -1469,15 +1469,22 @@ void ExaPrn_RemovePrintsMadeByUsrInCrs (long UsrCod,long CrsCod) /***** Remove questions of exams prints made by the given user in the given course *****/ DB_QueryDELETE ("can not remove exams prints made by a user in a course", "DELETE FROM exa_print_questions" - " USING exa_prints,exa_print_questions" - " WHERE exa_prints.CrsCod=%ld AND exa_prints.UsrCod=%ld" - " AND exa_prints.ExaCod=exa_print_questions.ExaCod", + " USING exa_exams,exa_sessions,exa_prints,exa_print_questions" + " WHERE exa_exams.CrsCod=%ld" + " AND exa_exams.ExaCod=exa_sessions.ExaCod" + " AND exa_sessions.SesCod=exa_prints.SesCod" + " AND exa_prints.UsrCod=%ld" + " AND exa_prints.PrnCod=exa_print_questions.PrnCod", CrsCod,UsrCod); /***** Remove exams prints made by the given user in the given course *****/ DB_QueryDELETE ("can not remove exams prints made by a user in a course", "DELETE FROM exa_prints" - " WHERE CrsCod=%ld AND UsrCod=%ld", + " USING exa_exams,exa_sessions,exa_prints" + " WHERE exa_exams.CrsCod=%ld" + " AND exa_exams.ExaCod=exa_sessions.ExaCod" + " AND exa_sessions.SesCod=exa_prints.SesCod" + " AND exa_prints.UsrCod=%ld", CrsCod,UsrCod); } @@ -1487,16 +1494,22 @@ void ExaPrn_RemovePrintsMadeByUsrInCrs (long UsrCod,long CrsCod) void ExaPrn_RemoveCrsPrints (long CrsCod) { - /***** Remove questions of exams prints made in the course *****/ - DB_QueryDELETE ("can not remove exams prints made in a course", + /***** Remove questions of exams prints made by the given user in the given course *****/ + DB_QueryDELETE ("can not remove exams prints in a course", "DELETE FROM exa_print_questions" - " USING exa_prints,exa_print_questions" - " WHERE exa_prints.CrsCod=%ld" - " AND exa_prints.ExaCod=exa_print_questions.ExaCod", + " USING exa_exams,exa_sessions,exa_prints,exa_print_questions" + " WHERE exa_exams.CrsCod=%ld" + " AND exa_exams.ExaCod=exa_sessions.ExaCod" + " AND exa_sessions.SesCod=exa_prints.SesCod" + " AND exa_prints.PrnCod=exa_print_questions.PrnCod", CrsCod); - /***** Remove exam prints made in the course *****/ - DB_QueryDELETE ("can not remove exams prints made in a course", - "DELETE FROM exa_prints WHERE CrsCod=%ld", + /***** Remove exams prints made by the given user in the given course *****/ + DB_QueryDELETE ("can not remove exams prints in a course", + "DELETE FROM exa_prints" + " USING exa_exams,exa_sessions,exa_prints" + " WHERE exa_exams.CrsCod=%ld" + " AND exa_exams.ExaCod=exa_sessions.ExaCod" + " AND exa_sessions.SesCod=exa_prints.SesCod", CrsCod); }