Browse Source

Put magic number into constant.

MOODLE_33_STABLE
Dan Marsden 7 years ago
parent
commit
541f46963f
  1. 2
      classes/add_warning_form.php
  2. 3
      locallib.php

2
classes/add_warning_form.php

@ -52,7 +52,7 @@ class mod_attendance_add_warning_form extends moodleform {
$mform->setDefault('warningpercent', $config->warningpercent); $mform->setDefault('warningpercent', $config->warningpercent);
$options = array(); $options = array();
for ($i = 1; $i <= 50; $i++) { for ($i = 1; $i <= ATTENDANCE_MAXWARNAFTER; $i++) {
$options[$i] = "$i"; $options[$i] = "$i";
} }
$mform->addElement('select', 'warnafter', get_string('warnafter', 'mod_attendance'), $options); $mform->addElement('select', 'warnafter', get_string('warnafter', 'mod_attendance'), $options);

3
locallib.php

@ -43,6 +43,9 @@ define('ATTENDANCE_AUTOMARK_DISABLED', 0);
define('ATTENDANCE_AUTOMARK_ALL', 1); define('ATTENDANCE_AUTOMARK_ALL', 1);
define('ATTENDANCE_AUTOMARK_CLOSE', 2); define('ATTENDANCE_AUTOMARK_CLOSE', 2);
// Max number of sessions available in the warnings set form to trigger warnings.
define('ATTENDANCE_MAXWARNAFTER', 100);
/** /**
* Get statuses, * Get statuses,
* *

Loading…
Cancel
Save