From 96df2b49d785cfd46bc0d51cd01e3e198cd1e419 Mon Sep 17 00:00:00 2001 From: erseco Date: Fri, 19 Jun 2026 12:53:14 +0100 Subject: [PATCH] fix(teacher-mode): reveal via core ?exe-teacher URL param, drop CSS injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit eXeLearning packages hide teacher-only content by default and expose a teacher-layer selector through the package's own ?exe-teacher=1 URL parameter (upstream exelearning#1772). view.php now appends that parameter to the content iframe src when the per-activity teachermodevisible setting is on — for every viewer, with no role gate — instead of injecting CSS into the package to hide the selector. - Remove classes/local/ui/teacher_mode_hider.php and the exelearning_require_teacher_mode_hider() lib.php helper. - view.php: append exe-teacher=1 on the content pluginfile URL when the teachermodevisible setting is on. - Homogenize the teachermodevisible label/help ("Show teacher layer selector") across en/es/ca/eu/gl, and refresh the install.xml/upgrade/mod_form comments. - Update behat scenarios (teacher and student see the param when on; neither when off) and drop the obsolete hider unit test. --- classes/local/ui/teacher_mode_hider.php | 62 ------------------------- db/install.xml | 2 +- db/upgrade.php | 12 +++-- lang/ca/exelearning.php | 4 +- lang/en/exelearning.php | 4 +- lang/es/exelearning.php | 2 +- lang/eu/exelearning.php | 4 +- lang/gl/exelearning.php | 4 +- lib.php | 13 ------ mod_form.php | 6 ++- tests/behat/mod_exelearning.feature | 27 +++++++++++ tests/lib_callbacks_test.php | 10 ---- view.php | 20 +++++--- 13 files changed, 61 insertions(+), 109 deletions(-) delete mode 100644 classes/local/ui/teacher_mode_hider.php diff --git a/classes/local/ui/teacher_mode_hider.php b/classes/local/ui/teacher_mode_hider.php deleted file mode 100644 index 7dd9cb3..0000000 --- a/classes/local/ui/teacher_mode_hider.php +++ /dev/null @@ -1,62 +0,0 @@ -. - -/** - * Teacher-mode toggle hider for the package iframe (mod_exeweb parity). - * - * Extracted from lib.php (DEC-0054). The behaviour is unchanged: it queues the - * same parent-page JS that injects a