recess-cli 3.37.0 → 3.38.0

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.
@@ -459,6 +459,7 @@ const STAFF_COMMANDS = new Set([
459
459
  "math-curricula unlink",
460
460
  "reading-checks passages list",
461
461
  "reading-checks passages set-text",
462
+ "reading-checks passages set-pdf",
462
463
  "students mastery",
463
464
  "apps link",
464
465
  "apps links",
@@ -58,6 +58,37 @@ export async function runReadingChecksCommand(context) {
58
58
  body,
59
59
  })));
60
60
  }
61
- throw new CliError("invalid_arguments", "Use reading-checks passages list|set-text.");
61
+ if (group === "passages" && verb === "set-pdf") {
62
+ const passageId = positional(parsed, 3, "passage ID");
63
+ const file = flagString(parsed, "file");
64
+ const clear = hasFlag(parsed, "clear");
65
+ if (Boolean(file) === clear) {
66
+ throw new CliError("invalid_arguments", "Pass exactly one of --file <path> or --clear.");
67
+ }
68
+ if (file && !/\.pdf$/i.test(file)) {
69
+ throw new CliError("invalid_arguments", `${file} isn't a .pdf file.`);
70
+ }
71
+ const body = {
72
+ base64: file
73
+ ? (await fs.readFile(path.resolve(file))).toString("base64")
74
+ : null,
75
+ };
76
+ return writeCommand(parsed, {
77
+ action: file
78
+ ? "set the book pages a kid sees for a reading-check passage"
79
+ : "drop a reading-check passage's book pages",
80
+ target: { passageId, file: file ?? null },
81
+ request: { pdf: file ? path.basename(file) : null },
82
+ details: {
83
+ consequence: file
84
+ ? "Checks on this passage show these pages and score the read against the text on them."
85
+ : "Kids see the page text instead of the book pages.",
86
+ },
87
+ }, async () => unwrap(await api.client.PUT("/reading-checks/passages/{passageId}/pdf", {
88
+ params: { path: { passageId } },
89
+ body,
90
+ })));
91
+ }
92
+ throw new CliError("invalid_arguments", "Use reading-checks passages list|set-text|set-pdf.");
62
93
  }
63
94
  //# sourceMappingURL=reading-checks.js.map
package/dist/help.js CHANGED
@@ -735,6 +735,7 @@ Usage:
735
735
  recess [--json] math-curricula unlink <curriculum> <template-id> [--confirm]
736
736
  recess [--json] reading-checks passages list
737
737
  recess [--json] reading-checks passages set-text <passage-id> (--file <path> | --clear) [--confirm]
738
+ recess [--json] reading-checks passages set-pdf <passage-id> (--file <path.pdf> | --clear) [--confirm]
738
739
  recess [--json] challenge-of-the-week list [--past N] [--ahead N]
739
740
  recess [--json] challenge-of-the-week show <week>
740
741
  recess [--json] challenge-of-the-week queue <template> --week <week> [--note TEXT] [--confirm]
@@ -1683,6 +1684,7 @@ export const COMMAND_SUMMARIES = {
1683
1684
  "math-curricula unlink": "Unlink a goal template from a math curriculum.",
1684
1685
  "reading-checks passages list": "Each reading-check passage, its stage, and whether its page text is set.",
1685
1686
  "reading-checks passages set-text": "Set the page a kid reads aloud for a passage, from a text, Word (.docx) or PDF file (scans are OCR'd); --clear goes back to reading from the book.",
1687
+ "reading-checks passages set-pdf": "Show kids the book pages themselves from a PDF (up to 5 pages); the text on them is saved for scoring. --clear drops the pages and keeps the text.",
1686
1688
  "challenge-of-the-week list": "List Challenge of the Week picks: past, this week, upcoming, and the bench.",
1687
1689
  "challenge-of-the-week show": "Read one week's Challenge of the Week pick and note.",
1688
1690
  "challenge-of-the-week queue": "Queue a challenge for an empty week, with an optional note for kids.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recess-cli",
3
- "version": "3.37.0",
3
+ "version": "3.38.0",
4
4
  "description": "Safe Recess administration and family AI tools from the command line.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {