diff --git a/export_form.php b/export_form.php index 3f2928d..51bdb7b 100644 --- a/export_form.php +++ b/export_form.php @@ -104,10 +104,11 @@ class mod_attendance_export_form extends moodleform { $ident = array(); $checkedfields = array(); - $ident[] =& $mform->createElement('checkbox', 'id', '', get_string('studentid', 'attendance')); - $checkedfields['ident[id]'] = true; - $adminsetfields = get_config('attendance', 'customexportfields'); + if (in_array('id', explode(',', $adminsetfields))) { + $ident[] =& $mform->createElement('checkbox', 'id', '', get_string('studentid', 'attendance')); + $checkedfields['ident[id]'] = true; + } $extrafields = get_extra_user_fields($modcontext); foreach ($extrafields as $field) { diff --git a/settings.php b/settings.php index 433448e..5b7b52c 100644 --- a/settings.php +++ b/settings.php @@ -106,7 +106,7 @@ if ($ADMIN->fulltree) { get_string('enablewarnings', 'attendance'), get_string('enablewarnings_desc', 'attendance'), 0)); - $fields = array(); + $fields = array('id' => get_string('studentid', 'attendance')); $customfields = profile_get_custom_fields(); foreach ($customfields as $field) { $fields[$field->shortname] = $field->name;