Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5781a27
Feature/embedded editor
erseco Feb 9, 2026
27eb89d
Allow uploading .elpx directly
erseco Feb 9, 2026
c81f87f
Better detection of elpx
erseco Feb 10, 2026
ee9c458
Fix version
erseco Feb 10, 2026
d8bf279
Fix version
erseco Feb 10, 2026
69aa32f
Removed submodule
erseco Feb 11, 2026
d3a0fc2
Add teacher mode toggler
erseco Feb 12, 2026
ae62bfd
Removed version from docker-compose.yml
erseco Feb 17, 2026
c5b9fa8
Upgraded readme
erseco Feb 19, 2026
92ded15
Fixed code
erseco Mar 7, 2026
c56617b
Better trnslation
erseco Mar 7, 2026
02dbf09
Fix code
erseco Mar 9, 2026
f5678aa
Use embedded editor
erseco Mar 18, 2026
c8c5158
Use embedded editor
erseco Mar 18, 2026
939cfc5
Add playground link
erseco Mar 18, 2026
93ae6eb
Add playground link
erseco Mar 18, 2026
fbd8e3d
Use action-moodle-playground-pr-preview for PR previews
erseco Mar 28, 2026
e9946ce
Skip PR preview on cross-fork PRs
erseco Mar 28, 2026
95b3e5f
Add example activity and student user to blueprint
erseco Apr 1, 2026
c4a5bb3
Add extra-text warning, append-to-description mode, and sample ELPX c…
erseco Apr 2, 2026
ea139ff
Simplify blueprint with addModule files support and append-to-descrip…
erseco Apr 2, 2026
ec87649
Add display field to blueprint addModule steps
erseco Apr 2, 2026
99dae1c
Show admin-aware error when embedded editor is not installed
erseco Apr 2, 2026
10d7c3b
Add target=_top to settings link so it opens outside the editor iframe
erseco Apr 2, 2026
92d8a99
Fix settings link opening inside editor iframe
erseco Apr 2, 2026
fc18d7d
Simplify admin error to text-only message without link
erseco Apr 2, 2026
b21c78c
Clean up lang strings: remove duplicates, unused base string, fix for…
erseco Apr 2, 2026
fe444bc
Replace progress bar with spinner and downloading message
erseco Apr 2, 2026
bd48874
Add embedded editor admin management, external API, and source resolver
erseco Apr 2, 2026
41cce1e
Restore missing AMD build files
erseco Apr 2, 2026
551c225
Set all plugin default values in blueprint
erseco Apr 2, 2026
a76791e
Fix AMD build files: restore from main and transpile editor_modal
erseco Apr 2, 2026
1321b41
Convert ES module sources to AMD define() format
erseco Apr 2, 2026
a47af52
Use custom error page instead of moodle_exception in editor/index.php
erseco Apr 2, 2026
7fbc452
Fix trusted origins for postMessage in editor embedding config
erseco Apr 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ,
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file (.env.dist) is an example template for the environment variables required by the application.
# The .env file is not versioned in the repository and should be created by duplicating this file.
# To use it, copy this file as .env and define the appropriate values.
# The environment variables defined in .env will be automatically loaded by Docker Compose.

APP_ENV=prod
APP_DEBUG=0
APP_SECRET=CHANGE_THIS_TO_A_SECRET
APP_PORT=8080
APP_ONLINE_MODE=1
XDEBUG_MODE=off # You can enable it by changing to "debug"
XDEBUG_CONFIG="client_host=host.docker.internal"

EXELEARNING_WEB_SOURCECODE_PATH=
EXELEARNING_WEB_CONTAINER_TAG=latest

# Test user data
TEST_USER_EMAIL=user@exelearning.net
TEST_USER_USERNAME=user
TEST_USER_PASSWORD=1234

20 changes: 20 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.git
.github
.gitignore
.aider*
.DS_Store
.distignore
.env
exelearning/
vendor/
node_modules/
phpmd-rules.xml
phpmd.xml
Makefile
docker-compose.yml
Dockerfile
composer.json
composer.lock
composer.phar
CLAUDE.md
*.zip
29 changes: 29 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file (.env.dist) is an example template for the environment variables required by the application.
# The .env file is not versioned in the repository and should be created by duplicating this file.
# To use it, copy this file as .env and define the appropriate values.
# The environment variables defined in .env will be automatically loaded by Docker Compose.

