From 60c3f02c144f8323437815a042a711272ca5d54b Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Thu, 6 Feb 2014 14:58:52 +0800 Subject: [PATCH] MDL-42870 completion: show failed activities as incompleted --- report/completion/index.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/report/completion/index.php b/report/completion/index.php index 89f0830730f..820836f7406 100644 --- a/report/completion/index.php +++ b/report/completion/index.php @@ -587,18 +587,17 @@ foreach ($progress as $user) { $activity = $modinfo->cms[$criterion->moduleinstance]; // Get progress information and state + if (array_key_exists($activity->id, $user->progress)) { + $state = $user->progress[$activity->id]->completionstate; + } else if ($is_complete) { + $state = COMPLETION_COMPLETE; + } else { + $state = COMPLETION_INCOMPLETE; + } if ($is_complete) { $date = userdate($criteria_completion->timecompleted, get_string('strftimedatetimeshort', 'langconfig')); - - if (array_key_exists($activity->id, $user->progress)) { - $thisprogress = $user->progress[$activity->id]; - $state = $thisprogress->completionstate; - } else { - $state = COMPLETION_COMPLETE; - } } else { $date = ''; - $state = COMPLETION_INCOMPLETE; } // Work out how it corresponds to an icon