moodle quiz starts an attempt, saves answers and submits it, the same way the quiz pages do in a browser. It is in beta: a Moodle update can break it. It is only available from the terminal, never through the MCP server.
Answers you send are your own submission under your institution’s rules. Use moodle quiz only where the quiz allows it, and check the attempt in a browser before you finish.
Take a quiz
quiz start takes a quiz id, URL or UNIT TASK phrase. It continues an attempt already in progress instead of starting a new one, and shows the first page with the attempt and quiz ids the other commands need.
quiz show shows one page: its questions, options and the answers saved so far.
quiz answer saves one answer by question number as shown on the page: option letters (b, or a,c for several), answer text, --from FILE for a long text answer, or --value once per field for a question with several fields.
quiz finish submits the attempt for grading. Moodle does not allow undoing this.
Before anything changes
- Before
quiz start asks you to confirm, it names the time limit and how many attempts are left. The timer starts at once and does not pause.
- A quiz that moves forward only refuses an earlier page, and
quiz show --page asks before opening the next page, because that locks the current one.
- Every write shows the beta and academic-integrity notice and asks for a yes. In a script, pass
--yes; --dry-run shows the plan.
- A quiz with an access password asks for it at the terminal, without echoing it and without storing it. Scripts pass
--password.
What it cannot do
- A quiz that requires the Safe Exam Browser cannot be taken here, because Moodle checks the browser itself.
- Question types without a plain choice or text input are shown, but must be answered in a browser.
Review a finished attempt
moodle attempt lists each question with your response, plus the mark, correct answer and feedback wherever the site shows them. See moodle attempt.