From 18402d502798946beade961453ce42f3e14bf4ac Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 17 Jan 2018 15:52:33 +1300 Subject: [PATCH] set hideif rules correctly on full group elements. --- add_form.php | 11 ++++------- update_form.php | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/add_form.php b/add_form.php index cc09aab..a1a6e97 100644 --- a/add_form.php +++ b/add_form.php @@ -204,13 +204,11 @@ class mod_attendance_add_form extends moodleform { $mform->addGroup($mgroup, 'passwordgrp', get_string('passwordgrp', 'attendance'), array(' '), false); $mform->setType('studentpassword', PARAM_TEXT); - $mform->hideif('studentpassword', 'studentscanmark', 'notchecked'); - $mform->addHelpButton('passwordgrp', 'passwordgrp', 'attendance'); - $mform->hideif('randompassword', 'studentscanmark', 'notchecked'); + + $mform->hideif('passwordgrp', 'studentscanmark', 'notchecked'); $mform->hideif('studentpassword', 'randompassword', 'checked'); - $mform->hideif('studentpassword', 'automark', 'eq', ATTENDANCE_AUTOMARK_ALL); - $mform->hideif('randompassword', 'automark', 'eq', ATTENDANCE_AUTOMARK_ALL); + $mform->hideif('passwordgrp', 'automark', 'eq', ATTENDANCE_AUTOMARK_ALL); $mform->addElement('checkbox', 'autoassignstatus', '', get_string('autoassignstatus', 'attendance')); $mform->addHelpButton('autoassignstatus', 'autoassignstatus', 'attendance'); @@ -244,8 +242,7 @@ class mod_attendance_add_form extends moodleform { $mform->setAdvanced('subnetgrp'); $mform->addHelpButton('subnetgrp', 'requiresubnet', 'attendance'); - $mform->hideif('usedefaultsubnet', 'studentscanmark', 'notchecked'); - $mform->hideif('subnet', 'studentscanmark', 'notchecked'); + $mform->hideif('subnetgrp', 'studentscanmark', 'notchecked'); $mform->hideif('subnet', 'usedefaultsubnet', 'checked'); } else { $mform->addElement('hidden', 'studentscanmark', '0'); diff --git a/update_form.php b/update_form.php index 5370590..bf5e58c 100644 --- a/update_form.php +++ b/update_form.php @@ -143,8 +143,7 @@ class mod_attendance_update_form extends moodleform { $mform->setAdvanced('subnetgrp'); $mform->addHelpButton('subnetgrp', 'requiresubnet', 'attendance'); - $mform->hideif('usedefaultsubnet', 'studentscanmark', 'notchecked'); - $mform->hideif('subnet', 'studentscanmark', 'notchecked'); + $mform->hideif('subnetgrp', 'studentscanmark', 'notchecked'); $mform->hideif('subnet', 'usedefaultsubnet', 'checked'); $mform->addElement('hidden', 'automarkcompleted', '0');