Skip to content

Feature/embedded editor#46

Closed
erseco wants to merge 35 commits intoexelearning:mainfrom
ateeducacion:feature/embedded-static-editor
Closed

Feature/embedded editor#46
erseco wants to merge 35 commits intoexelearning:mainfrom
ateeducacion:feature/embedded-static-editor

Conversation

@erseco
Copy link
Copy Markdown
Collaborator

@erseco erseco commented Feb 9, 2026

This pull request introduces several foundational improvements to the project, focusing on build automation, environment configuration, packaging, and editor integration. The most significant changes include the addition of a comprehensive Makefile for cross-platform development, a new GitHub Actions workflow for automated releases, environment variable management, packaging rules, and the initial implementation of a modal controller for the embedded eXeLearning editor.

Build and Packaging Automation:

  • Added a detailed cross-platform Makefile to automate Docker management, dependency installation, code linting, testing, static editor building, submodule management, and packaging into distributable ZIP files. The Makefile includes robust environment and Docker checks, OS detection, and help documentation.
  • Introduced a .distignore file to control which files and directories are excluded from the distributable package, ensuring clean and minimal releases.
  • Added a .env.dist template file to document and manage required environment variables for local development and Docker Compose usage. (,R1-R21)

Release Workflow:

  • Added a GitHub Actions workflow (.github/workflows/release.yml) to automate building the static editor, packaging the plugin, and uploading the ZIP file as a release asset whenever a new release is published.

Editor Integration:

  • Added an initial implementation of amd/src/editor_modal.js, which provides a modal overlay for the embedded eXeLearning editor. This includes fullscreen modal creation, save/close button handling, postMessage communication with the iframe editor, and integration with Moodle's string APIs and logging.
  • Registered the exelearning submodule in .gitmodules pointing to the appropriate feature branch for the embedded static editor.

These changes lay the groundwork for streamlined development, consistent packaging, and seamless integration of the embedded editor within the Moodle plugin.

@erseco erseco self-assigned this Feb 9, 2026
@erseco erseco marked this pull request as ready for review February 19, 2026 11:55
@pabloamayab
Copy link
Copy Markdown
Collaborator

Great job @erseco

After the first tests:

  • When installing the plugin, it required me to have a template. In previous versions, if none was specified, it set a default one. I don't think this is important.
image
  • In the configuration, I specified that it should use the integrated editor, but when creating the activity, it allows me to use the online version.
image
  • The package type selector has two identical options, although they are different in purpose.

  • The URL parameter is inconsistent with how the exeweb plugin works.

image - In certain situations, the edit button with eXe appears in places where it shouldn't. image
  • Once Tiny has an image, the resource is no longer saved.
  • The close button is incorrect.
image
  • The same problems occur with the image optimizer as with exeweb.

@erseco
Copy link
Copy Markdown
Collaborator Author

erseco commented Mar 7, 2026

Hi @pabloamayab I’ve made the requested corrections based on your previous review.

Could you please check it again when you have a moment?

Thanks.

@erseco erseco changed the title Feature/embedded editor (WIP) Feature/embedded editor Mar 8, 2026
Copy link
Copy Markdown
Collaborator

@ignaciogros ignaciogros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this great tool, @erseco.

I've been testing with Moodle 4.5.10 using the static editor.

If you add a new activity an click on "Save and display" you get this PHP error:

Exception - array_keys(): Argument #1 ($array) must be of type array, null given

The same error is displayed when you click con "Save and return" (it returns to the course) and then you click on the name of the activity to see it.

Apart from that, the "Edit in eXeLearning" button is visible when Moodle's "Edit mode" is off, but that's just a detail.

@ignaciogros
Copy link
Copy Markdown
Collaborator

I suggest creating a new branch for this and integrating the development into this repository as soon as possible, so it's easier to contribute.

@erseco erseco dismissed ignaciogros’s stale review March 9, 2026 13:46

I fixed this exception, please review again if you can

@erseco erseco requested a review from ignaciogros March 9, 2026 13:46
@cristinavaldera
Copy link
Copy Markdown

cristinavaldera commented Mar 18, 2026

  • It doesn't save. Cannot test Saving aspects. Console information:

yjs-loader.js?v=v0.0.0-alpha:26 [EmbeddingBridge] Rejected message from untrusted origin: https://moodle.educarex.es

Captura de pantalla 2026-03-18 a las 8 29 21
  • Different literal compared to exeweb plugin in Configuration ("Crear con eXeLeanring" vs "Crear con eXeLearning (editor integrado)"

  • In configuration, text in buttons should be changed (we already changed themn in old plugins, it was something likke "Save and go back to the course - Save and go to eXeLearning"

@cristinavaldera
Copy link
Copy Markdown

I also think it would be useful for some administrations to have available de "File" menú, in case they want users to use one of their templates, or let users download thei rcontents in different formats, import an elp/elpx...

This would be the same for both plugins

erseco and others added 20 commits March 18, 2026 23:56
Simplify workflow using blueprint-file input and update README
with the Moodle Playground SVG button.
The GITHUB_TOKEN lacks write permissions on the base repo when the
PR comes from a fork. Skip the job entirely in that case.
Set display=1 (Embed) so content renders inline instead of showing
a "Click link to view" download link.
Non-admins see "contact your site administrator", admins see a link
to the plugin settings page. Translations added for en/es/ca/eu/gl.
Build the link with target=_top directly in the HTML output instead
of passing it through lang strings where Moodle HTML Purifier strips
the target attribute. Use a custom error page for admin instead of
moodle_exception.
Remove link button that navigated incorrectly inside iframe.
Admin now sees a text message to install from plugin settings.
…matting

- Remove duplicate string blocks in es/ca/eu/gl lang files
- Remove unused embeddednotinstalled base string (only admin/contactadmin variants are used)
- Fix concatenated string definitions on same line
Change the editor install/uninstall UX to match wp-exelearning:
- Button text changes to "Installing..." / "Removing..." while running
- Spinner with message "This may take a minute..." instead of progress bar
- Translations added for en/es/ca/eu/gl
- Add admin setting widget, external services, and installer classes
- Add source resolver for moodledata/bundled editor precedence
- Add capability mod/exescorm:manageembeddededitor
- Simplify editor/static.php and lib.php helper functions
- Remove obsolete AMD build files (edit_confirmation, editor_modal, fullscreen)
- Update README and version
The min.js files for editor_modal, edit_confirmation, fullscreen and
moodle_exe_bridge were accidentally deleted. Restore them from source
since they are still referenced by player.php and view.php.
Pre-populate all settings with their defaults so the Playground
shows filled-in values instead of empty fields.
- Restore edit_confirmation.min.js and fullscreen.min.js from main
  (properly compiled AMD format with source maps)
- Manually transpile editor_modal.js ES modules to AMD define() wrapper
Moodle Playground runs in debug mode and loads from amd/src/ directly.
ES module import/export syntax fails with RequireJS. Convert
editor_modal.js and edit_confirmation.js to AMD define() format
so they work in both debug and production modes.
Replace throw moodle_exception (returns 500) with a custom HTML error
page function (returns 200), matching the approach used in mod_exeweb.
This prevents a 500 error when the editor opens inside an iframe and
the embedded editor is not yet installed.
Extract only the origin (scheme + host) from wwwroot instead of using
the full URL. The EmbeddingBridge compares message origins which don't
include the path, causing "Rejected message from untrusted origin" on
deployments with a subpath (e.g. Moodle Playground).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants