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.
- package/dist/command-schema.js +1 -0
- package/dist/commands/reading-checks.js +32 -1
- package/dist/help.js +2 -0
- package/package.json +1 -1
package/dist/command-schema.js
CHANGED
|
@@ -58,6 +58,37 @@ export async function runReadingChecksCommand(context) {
|
|
|
58
58
|
body,
|
|
59
59
|
})));
|
|
60
60
|
}
|
|
61
|
-
|
|
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.",
|