A Moodle local plugin that exposes quiz group override management via Web Services (REST API). This fills a gap in Moodle core, which provides no built-in web service for creating, reading, or deleting quiz group overrides programmatically.
Moodle core allows managing quiz group overrides through the UI (Quiz → Quiz administration → Group overrides), but provides no web service API for it. This makes it impossible to automate exam scheduling workflows — such as:
This plugin solves that by exposing three simple, well-scoped web service functions.
| Function | Description |
|---|---|
local_examoverride_create_group_override |
Create or update a group override for a quiz (upsert: if an override already exists for the same quiz+group, it updates instead of duplicating) |
local_examoverride_delete_group_override |
Delete an existing group override |
local_examoverride_get_group_overrides |
Read all group overrides for a quiz |
timeopen — Quiz open timestamptimeclose — Quiz close timestamptimelimit — Time limit in secondspassword — Quiz access passwordattempts — Number of allowed attempts (0 = unlimited)mod/quiz:manageoverrides capability in the relevant quiz contextphp admin/cli/upgrade.php via CLIcd /path/to/moodle/local
git clone https://github.com/gas-cloud/moodle.git examoverride
Then visit your Moodle site as admin, or run:
php admin/cli/upgrade.php
examoverridelocal_examoverride_create_group_overridelocal_examoverride_delete_group_overridelocal_examoverride_get_group_overridesmod/quiz:manageoverrides capability (Manager role at system level, or a custom role with this capability)Creates a new group override, or updates it if one already exists for the same quiz+group combination.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
quizid |
int | Yes | Quiz instance ID |
groupid |
int | Yes | Moodle group ID (must belong to the same course as the quiz) |
timeopen |
int | No | Unix timestamp for quiz open time. 0 = don’t override |
timeclose |
int | No | Unix timestamp for quiz close time. 0 = don’t override |
timelimit |
int | No | Time limit in seconds. -1 = don’t override |
password |
string | No | Quiz password. Empty string = don’t override |
attempts |
int | No | Number of attempts allowed. 0 = unlimited, -1 = don’t override |
Example request:
wsfunction=local_examoverride_create_group_override
&quizid=136
&groupid=2471
&timeopen=1720410600
&timeclose=1720415100
&timelimit=4500
&password=482
&attempts=1
Response:
{
"status": true,
"overrideid": 1087,
"action": "created"
}
Deletes an existing group override.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
quizid |
int | Yes | Quiz instance ID |
groupid |
int | Yes | Moodle group ID |
Response:
{
"status": true,
"msg": "Override berhasil dihapus."
}
Reads all group overrides for a given quiz.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
quizid |
int | Yes | Quiz instance ID |
Response:
{
"status": true,
"overrides": [
{
"overrideid": 1087,
"groupid": 2471,
"groupname": "1|Senin|1-2 (07.30 s/d 08.45 WIB)",
"timeopen": 1720410600,
"timeclose": 1720415100,
"timelimit": 4500,
"attempts": 1,
"password": "482"
}
]
}
mod/quiz:manageoverrides capabilityThis plugin is licensed under the GNU GPL v3, the same license as Moodle itself.
Developed for the exam supervision system at Universitas Muhammadiyah Malang (UMM), Indonesia.