Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions .github/workflows/pr-playground-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: PR Playground Preview

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

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@v6
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: ateeducacion/action-moodle-playground-pr-preview@main
with:
blueprint-file: blueprint.json
github-token: ${{ secrets.GITHUB_TOKEN }}
moodle-version: '5.2'
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
plugin offers tight integration with Moodle, supporting meeting creation,
synchronization, grading and backup/restore.

## Try in Moodle Playground

Click the badge below to open the `main` branch instantly in [Moodle Playground](https://moodle-playground.com) with `mod_zoom` pre-installed. The playground boots a full Moodle 5.2 site with a demo course (`ZOOMDEMO01`) that contains a stub Zoom activity so you can preview the activity view, the `mod_form`, and the plugin's admin settings without any local setup. Every same-repo pull request also automatically generates a playground preview link appended to the PR description so reviewers can test changes in a live Moodle instance.

**Note:** the Zoom REST API is not reachable from the Playground sandbox. The Join / Start buttons will not work and you cannot create real meetings — this preview is intended for UI and admin-settings inspection only.

<a href="https://moodle-playground.com/?blueprint-url=https://raw.githubusercontent.com/ncstate-delta/moodle-mod_zoom/refs/heads/main/blueprint.json" target="_blank" rel="noopener"><img src="https://raw.githubusercontent.com/ateeducacion/action-moodle-playground-pr-preview/refs/heads/main/assets/playground-preview-button.svg" alt="Preview in Moodle Playground" width="200"></a>

The PR preview links are produced by the [ateeducacion/action-moodle-playground-pr-preview](https://github.com/ateeducacion/action-moodle-playground-pr-preview) GitHub Action, configured via `blueprint.json` at the repository root.

## Prerequisites

This plugin is designed for Educational or Business Zoom accounts.
Expand Down
85 changes: 85 additions & 0 deletions blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"$schema": "https://raw.githubusercontent.com/ateeducacion/moodle-playground/refs/heads/main/assets/blueprints/blueprint-schema.json",
"preferredVersions": {
"php": "8.3",
"moodle": "5.2"
},
"landingPage": "/course/view.php?id=2",
"constants": {
"ADMIN_USER": "admin",
"ADMIN_PASS": "test",
"ADMIN_EMAIL": "admin@example.com"
},
"steps": [
{
"step": "installMoodle",
"options": {
"adminUser": "{{ADMIN_USER}}",
"adminPass": "{{ADMIN_PASS}}",
"adminEmail": "{{ADMIN_EMAIL}}",
"siteName": "Zoom Activity Demo",
"locale": "en",
"timezone": "Europe/Madrid"
}
},
{
"step": "login",
"username": "{{ADMIN_USER}}"
},
{
"step": "installMoodlePlugin",
"pluginType": "mod",
"pluginName": "zoom",
"url": "https://github.com/ncstate-delta/moodle-mod_zoom/archive/refs/heads/main.zip"
},
{
"step": "setConfigs",
"configs": [
{ "plugin": "mod_zoom", "name": "accountid", "value": "PLAYGROUND_DEMO" },
{ "plugin": "mod_zoom", "name": "clientid", "value": "PLAYGROUND_DEMO" },
{ "plugin": "mod_zoom", "name": "clientsecret", "value": "PLAYGROUND_DEMO" }
]
},
{
"step": "createCategory",
"name": "Test Courses"
},
{
"step": "createCourse",
"fullname": "Zoom Activity Demo Course",
"shortname": "ZOOMDEMO01",
"category": "Test Courses",
"summary": "Demo course for the mod_zoom activity module. A stub Zoom meeting activity is preloaded so you can inspect the activity page, the mod_form, and the plugin's admin settings. NOTE: the Zoom REST API is not reachable from the Playground sandbox, so creating, updating or joining real meetings will not work — this preview is intended for UI and settings inspection only.",
"format": "topics",
"numsections": 3
},
{
"step": "createUser",
"username": "student",
"password": "test",
"email": "student@example.com",
"firstname": "Demo",
"lastname": "Student"
},
{
"step": "enrolUser",
"username": "{{ADMIN_USER}}",
"course": "ZOOMDEMO01",
"role": "editingteacher"
},
{
"step": "enrolUser",
"username": "student",
"course": "ZOOMDEMO01",
"role": "student"
},
{
"step": "runPhpCode",
"code": "if (!defined('CLI_SCRIPT')) { define('CLI_SCRIPT', true); }\nrequire('/www/moodle/config.php');\nrequire_once($CFG->dirroot . '/course/lib.php');\ntry {\n $course = $DB->get_record('course', ['shortname' => 'ZOOMDEMO01'], '*', MUST_EXIST);\n $module = $DB->get_record('modules', ['name' => 'zoom'], '*', MUST_EXIST);\n $admin = get_admin();\n \\core\\session\\manager::set_user($admin);\n $now = time();\n $zoom = (object)[\n 'course' => $course->id,\n 'name' => 'Sample Zoom meeting (stub)',\n 'intro' => '<p>This is a <strong>stub</strong> Zoom activity created directly in the database so you can preview <code>mod_zoom</code>\\'s UI inside Moodle Playground.</p><p>The Zoom REST API is not reachable from the sandbox, so the Join / Start buttons will not work — open the activity to inspect the view page layout, or edit it to inspect the mod_form.</p>',\n 'introformat' => FORMAT_HTML,\n 'grade' => 100,\n 'meeting_id' => 1234567890,\n 'host_id' => 'PLAYGROUND_DEMO_HOST',\n 'created_at' => gmdate('Y-m-d\\\\TH:i:s\\\\Z', $now),\n 'start_time' => $now + 3600,\n 'duration' => 3600,\n 'timezone' => 'Europe/Madrid',\n 'webinar' => 0,\n 'recurring' => 0,\n 'timemodified' => $now,\n 'exists_on_zoom'=> 0,\n ];\n $zoomid = $DB->insert_record('zoom', $zoom);\n $cm = (object)[\n 'course' => $course->id,\n 'module' => $module->id,\n 'instance' => $zoomid,\n 'section' => 1,\n 'idnumber' => '',\n 'added' => $now,\n 'score' => 0,\n 'indent' => 0,\n 'visible' => 1,\n 'visibleold' => 1,\n 'groupmode' => 0,\n 'groupingid' => 0,\n 'completion' => 0,\n 'showdescription' => 0,\n ];\n $cmid = add_course_module($cm);\n $DB->set_field('course_modules', 'instance', $zoomid, ['id' => $cmid]);\n course_add_cm_to_section($course->id, $cmid, 1);\n rebuild_course_cache($course->id, true);\n echo \"Created mod_zoom instance id={$zoomid} cmid={$cmid} in course {$course->shortname}\\n\";\n} catch (\\Throwable $e) {\n echo 'ERROR: ' . $e->getMessage() . \"\\n\";\n}"
},
{
"step": "setLandingPage",
"path": "/course/view.php?id=2"
}
]
}