✨ Add backup/restore, view capability and viewed event - #7
Merged
Conversation
Addresses the Moodle Marketplace review blockers (MMRT-99) before resubmission: - implement the Backup/Restore moodle2 API for the edflex activity - gate view.php behind a new mod/edflex:view capability - emit the standard course_module_viewed event
- drop the blank line after each class opening brace (PSR12) - remove the unneeded MOODLE_INTERNAL guard from class-only files - capitalise the launcher inline comment in lib.php
DamienVauchel
marked this pull request as ready for review
June 29, 2026 09:51
DamienVauchel
requested review from
johnny1991,
sserot and
traezh
as code owners
June 29, 2026 09:51
traezh
approved these changes
Jun 29, 2026
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.
🎯 Purpose of this Pull Request
The Moodle Marketplace review of
mod_edflex(review ticket MMRT-99) returned three approval blockers. This PR addresses all three so the plugin can be resubmitted.view.php(require_loginpresent, norequire_capability).course_module_viewedevent.📝 Summary of Changes
edflexactivity (backup/moodle2/: backup + restore task classes and stepslibs), covering theedflextable andintrofiles.mod/edflex:viewcapability and enforce it withrequire_capability()inview.php; set the page url/context/title/heading before output.\mod_edflex\event\course_module_viewedand trigger it fromview.php.FEATURE_MOD_INTRO,FEATURE_SHOW_DESCRIPTION,FEATURE_BACKUP_MOODLE2inedflex_supports(); bumpversion.phptov1.0.2.✔️ Moodle Plugin Checklist
Code Quality & Standards
Functional Changes
lang/en/edflex.php(edflex:view)db/access.phpDatabase & Files
🧪 Testing
Manual Tests
mod/edflex:view, and acourse_module_viewedevent is logged.Automated Tests
🔄 Regression Risk
view.phpaccess path (new capability gate + event) and the new backup/restore steps. No change to the SCORM-wrapper flow.🔗 Additional Notes
mod_edflexis a launcher:edflex_add_instance()returnsfalseby design (the form spawns SCORM modules via the Edflex browser), so no standaloneedflexinstance is persisted. The Backup/Restore API is implemented to satisfy the Marketplace requirement and is correct, but inert until/unless real instances exist.edflex_scormrows are not carried through a course restore — preserving them would require amod_scormbackup subplugin. Out of scope here.