MDL-79726 completion: Overall should consider pass/fail states too
In MDL-78744, when the overallcompletion state was added to be displayed in the activity card, only COMPLETE/INCOMPLETE status were considered. However, depending on the activity completion settings, there are a couple of states more that should also be included (COMPLETE_FAIL and COMPLETE_PASS). A new method has been added to the cm_completion_details class to calculate whether a module should be considered or not completed, based on their completion options and the current value for the overall complete state.
This commit is contained in:
@@ -57,6 +57,7 @@ class activity_completion implements renderable, templatable {
|
||||
global $CFG;
|
||||
|
||||
$overallcompletion = $this->cmcompletion->get_overall_completion();
|
||||
$isoverallcomplete = $this->cmcompletion->is_overall_complete();
|
||||
$overrideby = $this->get_overrideby();
|
||||
$course = $this->cminfo->get_course();
|
||||
|
||||
@@ -77,8 +78,8 @@ class activity_completion implements renderable, templatable {
|
||||
'ismanual' => $this->cmcompletion->is_manual(),
|
||||
'showmanualcompletion' => $this->cmcompletion->show_manual_completion(),
|
||||
'istrackeduser' => $this->cmcompletion->is_tracked_user(),
|
||||
'overallcomplete' => $overallcompletion == COMPLETION_COMPLETE,
|
||||
'overallincomplete' => $overallcompletion == COMPLETION_INCOMPLETE,
|
||||
'overallcomplete' => $isoverallcomplete,
|
||||
'overallincomplete' => !$isoverallcomplete,
|
||||
'withavailability' => $withavailability ?? false,
|
||||
'overrideby' => $overrideby,
|
||||
'completiondetails' => $this->get_completion_details($overrideby),
|
||||
|
||||
Reference in New Issue
Block a user