Reveal teacher content via eXeLearning's ?exe-teacher URL param, retire CSS injection#86
Merged
Merged
Conversation
…njection
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.
54309a5 to
96df2b4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
============================================
- Coverage 89.51% 89.48% -0.04%
+ Complexity 980 979 -1
============================================
Files 53 52 -1
Lines 4236 4221 -15
============================================
- Hits 3792 3777 -15
Misses 444 444
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
erseco
added a commit
that referenced
this pull request
Jun 26, 2026
Reconcile teacher-mode handling with main (#86). main retired the host-side CSS injection in favour of the package's own ?exe-teacher=1 URL parameter, so: - view.php: keep the secure/legacy iframe-mode resolution and append ?exe-teacher=1 to the resolved $iframeurl when teachermodevisible is on. The parameter works in secure (opaque-origin) mode too because the package reads its own location.search, so no host CSS injection is needed in either mode. - Drop the exelearning_require_teacher_mode_hider() call (the helper and classes/local/ui/teacher_mode_hider.php were removed on main). - Retire the SCORM bridge's teacher-mode path, now redundant: remove teachermodevisible from the relay config ($relaycfg), the relay handshake postMessage and the in-iframe shim's hideTeacherMode() (it injected the exact #teacher-mode-toggler-wrapper CSS that #86 retired). Update tests/js accordingly. SCORM tracking over the bridge is unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
eXeLearning core now hides teacher-only content by default and exposes an in-package "teacher layer" selector to show it via the
?exe-teacher=1URL parameter (upstream exelearning/exelearning#1972, fixes exelearning/exelearning#1772). This consumes that contract and retires the plugin's parent-side teacher-mode CSS injection.Changes
classes/local/ui/teacher_mode_hider.phpand theexelearning_require_teacher_mode_hider()lib.phphelper that injected#teacher-mode-toggler-wrapper { visibility: hidden }into the package iframe.view.phpnow appends?exe-teacher=1to the content iframe src whenever the per-activityteachermodevisiblesetting is on — for every viewer.teachermodevisiblesetting uses the "Show teacher layer selector" label/help, homogeneous across en/ca/es/eu/gl with mod_exeweb and mod_exescorm. Refreshed the matchinginstall.xml/db/upgrade.php/mod_form.phpcomments.Notes
main. No schema change and no version bump — theteachermodevisiblefield and its default-0 migration already shipped; this only changes how the setting is consumed.Testing
php -lclean;phpcs --standard=moodleclean on the changed files. Behat updated: the iframe src carriesexe-teacher=1when the setting is on (including for a student) and omits it when off; dropped the obsolete hider unit test. PHPUnit/Behat need a Moodle CI site.Moodle Playground Preview
The changes in this pull request can be previewed and tested using a Moodle Playground instance.
ℹ️ The eXeLearning editor is fetched from the shared release and unpacked into the plugin when the playground boots, so the first load may take a few extra seconds. ELPX upload, viewer and preview work normally.