Skip to content

v0.9.6

Choose a tag to compare

@github-actions github-actions released this 27 Sep 10:37
· 238 commits to main since this release
v0.9.6
0255cc5

Moodle CLI 0.9.6

moodle dl now saves whole sections and assignment files and lets you browse a unit at the terminal. This release also closes every place where the CLI could take an irreversible step without telling you first, starting with moodle submit handing an assignment in for grading when it had been asked only to save a draft.

Highlights

  • moodle submit without --final never submits for grading. If an assignment has no draft stage, or its pages do not show whether it has one, the command refuses before uploading anything.
  • moodle dl downloads what the course page offers: one activity, a whole section including its child sections, an assignment's attached files, or a pluginfile.php link. At a terminal it browses unit → section → item.
  • Quizzes that move forward only are safe to step through. The CLI never opens the next page without asking you first, because opening it locks the current page for good.
  • quiz start tells you the time limit and attempts left before the timer starts.
  • mcp revoke asks first, and client config files are written atomically.

moodle submit no longer submits a draft for grading

Some assignments have no draft stage: in Moodle, saving the files is itself the submission for grading, and that cannot be undone. Earlier versions knew this could happen and saved anyway, so moodle submit ID files --accept-statement --yes without --final handed the work in.

Moodle never states the setting, so the CLI works it out from the pages:

  • The edit form carries the submission statement only when there is no draft stage.
  • A "Submit assignment" button appears only when there is one.
  • A submission that is already submitted but can still be edited means there is none.

Without --final, a save goes ahead only when Moodle shows a draft stage. "No draft stage" and "can't tell" are both refused before anything is uploaded. If Moodle submits on save anyway, the command fails loudly instead of reporting a draft. The plan and receipt carry draft_stage, and the confirmation says plainly whether saving submits.

Two more checks:

  • --replace with no files is refused rather than emptying the submission.
  • In a group submission the plan names the group, because its files are shared: an upload or --replace changes every member's submission. When every member has to submit, the receipt lists who Moodle is still awaiting instead of reporting a failure.

Download sections, assignment files and links

moodle download (alias dl) accepts an activity, a section (moodle dl "UNIT week 5" or a section URL) or a single pluginfile.php link. A section download includes the child sections the page shows inside it. An assignment download saves its attached files, such as the brief and datasets.

With no argument at a terminal, it walks unit → section → item the way the course page does: type to filter, Escape to go back a step. Short forms such as a2 or w7 match. Repeated section names are shown with their parent, as in Week 5 › Own time.

Files already on disk are skipped, so rerunning after Ctrl+C or a dropped connection fetches only what is missing; --force downloads everything again. The same document linked twice is saved once, and two different files with one name get a (2) suffix. Ctrl+C stops at once and leaves no partial files, and a file without a name is skipped instead of failing the whole batch. --dry-run writes nothing. The run ends with a one-line receipt.

A slow download is no longer cut off at 30 seconds. Instead, a connection that sends nothing for a while times out, and each redirect gets its own limit.

Quizzes

A quiz set to sequential navigation locks each page once you open the next one. moodle quiz now reads that setting from the attempt page and handles it:

  • quiz show --page refuses a locked page or a skip, and asks before opening the next page.
  • quiz answer refuses questions that are not on the current page.
  • The next-step hints never suggest going back.

Before quiz start asks for confirmation, it says whether it will continue an attempt or start a new one. It also shows the attempt number and how many are allowed, the grading method, and the time limit: the timer starts at once and does not pause. --dry-run shows the same plan without starting anything.

Units, due dates and tables

  • Sections nest under the parents the site reports, and the MCP unit tool shows week sections with their children.
  • A current section is shown only when the site marks one; no more guesses.
  • Due dates count calendar days, so something due in 90 minutes reads "today", not "tomorrow". Quiz openings are labelled as openings.
  • moodle UNIT "assignment 2" finds the assignment instead of a section, and an exact item name wins over a partial match.
  • Unit dates are shown in the site's timezone.
  • moodle grades shows due dates in their own column.
  • Tables use the full terminal width for long names.
  • The MCP file tool follows shortcut activities and fetches any activity that holds a single file.

MCP deployment safety

  • moodle mcp revoke and revoke --all ask first. Scripts pass --yes, and --dry-run shows what would be revoked.
  • The --rotate-token help text now says what really happens: the old token and every connected OAuth client, including claude.ai, stop working at once. It used to promise an overlap window that did not exist.
  • Client config files, config.yaml and the renewal job are written atomically, so a crash or full disk cannot leave a half-written file. A symlinked config keeps its link.
  • A failed client registration no longer overwrites a file the client itself has changed since. Claude Code rewrites ~/.claude.json constantly, so restoring the old copy could throw away its changes.
  • One unreadable client config no longer blocks the rest. Every client is tried, and the ones that failed are named together.

Upgrade

npm install -g moodle-cli@0.9.6

Or:

moodle update

moodle update also redeploys a managed MCP Worker, which is needed for its unit and file changes. No configuration or cache format changes.