Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…nto MOODLE_24_STABLE
  • Loading branch information...
commit 87eb1d645ff266fd6687a3086e832b4c205a9676 2 parents 8ca54db + fb28b75
@danpoltawski danpoltawski authored
View
2  blocks/completionstatus/block_completionstatus.php
@@ -220,7 +220,7 @@ public function get_content() {
$this->content->footer = '<br><a href="'.$details->out().'">'.get_string('moredetails', 'completion').'</a>';
} else {
// If user is not enrolled, show error
- $this->content->text = get_string('notenroled', 'completion');
+ $this->content->text = get_string('nottracked', 'completion');
}
if (has_capability('report/completion:view', $context)) {
View
2  blocks/selfcompletion/block_selfcompletion.php
@@ -87,7 +87,7 @@ public function get_content() {
// Check this user is enroled
if (!$info->is_tracked_user($USER->id)) {
- $this->content->text = get_string('notenroled', 'completion');
+ $this->content->text = get_string('nottracked', 'completion');
return $this->content;
}
View
9 course/togglecompletion.php
@@ -45,6 +45,11 @@
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 @@
// 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
View
3  lang/en/completion.php
@@ -135,9 +135,10 @@
$string['markedcompleteby']='Marked complete by {$a}';
$string['markingyourselfcomplete']='Marking yourself complete';
$string['moredetails']='More details';
-$string['notcompleted'] = 'Not completed';
$string['nocriteriaset']='No completion criteria set for this course';
+$string['notcompleted'] = 'Not completed';
$string['notenroled']='You are not enrolled in this course';
+$string['nottracked']='You are currently not being tracked by completion in this course';
$string['notyetstarted']='Not yet started';
$string['overallcriteriaaggregation']='Overall criteria type aggregation';
$string['pending']='Pending';
Please sign in to comment.
Something went wrong with that request. Please try again.