$mform->addElement('checkbox', 'studentscanmark', '', get_string('studentscanmark', 'attendance'));
$mform->addHelpButton('studentscanmark', 'studentscanmark', 'attendance');
- $options = array(
- ATTENDANCE_AUTOMARK_DISABLED => get_string('noautomark', 'attendance'),
- ATTENDANCE_AUTOMARK_ALL => get_string('automarkall', 'attendance'),
- ATTENDANCE_AUTOMARK_CLOSE => get_string('automarkclose', 'attendance'));
+ $options = attendance_get_automarkoptions();
$mform->addElement('select', 'automark', get_string('automark', 'attendance'), $options);
$mform->setType('automark', PARAM_INT);
return false;
}
return $highestavailablestatus->id;
+}
+
+/**
+ * Get available automark options.
+ *
+ * @return array
+ */
+function attendance_get_automarkoptions() {
+ $options = array();
+ $options[ATTENDANCE_AUTOMARK_DISABLED] = get_string('noautomark', 'attendance');
+ if (strpos(get_config('tool_log', 'enabled_stores'), 'logstore_standard') !== false) {
+ $options[ATTENDANCE_AUTOMARK_ALL] = get_string('automarkall', 'attendance');
+ }
+ $options[ATTENDANCE_AUTOMARK_CLOSE] = get_string('automarkclose', 'attendance');
+ return $options;
}
\ No newline at end of file
$settings->add(new admin_setting_configcheckbox('attendance/studentscanmark_default',
get_string('studentscanmark', 'attendance'), '', 0));
- $options = array(
- ATTENDANCE_AUTOMARK_DISABLED => get_string('noautomark', 'attendance'),
- ATTENDANCE_AUTOMARK_ALL => get_string('automarkall', 'attendance'),
- ATTENDANCE_AUTOMARK_CLOSE => get_string('automarkclose', 'attendance'));
+ $options = attendance_get_automarkoptions();
$settings->add(new admin_setting_configselect('attendance/automark_default',
get_string('automark', 'attendance'), '', 0, $options));
$mform->addElement('checkbox', 'studentscanmark', '', get_string('studentscanmark', 'attendance'));
$mform->addHelpButton('studentscanmark', 'studentscanmark', 'attendance');
- $options2 = array(
- ATTENDANCE_AUTOMARK_DISABLED => get_string('noautomark', 'attendance'),
- ATTENDANCE_AUTOMARK_ALL => get_string('automarkall', 'attendance'),
- ATTENDANCE_AUTOMARK_CLOSE => get_string('automarkclose', 'attendance'));
+ $options2 = attendance_get_automarkoptions();
$mform->addElement('select', 'automark', get_string('automark', 'attendance'), $options2);
$mform->setType('automark', PARAM_INT);