From 8bfd6122b07b4ca2abbbcf13a4498c856d24ab64 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 22 Jul 2020 17:15:10 +0200 Subject: [exams] More sanity checks regarding date/time and locations Implausible start/end time, or mismatch between defined exam interval and interval of selected lecture will now be reported. Also, if the list of selected locations contains a location that is not also assiged to the selected lecture, a warning will be displayed. This only triggers if the lecture is restricted to certain locations (exclusive mode, aka "islocationprivate" column. --- modules-available/exams/lang/de/template-tags.json | 12 +- modules-available/exams/lang/en/template-tags.json | 12 +- modules-available/exams/page.inc.php | 2 +- .../exams/templates/page-add-edit-exam.html | 209 +++++++++++++++------ 4 files changed, 170 insertions(+), 65 deletions(-) diff --git a/modules-available/exams/lang/de/template-tags.json b/modules-available/exams/lang/de/template-tags.json index 0fbaf0a1..d52a3199 100644 --- a/modules-available/exams/lang/de/template-tags.json +++ b/modules-available/exams/lang/de/template-tags.json @@ -10,6 +10,7 @@ "lang_begin": "Beginn", "lang_begin_date": "Beginn Datum", "lang_begin_time": "Uhrzeit", + "lang_checkLocationSelectionHint": "Stellen Sie sicher, dass die gew\u00fcnschte(n) Pr\u00fcfungsveranstaltung(en) in ihrer Raumbeschr\u00e4nkung mit den hier ausgew\u00e4hlten R\u00e4umen \u00fcbereinstimmen.", "lang_comfirmGlobalExam": "Wollen Sie wirklich eine globale Pr\u00fcfung definieren? Im gew\u00e4hlten Zeitraum werden s\u00e4mtliche R\u00e4ume in den Pr\u00fcfungsmodus geschaltet.", "lang_dateTime": "Datum\/Uhrzeit", "lang_deleteConfirmation": "Wirklich l\u00f6schen?", @@ -18,7 +19,12 @@ "lang_end": "Ende", "lang_end_date": "Ende Datum", "lang_end_time": "Uhrzeit", + "lang_examEndAfterLectureEnd": "Der gew\u00e4hlte Klausurzeitraum endet sp\u00e4ter, als die gew\u00e4hlte Veranstaltung endet.", + "lang_examEndBeforeLectureEnd": "Der gew\u00e4hlte Klausurzeitraum endet fr\u00fcher, als die gew\u00e4hlte Veranstaltung endet.", "lang_examModeDescription": "Hier k\u00f6nnen Sie bwLehrpool-R\u00e4ume zeitgesteuert in den Pr\u00fcfungsmodus versetzen. Im Pr\u00fcfungsmodus ist das Client-System st\u00e4rker abgeriegelt, sodass es sich zum Schreiben von E-Pr\u00fcfungen eignet. Nach dem Ein- bzw. Ausschalten des Pr\u00fcfungsmodus ist es notwendig, die Rechner in den betroffenen R\u00e4umen neuzustarten.", + "lang_examStartAfterLectureEnd": "Der gew\u00e4hlte Klausurzeitraum beginnt, nachdem die gew\u00e4hlte Veranstaltung endet, oder kurz vor derem Ende.", + "lang_examStartAfterLectureStart": "Der gew\u00e4hlte Klausurzeitraum beginnt sp\u00e4ter, als die gew\u00e4hlte Veranstaltung startet.", + "lang_examStartBeforeLectureStart": "Der gew\u00e4hlte Klausurzeitraum beginnt, bevor die gew\u00e4hlte Veranstaltung startet. Ein Autostart der Veranstaltung wird fehlschlagen.", "lang_global": "Global", "lang_headingAddExam": "Zeitraum hinzuf\u00fcgen", "lang_headingAllExamLectures": "Ausstehende Pr\u00fcfungsveranstaltungen (30 Tage)", @@ -27,12 +33,16 @@ "lang_headingMain": "bwLehrpool Pr\u00fcfungsmodus", "lang_id": "ID", "lang_lectureName": "Veranstaltungsname", - "lang_lectureOutOfRange": "Achtung: Der oben angegebene Zeitraum ist k\u00fcrzer als die Dauer der Veranstaltung", + "lang_lectureNotForLocation": "Diese Veranstaltung findet nicht im oben ausgew\u00e4hlten Raum statt", + "lang_lectureTimespan": "Dauer der Veranstaltung", "lang_location": "Raum\/Ort", "lang_locationInfo": "W\u00e4hlen Sie hier die R\u00e4ume und Orte aus, die w\u00e4hrend des unten ausgew\u00e4hlten Zeitraums in den Pr\u00fcfungsmodus versetzt werden. Wenn sie hier keine Auswahl treffen, werden alle R\u00e4ume in den Pr\u00fcfungsmodus versetzt.", "lang_locations": "R\u00e4ume\/Orte", "lang_moreThanOneDay": "Mehr als ein Tag", "lang_noDescription": "Keine Beschreibung", "lang_none": "(Keine)", + "lang_sanityCheck": "Plausibilit\u00e4tspr\u00fcfung", + "lang_startAfterEnd": "Ende liegt vor Start", + "lang_startOrEndInvalid": "Start- oder Endzeitpunkt ung\u00fcltig", "lang_timeFrame": "Zeitraum" } \ No newline at end of file diff --git a/modules-available/exams/lang/en/template-tags.json b/modules-available/exams/lang/en/template-tags.json index 52173740..3359a28a 100644 --- a/modules-available/exams/lang/en/template-tags.json +++ b/modules-available/exams/lang/en/template-tags.json @@ -10,6 +10,7 @@ "lang_begin": "Begin", "lang_begin_date": "Begin Date", "lang_begin_time": "Time", + "lang_checkLocationSelectionHint": "Make sure that the according lecture(s) will have their location restrictions set accordingly.", "lang_comfirmGlobalExam": "Do you really want to create a global exam? Every single room will be set to lecture mode during the selected time period.", "lang_dateTime": "Date\/Time", "lang_deleteConfirmation": "Are you sure?", @@ -18,7 +19,12 @@ "lang_end": "End", "lang_end_date": "End Date", "lang_end_time": "Time", + "lang_examEndAfterLectureEnd": "Specified exam interval ends after selected lecture ends.", + "lang_examEndBeforeLectureEnd": "Specified exam interval ends before selected lecture ends.", "lang_examModeDescription": "Here you can define time spans during which selected rooms will be set to exam mode. In exam mode, the client computers are more locked down than usual so it is suitable for writing electronic exams.", + "lang_examStartAfterLectureEnd": "Specified exam interval starts after selected lecture ends (or shortly before it ends).", + "lang_examStartAfterLectureStart": "Specified exam interval starts after selected lecture starts.", + "lang_examStartBeforeLectureStart": "Specified exam interval starts before selected lecture starts. (Auto-)starting the lecture before it's valid will fail.", "lang_global": "Global", "lang_headingAddExam": "Add Exam Period", "lang_headingAllExamLectures": "Upcoming Lectures Marked As Exams (30 Days)", @@ -27,12 +33,16 @@ "lang_headingMain": "bwLehrpool Exam Mode", "lang_id": "ID", "lang_lectureName": "Lecture name", - "lang_lectureOutOfRange": "Hint: The exam period given above is shorter than the duration of the given lecture", + "lang_lectureNotForLocation": "This lecture is not visible at the location selected above", + "lang_lectureTimespan": "Lecture time span", "lang_location": "Room\/Location", "lang_locationInfo": "Select the rooms and locations you want to enable the exam mode in. Selecting nothing at all means that all clients will boot into exam mode during the given time period.", "lang_locations": "Rooms\/Locations", "lang_moreThanOneDay": "More than one day", "lang_noDescription": "No description", "lang_none": "(None)", + "lang_sanityCheck": "Sanity check", + "lang_startAfterEnd": "Start lies after end", + "lang_startOrEndInvalid": "Start oder end is invalid", "lang_timeFrame": "Time frame" } \ No newline at end of file diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php index aec13c32..b19c156e 100644 --- a/modules-available/exams/page.inc.php +++ b/modules-available/exams/page.inc.php @@ -79,7 +79,7 @@ class Page_Exams extends Page protected function readLectures() { $tmp = Database::simpleQuery( - "SELECT lectureid, Group_Concat(locationid) as lids, displayname, starttime, endtime, isenabled, firstname, lastname, email " . + "SELECT lectureid, Group_Concat(locationid) as lids, islocationprivate, displayname, starttime, endtime, isenabled, firstname, lastname, email " . "FROM sat.lecture " . "INNER JOIN sat.user ON (user.userid = lecture.ownerid) " . "NATURAL LEFT JOIN sat.lecture_x_location " . diff --git a/modules-available/exams/templates/page-add-edit-exam.html b/modules-available/exams/templates/page-add-edit-exam.html index a45cbac2..eb77e751 100644 --- a/modules-available/exams/templates/page-add-edit-exam.html +++ b/modules-available/exams/templates/page-add-edit-exam.html @@ -10,6 +10,8 @@
+ +
@@ -23,6 +25,7 @@ {{/locations}}
+ {{lang_checkLocationSelectionHint}}
@@ -77,10 +80,10 @@ -
-
- {{lang_duration}}: - -
+
+ {{lang_duration}}: - + +
@@ -88,29 +91,43 @@
-
-
-

{{lang_autoStartInfo}}

-
- - - - -
+
+

{{lang_autoStartInfo}}

+
+ + + +
-
-
-

{{lang_autoLoginInfo}}

+ {{lang_sanityCheck}} +
+
+
{{lang_examStartBeforeLectureStart}}
+
{{lang_examStartAfterLectureStart}}
+
{{lang_examStartAfterLectureEnd}}
+
{{lang_examEndBeforeLectureEnd}}
+
{{lang_examEndAfterLectureEnd}}
+
+ {{lang_lectureTimespan}}: +
-
- - +
+ {{lang_lectureNotForLocation}}: +
+
+
+
+

{{lang_autoLoginInfo}}

+
@@ -126,7 +143,7 @@
- +