Merge branch 'MDL-37473b' of git://github.com/srynot4sale/moodle

This commit is contained in:
Dan Poltawski
2013-01-25 12:35:40 +08:00
4 changed files with 12 additions and 4 deletions
+8 -1
View File
@@ -45,6 +45,11 @@ if ($courseid) {
require_login($course);
$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');
}
// Check if we are marking a user complete via the completion report
$user = optional_param('user', 0, PARAM_INT);
@@ -136,7 +141,9 @@ if (isguestuser() or !confirm_sesskey()) {
// Now change state
$completion = new completion_info($course);
if (!$completion->is_enabled()) {
die;
throw new moodle_exception('completionnotenabled', 'completion');
} elseif (!$completion->is_tracked_user($USER->id)) {
throw new moodle_exception('nottracked', 'completion');
}
// Check completion state is manual