Skip to content

Commit

Permalink
Fix #748 - only show auto completion on activity when completion enab…
Browse files Browse the repository at this point in the history
…led.
  • Loading branch information
danmarsden committed Apr 23, 2024
1 parent ea08838 commit d374b68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,7 @@ function attendance_session_get_highest_status(mod_attendance_structure $att, $a
* @return array
*/
function attendance_get_automarkoptions() {
global $COURSE;

$options = array();

Expand All @@ -1254,7 +1255,9 @@ function attendance_get_automarkoptions() {
$options[ATTENDANCE_AUTOMARK_ALL] = get_string('automarkall', 'attendance');
}
$options[ATTENDANCE_AUTOMARK_CLOSE] = get_string('automarkclose', 'attendance');
$options[ATTENDANCE_AUTOMARK_ACTIVITYCOMPLETION] = get_string('onactivitycompletion', 'attendance');
if ($COURSE == SITEID || $COURSE->enablecompletion == COMPLETION_ENABLED) {
$options[ATTENDANCE_AUTOMARK_ACTIVITYCOMPLETION] = get_string('onactivitycompletion', 'attendance');
}

return $options;
}
Expand Down

0 comments on commit d374b68

Please sign in to comment.