Skip to content

Commit

Permalink
Merge pull request #59 from integral-learning/feature/#35496-prohibit…
Browse files Browse the repository at this point in the history
…-setting-a-deadline-for-worksheets-without-deadline

Feature/#35496 Prohibit setting a deadline for worksheets without deadline
  • Loading branch information
fsacha authored Oct 25, 2023
2 parents 3c045e5 + 62e92e9 commit c08d25c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions forms/mumie_task_validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ public static function get_errors(array $data, \stdClass $current) : array {
&& !self::has_duedate($data)) {
$errors['duedate'] = get_string('mumie_form_deadline_required_for_trigger_after_deadline', 'mod_mumie');
}

if (self::is_worksheet($data)
&& !self::is_correction_trigger_after_deadline($data['worksheet'])
&& self::has_duedate($data)) {
$errors['duedate'] = get_string('mumie_form_deadline_prohibited_for_worksheet_without_trigger_after_deadline', 'mod_mumie');
}

return $errors;
}

Expand Down
1 change: 1 addition & 0 deletions lang/de/mumie.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
$string['mumie_form_no_course_on_server'] = 'MUMIE-Server <b>{$a}</b> konnte nicht erreicht werden! Dieser Server wurde daher vorrübergehend aus der Auswahl entfernt.';
$string['mumie_multi_problem_selector'] = 'Alternativ können Sie auch mehrere MUMIE Tasks gleichzeitig mit der Mehrfach-Aufgabenauswahl erstellen. Ziehen Sie dazu einfach die gewünschten Aufgaben in ihren Kurs.<br><br>Für eine Kurzanleitung und weitere Informationen besuchen Sie unser <a target="_blank" href="{$a}">Wiki</a>';
$string['mumie_form_deadline_required_for_trigger_after_deadline'] = "Das ausgewählte Worksheet setzt eine Deadline voraus";
$string['mumie_form_deadline_prohibited_for_worksheet_without_trigger_after_deadline'] = "Das ausgewählte Worksheet kann keine Deadline haben.<br><br>Wenn Sie eine Deadline setzen möchten, wählen Sie ein Worksheet mit entsprechender Konfiguration aus.";

// Used in duedate form.
$string['mumie_duedate_form'] = 'Abgabefrist verlängern';
Expand Down
2 changes: 2 additions & 0 deletions lang/en/mumie.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
$string['mumie_url_prefix_help'] = 'Specify the MUMIE URL prefix <br><br> e.g. <b>https://www.ombplus.de/ombplus</b> <br><br> There can only be a single configuration for any URL prefix.';
$string['mumie_form_cant_change_isgraded'] = 'You cannot switch from graded to ungraded problems. Please create a new MUMIE Task instead.';
$string['mumie_form_deadline_required_for_trigger_after_deadline'] = "The selected worksheet requires a deadline";
$string['mumie_form_deadline_prohibited_for_worksheet_without_trigger_after_deadline'] = "The selected worksheet cannot have a deadline.<br><br>If you want to set a deadline, please select a worksheet with an appropriate configuration.";


// Used in duedate form.
$string['mumie_duedate_form'] = 'Grant a due date extension';
Expand Down

0 comments on commit c08d25c

Please sign in to comment.