Create quiz
moodle_create_quizCreates a new quiz in a specified Moodle course section, hidden from students by default unless visibility is enabled, and returns the new course module ID.
Instructions
Creates a new quiz in a course section. New quizzes are hidden by default (visible=false) unless visible=true is passed. Returns the new cmid.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"courseid": "<courseid>",
"section": "<section>",
"name": "<name>"
},
"name": "moodle_create_quiz"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| intro | No | Description (HTML) | |
| review | No | Review options: what students see during the attempt, immediately after, later while open, after closing | |
| subnet | No | ||
| section | Yes | Section number (see moodle_list_sections) | |
| visible | No | Show the quiz to students | |
| attempts | No | Attempts allowed, 0 = unlimited | |
| courseid | Yes | ||
| timeopen | No | "YYYY-MM-DD HH:MM" in the Moodle user timezone; null = no opening date | |
| gradepass | No | Grade to pass | |
| navmethod | No | ||
| timeclose | No | "YYYY-MM-DD HH:MM"; null = no closing date | |
| raw_fields | No | Advanced: raw modedit form fields to override (null = unset/uncheck) | |
| grademethod | No | ||
| quizpassword | No | ||
| attemptonlast | No | ||
| decimalpoints | No | ||
| repaginatenow | No | ||
| shuffleanswers | No | ||
| browsersecurity | No | "-" none, "securewindow" full screen popup | |
| overduehandling | No | ||
| showdescription | No | ||
| canredoquestions | No | ||
| questionsperpage | No | New page every N questions, 0 = all on one page | |
| timelimit_minutes | No | 0/null = no time limit | |
| preferredbehaviour | No | deferredfeedback | interactive | immediatefeedback | adaptive | adaptivenopenalty | deferredcbm | immediatecbm |