Permalink
Browse files

course completion: MDL-2631 Display completion status more accurately

  • Loading branch information...
1 parent 8c407e5 commit cba8b02635e9c4b46d109711b7821ac60d9aeac5 @srynot4sale srynot4sale committed Aug 27, 2010
Showing with 8 additions and 1 deletion.
  1. +8 −1 blocks/completionstatus/block_completionstatus.php
View
9 blocks/completionstatus/block_completionstatus.php
@@ -157,6 +157,13 @@ public function get_content() {
// Is course complete?
$coursecomplete = $info->is_course_complete($USER->id);
+
+ // Load course completion
+ $params = array(
+ 'userid' => $USER->id,
+ 'course' => $COURSE->id
+ );
+ $ccompletion = new completion_completion($params);
// Has this user completed any criteria?
$criteriacomplete = $info->count_course_user_data($USER->id);
@@ -165,7 +172,7 @@ public function get_content() {
$this->content->text .= '<i>'.get_string('pending', 'completion').'</i>';
} else if ($coursecomplete) {
$this->content->text .= get_string('complete');
- } else if (!$criteriacomplete) {
+ } else if (!$criteriacomplete && !$ccompletion->timestarted) {
$this->content->text .= '<i>'.get_string('notyetstarted', 'completion').'</i>';
} else {
$this->content->text .= '<i>'.get_string('inprogress','completion').'</i>';

0 comments on commit cba8b02

Please sign in to comment.