Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-38101-m23' of git://github.com/sammarshallou/moodle…

… into MOODLE_23_STABLE
  • Loading branch information...
commit 180e1b2fe92d7f22015d27d30e59bf5fe1d3e3b1 2 parents d47f3d4 + 1716b4a
@samhemelryk samhemelryk authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 course/togglecompletion.php
View
9 course/togglecompletion.php
@@ -138,14 +138,17 @@
print_error('error');
}
-// Now change state
+// Set up completion object and check it is enabled.
$completion = new completion_info($course);
if (!$completion->is_enabled()) {
throw new moodle_exception('completionnotenabled', 'completion');
-} elseif (!$completion->is_tracked_user($USER->id)) {
- throw new moodle_exception('nottracked', 'completion');
}
+// NOTE: All users are allowed to toggle their completion state, including
+// users for whom completion information is not directly tracked. (I.e. even
+// if you are a teacher, or admin who is not enrolled, you can still toggle
+// your own completion state. You just don't appear on the reports.)
+
// Check completion state is manual
if($cm->completion != COMPLETION_TRACKING_MANUAL) {
error_or_ajax('cannotmanualctrack', $fromajax);
Please sign in to comment.
Something went wrong with that request. Please try again.