APP_ENV=prod
APP_DEBUG=0
APP_SECRET=CHANGE_THIS_TO_A_SECRET
APP_PORT=8080
APP_ONLINE_MODE=1
XDEBUG_MODE=off # You can enable it by changing to "debug"
XDEBUG_CONFIG="client_host=host.docker.internal"

EXELEARNING_WEB_SOURCECODE_PATH=
EXELEARNING_WEB_CONTAINER_TAG=latest
EXELEARNING_EDITOR_REPO_URL=https://github.com/exelearning/exelearning.git
EXELEARNING_EDITOR_DEFAULT_BRANCH=main
EXELEARNING_EDITOR_REF=
EXELEARNING_EDITOR_REF_TYPE=auto

# To use a specific Moodle version, set MOODLE_VERSION to git release tag.
# You can find the list of available tags at:
# https://api.github.com/repos/moodle/moodle/tags
MOODLE_VERSION=v5.0.5

# Test user data
TEST_USER_EMAIL=user@exelearning.net
TEST_USER_USERNAME=user
TEST_USER_PASSWORD=1234
95 changes: 95 additions & 0 deletions .github/workflows/check-editor-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
name: Check Editor Releases

on:
schedule:
- cron: "0 8 * * *" # Daily at 8:00 UTC
workflow_dispatch:

permissions:
contents: write
actions: write

jobs:
check_and_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get latest exelearning release
id: check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetch latest release from exelearning/exelearning
LATEST=$(gh api repos/exelearning/exelearning/releases/latest --jq '.tag_name' 2>/dev/null || echo "")
if [ -z "$LATEST" ]; then
echo "No release found"
echo "found=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "Latest editor release: $LATEST"
echo "tag=$LATEST" >> $GITHUB_OUTPUT

# Check if we already built this version
MARKER_FILE=".editor-version"
CURRENT=""
if [ -f "$MARKER_FILE" ]; then
CURRENT=$(cat "$MARKER_FILE")
fi
echo "Current built version: $CURRENT"

if [ "$LATEST" = "$CURRENT" ]; then
echo "Already up to date"
echo "found=false" >> $GITHUB_OUTPUT
else
echo "New version available"
echo "found=true" >> $GITHUB_OUTPUT
fi

- name: Setup Bun
if: steps.check.outputs.found == 'true'
uses: oven-sh/setup-bun@v2

- name: Build static editor
if: steps.check.outputs.found == 'true'
env:
EXELEARNING_EDITOR_REPO_URL: https://github.com/exelearning/exelearning.git
EXELEARNING_EDITOR_REF: ${{ steps.check.outputs.tag }}
EXELEARNING_EDITOR_REF_TYPE: tag
run: make build-editor

- name: Compute version
if: steps.check.outputs.found == 'true'
id: version
run: |
TAG="${{ steps.check.outputs.tag }}"
VERSION="${TAG#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: Create package
if: steps.check.outputs.found == 'true'
run: make package RELEASE=${{ steps.version.outputs.version }}

- name: Update editor version marker
if: steps.check.outputs.found == 'true'
run: |
echo "${{ steps.check.outputs.tag }}" > .editor-version
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .editor-version
git commit -m "Update editor version to ${{ steps.check.outputs.tag }}"
git push

