From b65fd110fcaac5f9fe1499cedad5feb8db915b57 Mon Sep 17 00:00:00 2001 From: Gareth Barnard <1058419+gjb2048@users.noreply.github.com> Date: Sat, 30 Sep 2023 16:38:27 +0100 Subject: [PATCH] Fix 'Grid completion calculated on user hidden modules' ('Available but not shown on course page' are still counted). --- Changes.md | 1 + classes/output/courseformat/content.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index cd55f506..f425f31e 100644 --- a/Changes.md +++ b/Changes.md @@ -9,6 +9,7 @@ Version 402.2.1 - TBR 4. Fix 'Problems with creating multiple courses from template via CSV in Grid Format' - #189. 5. Make 'Main content page' link on single section page more accessible. 6. Fix 'Mouseover for shortened titles' - #187. +7. Fix 'Grid completion calculated on user hidden modules' ('Available but not shown on course page' are still counted). Version 402.2.0 - 16/08/2023 ---------------------------- diff --git a/classes/output/courseformat/content.php b/classes/output/courseformat/content.php index 75d7f4a6..a559b126 100644 --- a/classes/output/courseformat/content.php +++ b/classes/output/courseformat/content.php @@ -339,7 +339,7 @@ protected function calculate_section_activity_completion($section, $course, $mod foreach ($modinfo->sections[$section->section] as $cmid) { $thismod = $modinfo->cms[$cmid]; - if ($thismod->available) { + if ($thismod->uservisible) { $asectionisavailable = true; if ($completioninfo->is_enabled($thismod) != COMPLETION_TRACKING_NONE) { $total++;