Permalink
Browse files

MDL-26190 completion blocks: Show messages rather than hiding the block

  • Loading branch information...
1 parent 2b37004 commit 0b15b43b3ed2f05aa7c84b6551d67255e1faff9c Aaron Barnes committed Feb 17, 2011
@@ -49,6 +49,7 @@ public function get_content() {
// Don't display if completion isn't enabled!
if (!$this->page->course->enablecompletion) {
+ $this->content->text = get_string('completionnotenabled', 'block_completionstatus');
return $this->content;
}
@@ -58,6 +59,7 @@ public function get_content() {
// Check if this course has any criteria
if (empty($completions)) {
+ $this->content->text = get_string('nocriteria', 'block_completionstatus');
return $this->content;
}
@@ -157,7 +159,7 @@ public function get_content() {
// Is course complete?
$coursecomplete = $info->is_course_complete($USER->id);
-
+
// Load course completion
$params = array(
'userid' => $USER->id,
@@ -54,6 +54,7 @@ public function get_content() {
// Don't display if completion isn't enabled!
if (!$this->page->course->enablecompletion) {
+ $this->content->text = get_string('completionnotenabled', 'block_selfcompletion');
return $this->content;
}
@@ -68,6 +69,7 @@ public function get_content() {
// Check if self completion is one of this course's criteria
if (empty($completion)) {
+ $this->content->text = get_string('selfcompletionnotenabled', 'block_selfcompletion');
return $this->content;
}
@@ -26,3 +26,5 @@
$string['selfcompletion'] = 'Self completion';
$string['pluginname'] = 'Self completion';
$string['completecourse'] = 'Complete course';
+$string['completionnotenabled'] = 'Course completion is not enabled';
+$string['selfcompletionnotenabled'] = 'The self completion criteria has not been enabled for this course';

0 comments on commit 0b15b43

Please sign in to comment.