- name: Create GitHub Release
if: steps.check.outputs.found == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: "${{ steps.version.outputs.tag }}"
body: |
Automated build with eXeLearning editor ${{ steps.version.outputs.tag }}.
files: mod_exescorm-${{ steps.version.outputs.version }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/pr-playground-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: PR Playground Preview

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: playground-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
playground-preview:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Build PR blueprint
env:
PLUGIN_REPO_OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
PLUGIN_REPO_NAME: ${{ github.event.pull_request.head.repo.name }}
PLUGIN_BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
run: |
plugin_url="https://github.com/${PLUGIN_REPO_OWNER}/${PLUGIN_REPO_NAME}/archive/refs/heads/${PLUGIN_BRANCH_NAME}.zip"
sed "s|https://github.com/exelearning/mod_exescorm/archive/refs/heads/main.zip|${plugin_url}|" blueprint.json > blueprint.pr.json

- uses: ateeducacion/action-moodle-playground-pr-preview@main
with:
blueprint-file: blueprint.pr.json
mode: append-to-description
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-text: >
⚠️ The embedded eXeLearning editor is not included in this preview.
You can install it from **Modules > eXeLearning SCORM > Configure**
using the "Download & Install Editor" button.
All other module features (ELPX upload, viewer, preview) work normally.
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
name: Release

on:
release:
types: [published]
workflow_dispatch:
inputs:
release_tag:
description: "Release label for package name (e.g. 1.2.3 or 1.2.3-beta)"
required: false
default: ""
editor_repo_url:
description: "Editor source repository URL"
required: false
default: "https://github.com/exelearning/exelearning.git"
editor_ref:
description: "Editor ref value (main, branch name, or tag)"
required: false
default: "main"
editor_ref_type:
description: "Type of editor ref"
required: false
default: "auto"
type: choice
options:
- auto
- branch
- tag

permissions:
contents: write

jobs:
build_and_upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Set environment variables
run: |
if [ "${{ github.event_name }}" = "release" ]; then
RAW_TAG="${GITHUB_REF##*/}"
VERSION_TAG="${RAW_TAG#v}"
echo "RELEASE_TAG=${VERSION_TAG}" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REPO_URL=https://github.com/exelearning/exelearning.git" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REF=main" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REF_TYPE=branch" >> $GITHUB_ENV
else
INPUT_RELEASE="${{ github.event.inputs.release_tag }}"
if [ -z "$INPUT_RELEASE" ]; then
INPUT_RELEASE="manual-$(date +%Y%m%d)-${GITHUB_SHA::7}"
fi
echo "RELEASE_TAG=${INPUT_RELEASE}" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REPO_URL=${{ github.event.inputs.editor_repo_url }}" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REF=${{ github.event.inputs.editor_ref }}" >> $GITHUB_ENV
echo "EXELEARNING_EDITOR_REF_TYPE=${{ github.event.inputs.editor_ref_type }}" >> $GITHUB_ENV
fi

- name: Build static editor
run: make build-editor

- name: Create package
run: make package RELEASE=${RELEASE_TAG}

- name: Upload ZIP as workflow artifact
uses: actions/upload-artifact@v4
with:
name: mod_exescorm-${{ env.RELEASE_TAG }}
path: mod_exescorm-${{ env.RELEASE_TAG }}.zip

- name: Upload ZIP to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: mod_exescorm-${{ env.RELEASE_TAG }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.aider*
.env

# mess detector rules
phpmd-rules.xml

# Composer ignores
/vendor/
/composer.lock
/composer.phar

# Built static editor files
dist/static/

# Local editor checkout fetched during build
exelearning/
35 changes: 35 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Development Guide

This document covers the development setup for the eXeLearning SCORM plugin.

> **Important:** Do not install this plugin by cloning the repository directly. The repository does not include the embedded editor, which is built during the release process. Always install from a [release ZIP](https://github.com/exelearning/mod_exescorm/releases).

## Development using Makefile

To facilitate development, a `Makefile` is included to simplify Docker-based workflows.

### Environment Variables

You can configure various settings using the `.env` file. If this file does not exist, it will be automatically generated by copying from `.env.dist`. Key variables to configure:

- `EXELEARNING_WEB_SOURCECODE_PATH`: Define the path to the eXeLearning source code if you want to work with a local version.
- `APP_PORT`: Define the port on which the application will run.
- `APP_SECRET`: Set a secret key for the application.
- `EXELEARNING_EDITOR_REPO_URL`: Repository used to fetch embedded editor source code.
- `EXELEARNING_EDITOR_DEFAULT_BRANCH`: Fallback branch when no specific ref is defined.
- `EXELEARNING_EDITOR_REF`: Specific branch or tag to build from (if empty, fallback to default branch).
- `EXELEARNING_EDITOR_REF_TYPE`: `auto`, `branch`, or `tag` to resolve `EXELEARNING_EDITOR_REF`.

## Embedded Editor Source Strategy

The embedded static editor is no longer tied to a git submodule. During `make build-editor` the source is fetched as a shallow checkout from `EXELEARNING_EDITOR_REPO_URL` using:

- `EXELEARNING_EDITOR_REF_TYPE=branch` to force branch mode.
- `EXELEARNING_EDITOR_REF_TYPE=tag` to force tag mode.
- `EXELEARNING_EDITOR_REF_TYPE=auto` to try tag first, then branch.

This keeps the plugin repo lighter and lets CI/manual builds choose `main`, a specific tag, or a feature branch without submodule maintenance.

## Manual Plugin Build in GitHub Actions

The `Release` workflow now supports manual execution (`workflow_dispatch`) from the `main` branch. It accepts editor source parameters (`editor_repo_url`, `editor_ref`, `editor_ref_type`) and a `release_tag` for the generated ZIP name.
Loading