forked from exelearning/moodle-mod_exelearning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblueprint.json
More file actions
179 lines (179 loc) · 7.93 KB
/
Copy pathblueprint.json
File metadata and controls
179 lines (179 loc) · 7.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
{
"$schema": "https://raw.githubusercontent.com/ateeducacion/moodle-playground/refs/heads/main/assets/blueprints/blueprint-schema.json",
"preferredVersions": { "php": "8.3", "moodle": "5.0" },
"landingPage": "/course/view.php?id=2",
"constants": {
"REPO": "exelearning/mod_exelearning",
"REF": "main",
"ADMIN_USER": "admin",
"ADMIN_PASS": "password",
"ADMIN_EMAIL": "admin@example.com",
"STUDENT_PASS": "Demo!2026",
"TEACHER_USER": "teacher_demo",
"TEACHER_PASS": "Demo!2026"
},
"steps": [
{
"step": "installMoodle",
"options": {
"adminUser": "{{ADMIN_USER}}",
"adminPass": "{{ADMIN_PASS}}",
"adminEmail": "{{ADMIN_EMAIL}}",
"siteName": "mod_exelearning Playground",
"locale": "en",
"timezone": "Europe/Madrid"
}
},
{ "step": "login", "username": "{{ADMIN_USER}}" },
{
"step": "installMoodlePlugin",
"pluginType": "mod",
"pluginName": "exelearning",
"url": "https://github.com/{{REPO}}/archive/refs/heads/{{REF}}.zip"
},
{
"step": "unzip",
"comment": "Auto-load the eXeLearning static editor so the playground boots with a working editor, without the slow runtime PHP download. The editor is the shared release artifact, fetched once through the github-proxy (CORS) via the fast JS transport. The asset wraps everything in a 'static/' folder, so extracting into 'dist' yields 'dist/static/...', which embedded_editor_source_resolver serves through its 'bundled' precedence (moodledata -> bundled -> none). Pinned to match .editor-version for deterministic previews. embedded_editor_installer stays for production/offline installs.",
"destination": "/www/moodle/mod/exelearning/dist",
"data": { "url": "https://github-proxy.exelearning.dev/?repo=exelearning/exelearning&release=v4.0.2&asset=exelearning-static-v4.0.2.zip" }
},
{
"step": "setConfigs",
"configs": [
{ "name": "editormode", "value": "embedded", "plugin": "exelearning" },
{ "name": "display", "value": "1", "plugin": "exelearning" },
{ "name": "printintro", "value": "1", "plugin": "exelearning" },
{ "name": "debug", "value": "32767" },
{ "name": "debugdisplay", "value": "1" },
{ "name": "debugstringids", "value": "0" }
]
},
{ "step": "createCategory", "name": "Demo eXeLearning" },
{
"step": "createCourse",
"fullname": "Demo eXeLearning · ejemplo de uso",
"shortname": "EXEDEMO",
"category": "Demo eXeLearning",
"summary": "Curso demo con una actividad mod_exelearning y un alumno matriculado."
},
{
"step": "createUser",
"username": "{{TEACHER_USER}}",
"password": "{{TEACHER_PASS}}",
"email": "teacher_demo@example.test",
"firstname": "Profesor",
"lastname": "Demo"
},
{
"step": "createUser",
"username": "alumno1",
"password": "{{STUDENT_PASS}}",
"email": "alumno1@example.test",
"firstname": "Alumno",
"lastname": "Uno"
},
{
"step": "enrolUser",
"username": "{{ADMIN_USER}}",
"course": "EXEDEMO",
"role": "editingteacher"
},
{
"step": "enrolUser",
"username": "{{TEACHER_USER}}",
"course": "EXEDEMO",
"role": "editingteacher"
},
{
"step": "enrolUser",
"username": "alumno1",
"course": "EXEDEMO",
"role": "student"
},
{
"step": "createSection",
"course": "EXEDEMO",
"name": "Actividades evaluables"
},
{
"step": "addModule",
"module": "exelearning",
"course": "EXEDEMO",
"section": 1,
"name": "Actividad evaluable (demo)",
"intro": "Cuestionario demo con dos iDevices calificables (trueorfalse + guess).",
"revision": 1,
"display": 1,
"completion": 2,
"completionusegrade": 1,
"completionpassgrade": 0,
"completiongradeitemnumber": 1,
"files": [
{
"filearea": "package",
"itemid": 0,
"filename": "actividad-evaluable.elpx",
"data": {
"url": "https://raw.githubusercontent.com/{{REPO}}/{{REF}}/research/fixtures/elpx/actividad-evaluable.elpx"
}
}
]
},
{
"step": "runPhpCode",
"comment": "addModule skips exelearning_add_instance; force extract + grade sync (view.php self-heal). runPhpCode = raw PHP CLI, so require config.php first.",
"code": "define('CLI_SCRIPT', true); foreach (['/www/moodle/config.php', getcwd().'/config.php', '/var/www/html/config.php'] as $c) { if (is_file($c)) { require($c); break; } } global $DB, $CFG; require_once($CFG->dirroot.'/mod/exelearning/lib.php'); $fs = get_file_storage(); foreach ($DB->get_records('exelearning') as $exe) { $cm = get_coursemodule_from_instance('exelearning', $exe->id); if (!$cm) { continue; } $ctx = context_module::instance($cm->id); if (exelearning_get_stored_package($ctx->id) === null) { continue; } if (!$fs->get_file($ctx->id, 'mod_exelearning', 'content', (int)$exe->revision, '/', 'index.html')) { exelearning_extract_stored_package($ctx->id, (int)$exe->revision); } if (!$DB->record_exists_select('exelearning_grade_item', 'exelearningid = ? AND deleted = 0 AND itemnumber > 0', [$exe->id])) { exelearning_sync_grade_items($exe->id, $ctx->id); } }"
},
{
"step": "addModule",
"module": "scorm",
"course": "EXEDEMO",
"section": 1,
"name": "Actividad SCORM evaluable (demo)",
"intro": "Paquete SCORM 1.2 de ejemplo exportado desde eXeLearning.",
"gradepass": 50,
"completion": 2,
"completionusegrade": 1,
"completionpassgrade": 1,
"files": [
{
"filearea": "package",
"itemid": 0,
"filename": "actividad-evaluable_scorm.zip",
"data": {
"url": "https://raw.githubusercontent.com/{{REPO}}/{{REF}}/research/fixtures/scorm/actividad-evaluable_scorm.zip"
}
}
]
},
{
"step": "runPhpCode",
"comment": "addModule leaves SCORM without scoes (scorm_get_toc crashes); repoint reference + scorm_parse(). runPhpCode = raw PHP CLI, so require config.php first.",
"code": "define('CLI_SCRIPT', true); foreach (['/www/moodle/config.php', getcwd().'/config.php', '/var/www/html/config.php'] as $c) { if (is_file($c)) { require($c); break; } } global $DB, $CFG; require_once($CFG->dirroot.'/mod/scorm/lib.php'); require_once($CFG->dirroot.'/mod/scorm/locallib.php'); $fs = get_file_storage(); foreach ($DB->get_records('scorm', ['scormtype' => 'local']) as $scorm) { if ($DB->record_exists('scorm_scoes', ['scorm' => $scorm->id])) { continue; } $cm = get_coursemodule_from_instance('scorm', $scorm->id); if (!$cm) { continue; } $ctx = context_module::instance($cm->id); $files = $fs->get_area_files($ctx->id, 'mod_scorm', 'package', 0, 'sortorder, itemid, filepath, filename', false); $pkg = reset($files); if (!$pkg) { continue; } if ($scorm->reference !== $pkg->get_filename()) { $DB->set_field('scorm', 'reference', $pkg->get_filename(), ['id' => $scorm->id]); $scorm = $DB->get_record('scorm', ['id' => $scorm->id]); } scorm_parse($scorm, true); }"
},
{
"step": "addModule",
"module": "h5pactivity",
"course": "EXEDEMO",
"section": 1,
"name": "Actividad H5P evaluable (demo)",
"intro": "Conjunto de preguntas H5P de ejemplo.",
"timecreated": 1748476800,
"gradepass": 50,
"completion": 2,
"completionusegrade": 1,
"completionpassgrade": 1,
"files": [
{
"filearea": "package",
"itemid": 0,
"filename": "question-set-demo.h5p",
"data": {
"url": "https://raw.githubusercontent.com/{{REPO}}/{{REF}}/research/fixtures/h5p/question-set-demo.h5p"
}
}
]
},
{ "step": "setLandingPage", "path": "/course/view.php?id=2" }
]
}