This commit is contained in:
Huong Nguyen
2026-03-04 08:52:49 +07:00
+2 -2
View File
@@ -105,8 +105,8 @@ class get_state extends external_api {
}
foreach ($modinfo->cms as $cm) {
if ($cm->is_visible_on_course_page() && $cm->is_of_type_that_can_display()) {
// Only return this course module data if it's visible by current user on the course page.
if (($cm->is_visible_on_course_page() || $cm->is_stealth()) && $cm->is_of_type_that_can_display()) {
// Only return this course module data if it's accessible to the current user on the course page.
$section = $sections[$cm->sectionnum];
$cmstate = new $cmclass($courseformat, $section, $cm, istrackeduser: $istrackeduser);
$result->cm[] = $cmstate->export_for_template($renderer);