Conversation
eXeLearning's SCORM and IMS exports leave the navigation menu to the LMS, but they carry content.xml, so the upload form and the sibling migration install them. The activity then shows its pages without a menu, and further pages cannot be reached. Detect those exports by their root imsmanifest.xml and show a warning to anyone who can open the editor: saving from it rebuilds the website with its menu. Related to exelearning/exelearning#2477.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
=========================================
Coverage 93.92% 93.92%
- Complexity 810 811 +1
=========================================
Files 46 46
Lines 3554 3556 +2
=========================================
+ Hits 3338 3340 +2
Misses 216 216
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Summary
An activity installed from an eXeLearning SCORM or IMS export (uploaded directly, or created by "Migrate to eXeLearning" from a
mod_exescormactivity) shows its pages without the navigation menu. On a multi-page package, pages 2 and later cannot be reached at all.This PR detects that case and tells the teacher how to fix it: open the activity with Edit with eXeLearning and click Save to Moodle. That rebuilds it as a website with its menu.
Original issue
Related to exelearning/exelearning#2477, reported by @ignaciogros. Thank you for the clear description of the migration path; it made the case easy to reproduce.
Root cause
hideNavigation: trueandhideNavButtons: true: there is no<nav id="siteNav">in the HTML, because the LMS is expected to provide navigation fromimsmanifest.xml.content.xml"for re-editing". Sopackage_probe(migration) andvalidate_content_xml()(upload form) accept it, and the plugin serves itsindex.htmlas-is..elpxcontains a full website export with#siteNav. The plugin has no server-side exporter, so only the embedded editor can rebuild the HTML.Both fixtures in
research/fixtures/show the difference: samecontent.xml, but the SCORM zip hasimsmanifest.xmland no<nav>, the.elpxhas#siteNavand no manifest.Fix
package_manager::content_is_lms_export(): the installed revision has a rootimsmanifest.xml.view.php: when that is true and the user can open the editor, show a warning with the steps. Students see nothing new.lmsexportnonavigationin the five languages.Saving from the editor stores an
.elpxwithout the manifest, so the warning disappears on its own.Why not rebuild automatically? That needs the browser exporter: either reimplementing eXeLearning's page renderer in PHP (it would drift from upstream), or running the editor hidden after each migration (large and fragile). The warning plus the one-click editor path fixes the activity today without either. A cleaner long-term fix belongs upstream: the SCORM exporter could keep the menu in the HTML and hide it.
TDD
RED
tests/lib_extract_test.php::test_content_is_lms_export, with the SCORM zip and the.elpxfixtures:GREEN
How to test
research/fixtures/scorm/actividad-evaluable_scorm.zip(or migrate amod_exescormactivity that holds an eXeLearning SCORM export).Screenshots
Before: SCORM export installed, no menu and no hint
After: the teacher sees the warning
After saving from the editor: menu rebuilt, warning gone
Notes
version.php:2026092614(new language string). Other open PRs of this batch also bump it; whichever merges later rebases its version.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.