Skip to content

Commit

Permalink
Bugfix: GH-7 top and floor view
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderJacob committed Oct 7, 2024
1 parent c9596c2 commit 02dc0a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 19 additions & 2 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function definition() {
$options
);

$mform->addRule('learningpathid', get_string('mform_options_required'), 'required', null, 'client');
$mform->addRule('learningpathid', get_string('mform_options_required', 'mod_adele'), 'required', null, 'client');

$views = [
1 => get_string('mform_options_view_top_level', 'mod_adele'),
Expand All @@ -133,12 +133,29 @@ public function definition() {
['multiple' => true]
);

$mform->addRule('participantslist', get_string('mform_options_required'), 'required', null, 'client');
$mform->addRule('participantslist', get_string('mform_options_required', 'mod_adele'), 'required', null, 'client');

// Add standard elements.
$this->standard_coursemodule_elements();

// Add standard buttons.
$this->add_action_buttons();
}

/**
* Server-side validation
*/
public function validation($data, $files) {
$errors = parent::validation($data, $files);

if (empty($data['learningpathid'])) {
$errors['learningpathid'] = get_string('mform_options_required', 'mod_adele');
}

if (empty($data['participantslist'])) {
$errors['participantslist'] = get_string('mform_options_required', 'mod_adele');
}

return $errors;
}
}
2 changes: 1 addition & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
if (
isloggedin() &&
!isguestuser() &&
$learningpath->view == 1 &&
$learningpath->view >= 1 &&
$learningpath->learningpathid
) {
$alisecompatible = local_adele::get_internalquuiz_id($learningpath->learningpathid, $PAGE->course->id);
Expand Down

0 comments on commit 02dc0a7

Please sign in to comment.