moodle-cli 0.9.1 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -141,6 +141,20 @@ the site's submission statement when one is required, and a file that is too lar
141
141
  the wrong type is refused before anything is uploaded. Assignments without drafts submit
142
142
  on save; the receipt reports what the site did.
143
143
 
144
+ ### Take a quiz (beta)
145
+
146
+ `moodle quiz` starts an attempt, saves answers and submits it, replaying the forms a browser posts. It is beta: a Moodle update can break it, and it is deliberately CLI-only, never offered over MCP.
147
+
148
+ ```bash
149
+ moodle quiz start UNIT "Practice quiz" # or a quiz id or URL; resumes an attempt in progress
150
+ moodle quiz show <attempt> <quiz> --page 2
151
+ moodle quiz answer <attempt> <quiz> 1 b # option letter, or "a,c" for several
152
+ moodle quiz answer <attempt> <quiz> 3 --from essay.md
153
+ moodle quiz finish <attempt> <quiz> # "Submit all and finish"; Moodle does not allow undoing this
154
+ ```
155
+
156
+ Every write shows the beta and academic-integrity notice and asks for a yes; a pipe must pass `--yes`, and `--dry-run` shows the plan. Answers you send are your own submission under your institution's rules: use it only where the quiz allows it, and check the attempt in a browser before you finish. A quiz with an access password asks for it at the terminal (not echoed, never stored); scripts pass `--password`. 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.
157
+
144
158
  ### Remote MCP for web AI
145
159
 
146
160
  A private remote MCP server lets a supported web AI client use Moodle when it cannot run the local CLI. You need a Cloudflare account.
@@ -159,11 +173,12 @@ The remote server is read-only. The local server (`moodle mcp serve`) also offer
159
173
  ### Update
160
174
 
161
175
  ```bash
162
- npm install -g moodle-cli@latest
163
- bun add --global moodle-cli@latest
176
+ moodle update
164
177
  ```
165
178
 
166
- Standalone binaries print the latest GitHub Release URL instead of modifying themselves.
179
+ `moodle update` upgrades the package with whichever installer put it there (npm, bun, or the standalone binary replacing itself), then runs `moodle mcp deploy` when a managed Worker exists and is behind the new release. `moodle update --check` only reports versions.
180
+
181
+ The CLI checks npm once a day in the background and prints a one-line notice on stderr when a newer release exists. A deployed Worker performs the same daily check and tells connected MCP clients through the server instructions, because the Worker ships inside the package and only redeploys from your machine. Set `MOODLE_NO_UPDATE_CHECK=1` to disable the check; it is already off under `CI`.
167
182
 
168
183
  ## For developers and agents
169
184
 
package/SKILL.md CHANGED
@@ -6,7 +6,7 @@ description: Read Moodle units, deadlines, grades, announcements and files; subm
6
6
  # Moodle CLI
7
7
 
8
8
  Reads Moodle; only `submit` writes. UNIT is a site code/name, id or URL; SECTION is a number or name.
9
- Never assume code patterns or ask for ids. `moodle units` shows the site's vocabulary.
9
+ Never assume code patterns or ask for ids; `moodle units` shows the vocabulary.
10
10
 
11
11
  | Intent | Run |
12
12
  | --- | --- |
@@ -16,6 +16,7 @@ Never assume code patterns or ask for ids. `moodle units` shows the site's vocab
16
16
  | a unit or section | moodle UNIT [SECTION] |
17
17
  | find slides or a task | moodle find "QUERY" [UNIT] |
18
18
  | submission or item detail | moodle UNIT "TASK" |
19
+ | a quiz attempt | moodle attempt ID |
19
20
  | my grades | moodle grades [UNIT] |
20
21
  | announcements | moodle news [UNIT] |
21
22
  | forum post text | moodle forums search "QUERY" --unit UNIT |
@@ -24,7 +25,7 @@ Never assume code patterns or ask for ids. `moodle units` shows the site's vocab
24
25
 
25
26
  Pipes emit compact JSON; `--json` forces it, `--pretty` indents it.
26
27
  Ambiguity returns `candidates`: pick or refine, never guess.
27
- Lists report `total`; narrow or page when more exist. Quote ISO dates with offsets.
28
+ Lists report `total`; narrow or page when more exist. Quote ISO dates.
28
29
  Never expose cookies or tokens. Download or submit only when asked; dry-run submit first. `--final` cannot be undone.
29
30
  Sign-in trouble: `moodle doctor`; remote expiry: `moodle mcp login`.
30
31
  Exact syntax: `moodle commands --json` or [reference](references/command-reference.md).