@astl/core 0.2.2 → 0.3.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/CHANGELOG.md +26 -0
- package/dist/authoring.d.ts +8 -4
- package/dist/authoring.d.ts.map +1 -1
- package/dist/checker.d.ts +5 -0
- package/dist/checker.d.ts.map +1 -1
- package/dist/checker.js.map +1 -1
- package/dist/checks.d.ts +74 -0
- package/dist/checks.d.ts.map +1 -0
- package/dist/checks.js +139 -0
- package/dist/checks.js.map +1 -0
- package/dist/engine.d.ts +2 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/issues.d.ts +10 -0
- package/dist/issues.d.ts.map +1 -1
- package/dist/issues.js +10 -0
- package/dist/issues.js.map +1 -1
- package/package.json +1 -1
- package/src/authoring.ts +8 -4
- package/src/checker.ts +5 -0
- package/src/checks.ts +174 -0
- package/src/engine.ts +2 -0
- package/src/index.ts +12 -0
- package/src/issues.ts +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @astl/core
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c85c3b9: A Check for several questions. `<astl-check id for label>` gives the questions it names (`for`: graded questions of its page, block ones too; without it, the inline questions of the run of text right above it) one Check, where practice checks one question at a time: one request for all of them, counted once, and they have no Check of their own; their hints, feedback and "Why?" stay theirs. Its row says how they came out ("2 of 3 correct"), read out, and the focus stays on its button. In a test, and where practice checks everything at once, it does not show. The questions of a run of text that no Check element has share an automatic Check after the last of them when there are two or more (three sentences with a gap each: one Check after the third); a question alone keeps its own. A heading starts a new run.
|
|
8
|
+
|
|
9
|
+
The protocol takes `CheckRequest.elements` (and `GradeOptions.elements`), at most one of `page`, `element` and `elements`, with the problem codes it had. Upgrade the server with the player or before it: a server before 0.3 grades the whole exercise for such a check, and a 0.3 player then takes only the results of the check's own questions. The engine warns with `CHECK_EMPTY`, `CHECK_TARGET_UNKNOWN`, `CHECK_TARGET_NOT_GRADED`, `CHECK_TARGET_OTHER_PAGE` and `CHECK_TARGET_TWICE`, and writes each check into the view with its questions resolved as opaque ids.
|
|
10
|
+
|
|
11
|
+
In the editor, "Elements" has "Check button": it goes after the block with the cursor with its `for` filled, drawn as the button with a tag ("3 questions") that marks its questions while selected, and a block of its own. Its card ticks the page's questions and sets the button's text; a question it checks says so in its card and goes there. An automatic Check shows where the player puts it, with "Make it a button". For hosts: `insertCheck(authoring, adapter)` for an insert menu of their own, `OutlinePage.checks` and `automatic`, `OutlineComponent.check`, block kind `check`, `InspectorModel.checkedBy`, the field `check-targets`, and from core `CHECK_TAG`, `checkFor`, `checkParts`, `planChecks`, `checkNodes` and `isCheckable`. Grading cases of the conformance fixtures take `elements`, and two gap fixtures show checks of several questions. The insert menu's Explanation icon is a ring again, not a black disc.
|
|
12
|
+
|
|
13
|
+
## 0.2.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 4498fa4: The card keeps its element while the author writes in it. Typing into an empty help field (the explanation, a feedback text, a new hint) with the cursor in the question's prompt closed the card at the first letter, and the rest of the word went into the page; the cross on a hint or on the explanation, and a table's "Add" and "Remove" in the card, closed it the same way. The TipTap adapter's `replaceElement` replaced the whole content of the block whenever a child came or went, which threw the cursor out of the block. It now changes only what changed (attributes in place, the children both versions share patched in place, only a child added or taken away replaced), so the cursor stays in the prompt, the card on its element and the field keeps its focus and caret, through undo and redo too. `EditorAdapter.replaceElement` says so: a cursor inside the element stays inside it.
|
|
18
|
+
|
|
19
|
+
The editor's focus ring is 2px wide and 1px out (`--astl-editor-focus-width`, `--astl-editor-focus-offset` on `<astl-editor>`), on all its controls (the toolbar and its menus, the card's fields and buttons, the sheet and the authoring controls on it), so it never reaches a field or a text beside it (the card's fields are 4px apart; the player's 3px ring, 2px out, reached 5px). A frame's tag draws its ring around its pill. The students' ring in the player is unchanged.
|
|
20
|
+
|
|
21
|
+
A hint's "Cost" label keeps its word whole on a phone and its select gives way, ending in an ellipsis: "Koszt" (Polish) broke into "Kosz" and "t" at 390 px. The card's other text still breaks anywhere when it must, so an author's long word or address never widens the card.
|
|
22
|
+
|
|
23
|
+
A table in the card (a crossword's words, say) shows a select's whole value: "Poziomo" was cut to "Pozior", and "Across" too at 1280 px. A select's cell starts from its natural width and a number's from 3.5rem, and a cell is never narrower than its label's longest word: when they don't fit, cells go on to the next line.
|
|
24
|
+
|
|
25
|
+
Every compact control is recognisable as a button at rest, without hover: an add action ("Add option", "Add prompt", "Add title", "Add a hint", a list's or a table's "Add", a picture field's "Add a zone") has a plus and the accent colour; any other text button ("Check this page", "Join with page 1", "Delete page", "Remove title", "Make it free", "Remove", the style targets, a picture's buttons) a 1px line in the outline colour, 3:1 at least in every theme; "In the text" also the selects' chevron, as it opens the style form; an icon alone keeps only its icon. "Add a hint" read as a label before. A page box's "Move to question" select has the same 1px line, height and corners (it had a 2px line), and a picture field's remove buttons are as wide as their words.
|
|
26
|
+
|
|
27
|
+
In a narrow page column a page head's button that wraps stays at the end, under the others, instead of under the page number.
|
|
28
|
+
|
|
3
29
|
## 0.2.2
|
|
4
30
|
|
|
5
31
|
No changes in this release.
|
package/dist/authoring.d.ts
CHANGED
|
@@ -178,7 +178,7 @@ export type InspectorField = {
|
|
|
178
178
|
readonly label: string;
|
|
179
179
|
readonly help?: string;
|
|
180
180
|
};
|
|
181
|
-
/** The component the cursor is in, by source id. */
|
|
181
|
+
/** The component the cursor is in, by source id; a selected Check element is one too (`tag`: `astl-check`). */
|
|
182
182
|
export interface EditorSelection {
|
|
183
183
|
readonly id: string;
|
|
184
184
|
readonly tag: string;
|
|
@@ -211,8 +211,9 @@ export interface EditorFormatState {
|
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
213
213
|
* A block by its place. A page's content is a list of blocks: each block component (`display: 'block'`) directly on
|
|
214
|
-
* the page is one block, and the content between two of them (paragraphs,
|
|
215
|
-
* inline components in their text) is one text block. The authoring kit's
|
|
214
|
+
* the page is one block, and so is each Check element (`astl-check`); the content between two of them (paragraphs,
|
|
215
|
+
* headings, lists, quotes, pictures, with the inline components in their text) is one text block. The authoring kit's
|
|
216
|
+
* outline lists the same blocks
|
|
216
217
|
* (`OutlinePage.blocks`). The content format has no blocks: they are a way to show and move a page's content. A
|
|
217
218
|
* layout is not a block either: the blocks in its columns are on the page's list, in reading order, and a column's
|
|
218
219
|
* content divides as a page's does.
|
|
@@ -355,7 +356,10 @@ export interface EditorAdapter {
|
|
|
355
356
|
insert(html: string, options?: EditorInsertOptions): void;
|
|
356
357
|
/** Source HTML of one component element, or null when the id is not in the document. */
|
|
357
358
|
getElement(id: string): string | null;
|
|
358
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* Replaces one component element in place (inspector edits); the rest of the document is untouched. A cursor inside
|
|
361
|
+
* the element stays inside it: the inspector follows the element at the cursor while it writes.
|
|
362
|
+
*/
|
|
359
363
|
replaceElement(id: string, html: string): void;
|
|
360
364
|
/** The component at the cursor, or null. */
|
|
361
365
|
getSelection(): EditorSelection | null;
|
package/dist/authoring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC9C,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EA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,IAAI,CAAC,IAAI,OAAO,CAAC;IACjB,gGAAgG;IAChG,IAAI,CAAC,IAAI,OAAO,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,CAAC,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;IACvE;;;;OAIG;IACH,WAAW,CAAC,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAC/C;;;OAGG;IACH,SAAS,CAAC,IAAI,gBAAgB,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH,cAAc,CAAC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAClD;;;OAGG;IACH,YAAY,CAAC,IAAI,MAAM,CAAC;IACxB;;;OAGG;IACH,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,oHAAoH;IACpH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CAC/B"}
|
package/dist/checker.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export interface CheckRequest {
|
|
|
16
16
|
* `maxChecks` like any check. Never together with `page`.
|
|
17
17
|
*/
|
|
18
18
|
readonly element?: string;
|
|
19
|
+
/**
|
|
20
|
+
* View element ids: grade those interactions at once (a Check element's questions, `CHECK_TAG`), under a policy
|
|
21
|
+
* with `checkScope: 'interaction'`. One check against `maxChecks`. Never together with `page` or `element`.
|
|
22
|
+
*/
|
|
23
|
+
readonly elements?: readonly string[];
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Help that comes with a result when the policy shows it (the engine's `helpShown`), for what was graded: absent when there is
|
package/dist/checker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,M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Q,CAAC,OAAO,EAAE,cAAc,CAAC;IAEjC,YAAY,OAAO,EAAE,cAAc,EAIlC;CACF"}
|
package/dist/checker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checker.js","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checker.js","sourceRoot":"","sources":["../src/checker.ts"],"names":[],"mappings":"AAsFA,8FAA8F;AAC9F,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,OAAO,CAAiB;IAEjC,YAAY,OAAuB;QACjC,KAAK,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
|
package/dist/checks.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ComponentManifest } from './manifest.js';
|
|
2
|
+
export declare const CHECK_TAG = "astl-check";
|
|
3
|
+
export declare const CHECK_FOR_ATTRIBUTE = "for";
|
|
4
|
+
export declare const CHECK_LABEL_ATTRIBUTE = "label";
|
|
5
|
+
/** The attributes of a check, in sources and views (with `lang` and `dir`); in a view `id` and `for` are opaque. */
|
|
6
|
+
export declare const CHECK_ATTRIBUTES: readonly string[];
|
|
7
|
+
/** A graded question: what a check can check (a graded type with something to answer). */
|
|
8
|
+
export declare function isCheckable(manifest: ComponentManifest): boolean;
|
|
9
|
+
/** The ids a `for` names, in order, each once. */
|
|
10
|
+
export declare function checkFor(value: string | null | undefined): string[];
|
|
11
|
+
/**
|
|
12
|
+
* One part of a page for the check rule, in reading order. A run of text is what lies between two block components
|
|
13
|
+
* (paragraphs, lists, quotes, pictures), up to the next heading: its graded inline questions, in order. A heading
|
|
14
|
+
* starts a new run (it usually starts a new exercise). A block component is one part, a check another; an edge (where
|
|
15
|
+
* a layout or one of its columns starts or ends) ends a run.
|
|
16
|
+
*/
|
|
17
|
+
export type CheckPart = {
|
|
18
|
+
readonly kind: 'text';
|
|
19
|
+
readonly questions: readonly string[];
|
|
20
|
+
} | {
|
|
21
|
+
readonly kind: 'block';
|
|
22
|
+
readonly question: string | null;
|
|
23
|
+
} | {
|
|
24
|
+
readonly kind: 'check';
|
|
25
|
+
readonly for: readonly string[] | null;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: 'edge';
|
|
28
|
+
};
|
|
29
|
+
/** What `planChecks` makes of a page's parts: the questions of each check, in the order of the checks. */
|
|
30
|
+
export interface CheckPlan {
|
|
31
|
+
/**
|
|
32
|
+
* Each check's questions: those its `for` names (callers pass only graded questions of the page), else the graded
|
|
33
|
+
* inline questions of the run of text right above it; without the ones an earlier check has.
|
|
34
|
+
*/
|
|
35
|
+
readonly targets: readonly (readonly string[])[];
|
|
36
|
+
/** The questions each check names that an earlier check has already (`CHECK_TARGET_TWICE`). */
|
|
37
|
+
readonly twice: readonly (readonly string[])[];
|
|
38
|
+
/**
|
|
39
|
+
* The graded inline questions of each run of text that no check has, for the runs that hold any: where the player
|
|
40
|
+
* puts an automatic Check, after the last of them.
|
|
41
|
+
*/
|
|
42
|
+
readonly uncovered: readonly (readonly string[])[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The one rule for which questions a check takes, shared by the engine (what a view's checks hold), the authoring
|
|
46
|
+
* kit (its outline, the editor's tags and cards) and the player (where it checks several questions at once).
|
|
47
|
+
*/
|
|
48
|
+
export declare function planChecks(parts: readonly CheckPart[]): CheckPlan;
|
|
49
|
+
/** How `checkParts` reads a tree: the engine's and the authoring kit's (core AST), or the player's (DOM). */
|
|
50
|
+
export interface CheckTree<T> {
|
|
51
|
+
/** An element's tag, or null for text. */
|
|
52
|
+
tag(node: T): string | null;
|
|
53
|
+
children(node: T): readonly T[];
|
|
54
|
+
/** A component: its source id (view id in a view), whether it is a graded question, whether it is a block. */
|
|
55
|
+
component(node: T): {
|
|
56
|
+
readonly id: string | null;
|
|
57
|
+
readonly graded: boolean;
|
|
58
|
+
readonly block: boolean;
|
|
59
|
+
} | null;
|
|
60
|
+
/** A check's `for`: the ids it names, or null without the attribute. */
|
|
61
|
+
checkFor(node: T): readonly string[] | null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A page's content (or a document's without pages) as the parts of the check rule, in reading order: a layout's
|
|
65
|
+
* columns in turn, each between edges. What lies between block components, checks, headings and edges is one run of
|
|
66
|
+
* text: its graded inline questions (none inside a component); a heading opens the next one.
|
|
67
|
+
*/
|
|
68
|
+
export declare function checkParts<T>(content: readonly T[], tree: CheckTree<T>): CheckPart[];
|
|
69
|
+
/**
|
|
70
|
+
* The Check elements of a page's content (or a document's without pages) in the order `checkParts` meets them, so the
|
|
71
|
+
* nth is the one `planChecks` gives the nth targets: directly in the content, and in its layouts' columns.
|
|
72
|
+
*/
|
|
73
|
+
export declare function checkNodes<T>(content: readonly T[], tree: Pick<CheckTree<T>, 'tag' | 'children'>): T[];
|
|
74
|
+
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,eAAO,MAAM,SAAS,eAAe,CAAC;AACtC,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AACzC,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAC7C,oHAAoH;AACpH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAuD,CAAC;AAEtG,0FAA0F;AAC1F,wBAAgB,WAAW,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAEhE;AAED,kDAAkD;AAClD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAEnE;AAED;;;;;GAKG;AACH,MAAM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CAAA;KAAE,GAAG,IAAI,CAAC;IAC5F,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CAC7C;AAKD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,CA4CpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAYtG"}
|
package/dist/checks.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Check for several questions (content format 1, additive): `<astl-check id for label>`, a block directly on a page
|
|
3
|
+
* or in a column. Where practice checks one question at a time (`checkScope: 'interaction'`) it checks its questions
|
|
4
|
+
* at once, as one check (`CheckRequest.elements`), and they have no Check of their own; elsewhere (a test, practice
|
|
5
|
+
* that checks everything at once) it does not show, and a page's own Check checks the page as before.
|
|
6
|
+
*
|
|
7
|
+
* `for` names graded questions of its page by source id, space separated, block ones included. Without it the check
|
|
8
|
+
* takes the graded inline questions of the run of text right above it (`planChecks`), as the editor fills `for` when
|
|
9
|
+
* it inserts one. `label` is its button's text (default "Check"). A question belongs to one check at most: a later check
|
|
10
|
+
* that names it again does not take it.
|
|
11
|
+
*/
|
|
12
|
+
import { COLUMN_TAG, COLUMNS_TAG } from './content.js';
|
|
13
|
+
export const CHECK_TAG = 'astl-check';
|
|
14
|
+
export const CHECK_FOR_ATTRIBUTE = 'for';
|
|
15
|
+
export const CHECK_LABEL_ATTRIBUTE = 'label';
|
|
16
|
+
/** The attributes of a check, in sources and views (with `lang` and `dir`); in a view `id` and `for` are opaque. */
|
|
17
|
+
export const CHECK_ATTRIBUTES = ['id', CHECK_FOR_ATTRIBUTE, CHECK_LABEL_ATTRIBUTE];
|
|
18
|
+
/** A graded question: what a check can check (a graded type with something to answer). */
|
|
19
|
+
export function isCheckable(manifest) {
|
|
20
|
+
return manifest.graded && manifest.slotKinds.length > 0;
|
|
21
|
+
}
|
|
22
|
+
/** The ids a `for` names, in order, each once. */
|
|
23
|
+
export function checkFor(value) {
|
|
24
|
+
return [...new Set((value ?? '').split(/\s+/u).filter((id) => id !== ''))];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The one rule for which questions a check takes, shared by the engine (what a view's checks hold), the authoring
|
|
28
|
+
* kit (its outline, the editor's tags and cards) and the player (where it checks several questions at once).
|
|
29
|
+
*/
|
|
30
|
+
export function planChecks(parts) {
|
|
31
|
+
const targets = [];
|
|
32
|
+
const twice = [];
|
|
33
|
+
const taken = new Set();
|
|
34
|
+
parts.forEach((part, index) => {
|
|
35
|
+
if (part.kind !== 'check')
|
|
36
|
+
return;
|
|
37
|
+
const above = parts[index - 1];
|
|
38
|
+
const named = part.for ?? (above?.kind === 'text' ? above.questions : []);
|
|
39
|
+
const own = [];
|
|
40
|
+
const again = [];
|
|
41
|
+
for (const id of new Set(named)) {
|
|
42
|
+
if (taken.has(id))
|
|
43
|
+
again.push(id);
|
|
44
|
+
else {
|
|
45
|
+
taken.add(id);
|
|
46
|
+
own.push(id);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
targets.push(own);
|
|
50
|
+
twice.push(again);
|
|
51
|
+
});
|
|
52
|
+
const uncovered = parts.flatMap((part) => {
|
|
53
|
+
if (part.kind !== 'text')
|
|
54
|
+
return [];
|
|
55
|
+
const left = part.questions.filter((id) => !taken.has(id));
|
|
56
|
+
return left.length === 0 ? [] : [left];
|
|
57
|
+
});
|
|
58
|
+
return { targets, twice, uncovered };
|
|
59
|
+
}
|
|
60
|
+
/** Headings: each starts a new run of text for the check rule. */
|
|
61
|
+
const HEADINGS = new Set(['h2', 'h3', 'h4']);
|
|
62
|
+
/**
|
|
63
|
+
* A page's content (or a document's without pages) as the parts of the check rule, in reading order: a layout's
|
|
64
|
+
* columns in turn, each between edges. What lies between block components, checks, headings and edges is one run of
|
|
65
|
+
* text: its graded inline questions (none inside a component); a heading opens the next one.
|
|
66
|
+
*/
|
|
67
|
+
export function checkParts(content, tree) {
|
|
68
|
+
const parts = [];
|
|
69
|
+
let run = null;
|
|
70
|
+
const flush = () => {
|
|
71
|
+
if (run !== null)
|
|
72
|
+
parts.push({ kind: 'text', questions: run });
|
|
73
|
+
run = null;
|
|
74
|
+
};
|
|
75
|
+
const inline = (node, into) => {
|
|
76
|
+
const component = tree.component(node);
|
|
77
|
+
if (component !== null) {
|
|
78
|
+
if (component.graded && component.id !== null)
|
|
79
|
+
into.push(component.id);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
for (const child of tree.children(node))
|
|
83
|
+
inline(child, into);
|
|
84
|
+
};
|
|
85
|
+
const walk = (nodes) => {
|
|
86
|
+
for (const node of nodes) {
|
|
87
|
+
const tag = tree.tag(node);
|
|
88
|
+
const component = tree.component(node);
|
|
89
|
+
if (tag === CHECK_TAG) {
|
|
90
|
+
flush();
|
|
91
|
+
parts.push({ kind: 'check', for: tree.checkFor(node) });
|
|
92
|
+
}
|
|
93
|
+
else if (component?.block) {
|
|
94
|
+
flush();
|
|
95
|
+
parts.push({ kind: 'block', question: component.graded ? component.id : null });
|
|
96
|
+
}
|
|
97
|
+
else if (tag === COLUMNS_TAG) {
|
|
98
|
+
flush();
|
|
99
|
+
parts.push({ kind: 'edge' });
|
|
100
|
+
for (const column of tree.children(node)) {
|
|
101
|
+
if (tree.tag(column) !== COLUMN_TAG)
|
|
102
|
+
continue;
|
|
103
|
+
walk(tree.children(column));
|
|
104
|
+
flush();
|
|
105
|
+
parts.push({ kind: 'edge' });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
if (tag !== null && HEADINGS.has(tag))
|
|
110
|
+
flush();
|
|
111
|
+
run ??= [];
|
|
112
|
+
inline(node, run);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
walk(content);
|
|
117
|
+
flush();
|
|
118
|
+
return parts;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The Check elements of a page's content (or a document's without pages) in the order `checkParts` meets them, so the
|
|
122
|
+
* nth is the one `planChecks` gives the nth targets: directly in the content, and in its layouts' columns.
|
|
123
|
+
*/
|
|
124
|
+
export function checkNodes(content, tree) {
|
|
125
|
+
const out = [];
|
|
126
|
+
for (const node of content) {
|
|
127
|
+
const tag = tree.tag(node);
|
|
128
|
+
if (tag === CHECK_TAG)
|
|
129
|
+
out.push(node);
|
|
130
|
+
else if (tag === COLUMNS_TAG) {
|
|
131
|
+
for (const column of tree.children(node)) {
|
|
132
|
+
if (tree.tag(column) === COLUMN_TAG)
|
|
133
|
+
out.push(...checkNodes(tree.children(column), tree));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAC7C,oHAAoH;AACpH,MAAM,CAAC,MAAM,gBAAgB,GAAsB,CAAC,IAAI,EAAE,mBAAmB,EAAE,qBAAqB,CAAC,CAAC;AAEtG,0FAA0F;AAC1F,MAAM,UAAU,WAAW,CAAC,QAA2B;IACrD,OAAO,QAAQ,CAAC,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
package/dist/engine.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export interface GradeOptions {
|
|
|
63
63
|
readonly page?: string;
|
|
64
64
|
/** Grade one view element only (a check of one interaction): the groups of its slots. */
|
|
65
65
|
readonly element?: string;
|
|
66
|
+
/** Grade these view elements only (a Check element's questions): the groups of their slots. */
|
|
67
|
+
readonly elements?: readonly string[];
|
|
66
68
|
/**
|
|
67
69
|
* Hints used, by view element id or view page id (the first n of its hints). A group loses the costs of the hints
|
|
68
70
|
* used of its element and of its page, each a fraction of the group's maximum, never below 0. Its verdict stays.
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAC1D,OAAO,CAAC;A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CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;IAC3D,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAChD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export { childElements, element, isElement, text, textContent } from './ast.js';
|
|
|
5
5
|
export type { EditorAdapter, EditorBlockPlace, EditorDescriptor, EditorFormat, EditorFormatState, EditorInsertOptions, EditorLayoutEdit, EditorLayoutShape, EditorLayoutState, EditorSelection, EditorStyleChanges, EditorStyleRule, EditorStyleState, EditorStyles, EditorStyleTarget, EditorStyleTargetKind, EditorTemplate, EditorWrap, InspectorField, } from './authoring.js';
|
|
6
6
|
export type { Checker, CheckRequest, CheckResponse, HintRequest, HintResponse, ResultHelp, SubmitRequest, SubmitResponse, } from './checker.js';
|
|
7
7
|
export { CheckerError } from './checker.js';
|
|
8
|
+
export type { CheckPart, CheckPlan, CheckTree } from './checks.js';
|
|
9
|
+
export { CHECK_ATTRIBUTES, CHECK_FOR_ATTRIBUTE, CHECK_LABEL_ATTRIBUTE, CHECK_TAG, checkFor, checkNodes, checkParts, isCheckable, planChecks, } from './checks.js';
|
|
8
10
|
export type { AnswerKey, Compilation, KeyHelp, KeyHint, KeySlot, Metadata, PageMetadata, } from './compiled.js';
|
|
9
11
|
export { isAnswerKey, KEY_FORMAT_VERSION } from './compiled.js';
|
|
10
12
|
export { BLOCK_TAGS, CAPTION_TAG, CLASS_ATTRIBUTE, COLUMN_TAG, COLUMNS_TAG, CONTENT_ATTRIBUTES, DEFAULT_DOC_KIND, DOC_ATTRIBUTES, DOC_KINDS, type DocKind, FIGURE_TAG, INERT_STYLE, INLINE_TAGS, inertStyles, isSafeUrl, MAX_ATTRIBUTES_PER_ELEMENT, MAX_COLUMNS, MAX_NESTING_DEPTH, MIN_COLUMNS, PAGE_ATTRIBUTES, PAGE_CHECK_ATTRIBUTE, REMOVED_WITH_CONTENT, STYLE_TAG, strictUrlPolicy, TAG_ATTRIBUTES, URL_ATTRIBUTES, } from './content.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAChF,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,OAAO,EACP,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,UAAU,E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,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { FLAG_SELECTED, fitsAnswer, isAnswers, MAX_ANSWER_COUNT, MAX_ANSWER_LENGTH, MAX_OPEN_ANSWER_LENGTH, maxAnswerLength, OPEN_SLOT_KIND, } from './answers.js';
|
|
2
2
|
export { childElements, element, isElement, text, textContent } from './ast.js';
|
|
3
3
|
export { CheckerError } from './checker.js';
|
|
4
|
+
export { CHECK_ATTRIBUTES, CHECK_FOR_ATTRIBUTE, CHECK_LABEL_ATTRIBUTE, CHECK_TAG, checkFor, checkNodes, checkParts, isCheckable, planChecks, } from './checks.js';
|
|
4
5
|
export { isAnswerKey, KEY_FORMAT_VERSION } from './compiled.js';
|
|
5
6
|
export { BLOCK_TAGS, CAPTION_TAG, CLASS_ATTRIBUTE, COLUMN_TAG, COLUMNS_TAG, CONTENT_ATTRIBUTES, DEFAULT_DOC_KIND, DOC_ATTRIBUTES, DOC_KINDS, FIGURE_TAG, INERT_STYLE, INLINE_TAGS, inertStyles, isSafeUrl, MAX_ATTRIBUTES_PER_ELEMENT, MAX_COLUMNS, MAX_NESTING_DEPTH, MIN_COLUMNS, PAGE_ATTRIBUTES, PAGE_CHECK_ATTRIBUTE, REMOVED_WITH_CONTENT, STYLE_TAG, strictUrlPolicy, TAG_ATTRIBUTES, URL_ATTRIBUTES, } from './content.js';
|
|
6
7
|
export { BUILT_IN_PREFIX, DOC_TAG, directionOf, ELEMENT_TAG_PATTERN, FORMAT_VERSION, isOpaqueId, isSourceId, LANGUAGE_TAG_PATTERN, MAX_SOURCE_LENGTH, OPAQUE_ID_PATTERN, PAGE_TAG, SOURCE_ID_PATTERN, SUPPORTED_FORMATS, } from './format.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAgChF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAgChF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,SAAS,EAET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,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/issues.d.ts
CHANGED
|
@@ -94,6 +94,16 @@ export declare const EngineIssue: {
|
|
|
94
94
|
readonly EXPLANATION_DUPLICATE: 'EXPLANATION_DUPLICATE';
|
|
95
95
|
/** A layout of the wrong shape: `<astl-columns>` directly on a page, holding 2 to 4 `<astl-column>`, not nested. */
|
|
96
96
|
readonly COLUMNS_INVALID: 'COLUMNS_INVALID';
|
|
97
|
+
/** A Check element (`astl-check`) with no questions to check: it does not show (warning). */
|
|
98
|
+
readonly CHECK_EMPTY: 'CHECK_EMPTY';
|
|
99
|
+
/** A check names an id that is no element of the document: it is left out (warning). */
|
|
100
|
+
readonly CHECK_TARGET_UNKNOWN: 'CHECK_TARGET_UNKNOWN';
|
|
101
|
+
/** A check names an element that is not a graded question: it is left out (warning). */
|
|
102
|
+
readonly CHECK_TARGET_NOT_GRADED: 'CHECK_TARGET_NOT_GRADED';
|
|
103
|
+
/** A check names a question on another page: it is left out (warning). */
|
|
104
|
+
readonly CHECK_TARGET_OTHER_PAGE: 'CHECK_TARGET_OTHER_PAGE';
|
|
105
|
+
/** A check names a question an earlier check has: the earlier one keeps it (warning). */
|
|
106
|
+
readonly CHECK_TARGET_TWICE: 'CHECK_TARGET_TWICE';
|
|
97
107
|
};
|
|
98
108
|
export type EngineIssueCode = (typeof EngineIssue)[keyof typeof EngineIssue];
|
|
99
109
|
export declare function hasErrors(issues: readonly Issue[]): boolean;
|
package/dist/issues.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issues.d.ts","sourceRoot":"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B,wFAAwF;aACxF,oBAAoB,EAAE,sBAAsB;IAC5C,wFAAwF;aACxF,uBAAuB,EAAE,yBAAyB;IAClD,0EAA0E;aAC1E,uBAAuB,EAAE,yBAAyB;IAClD,yFAAyF;aACzF,kBAAkB,EAAE,oBAAoB;CAChC,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAE7E,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,OAAO,CAE3D"}
|
package/dist/issues.js
CHANGED
|
@@ -69,6 +69,16 @@ export const EngineIssue = {
|
|
|
69
69
|
EXPLANATION_DUPLICATE: 'EXPLANATION_DUPLICATE',
|
|
70
70
|
/** A layout of the wrong shape: `<astl-columns>` directly on a page, holding 2 to 4 `<astl-column>`, not nested. */
|
|
71
71
|
COLUMNS_INVALID: 'COLUMNS_INVALID',
|
|
72
|
+
/** A Check element (`astl-check`) with no questions to check: it does not show (warning). */
|
|
73
|
+
CHECK_EMPTY: 'CHECK_EMPTY',
|
|
74
|
+
/** A check names an id that is no element of the document: it is left out (warning). */
|
|
75
|
+
CHECK_TARGET_UNKNOWN: 'CHECK_TARGET_UNKNOWN',
|
|
76
|
+
/** A check names an element that is not a graded question: it is left out (warning). */
|
|
77
|
+
CHECK_TARGET_NOT_GRADED: 'CHECK_TARGET_NOT_GRADED',
|
|
78
|
+
/** A check names a question on another page: it is left out (warning). */
|
|
79
|
+
CHECK_TARGET_OTHER_PAGE: 'CHECK_TARGET_OTHER_PAGE',
|
|
80
|
+
/** A check names a question an earlier check has: the earlier one keeps it (warning). */
|
|
81
|
+
CHECK_TARGET_TWICE: 'CHECK_TARGET_TWICE',
|
|
72
82
|
};
|
|
73
83
|
export function hasErrors(issues) {
|
|
74
84
|
return issues.some((i) => i.severity === 'error');
|
package/dist/issues.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issues.js","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AAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC;AACpD,CAAC"}
|
package/package.json
CHANGED
package/src/authoring.ts
CHANGED
|
@@ -180,7 +180,7 @@ export type InspectorField =
|
|
|
180
180
|
readonly help?: string;
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
/** The component the cursor is in, by source id. */
|
|
183
|
+
/** The component the cursor is in, by source id; a selected Check element is one too (`tag`: `astl-check`). */
|
|
184
184
|
export interface EditorSelection {
|
|
185
185
|
readonly id: string;
|
|
186
186
|
readonly tag: string;
|
|
@@ -225,8 +225,9 @@ export interface EditorFormatState {
|
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
227
|
* A block by its place. A page's content is a list of blocks: each block component (`display: 'block'`) directly on
|
|
228
|
-
* the page is one block, and the content between two of them (paragraphs,
|
|
229
|
-
* inline components in their text) is one text block. The authoring kit's
|
|
228
|
+
* the page is one block, and so is each Check element (`astl-check`); the content between two of them (paragraphs,
|
|
229
|
+
* headings, lists, quotes, pictures, with the inline components in their text) is one text block. The authoring kit's
|
|
230
|
+
* outline lists the same blocks
|
|
230
231
|
* (`OutlinePage.blocks`). The content format has no blocks: they are a way to show and move a page's content. A
|
|
231
232
|
* layout is not a block either: the blocks in its columns are on the page's list, in reading order, and a column's
|
|
232
233
|
* content divides as a page's does.
|
|
@@ -380,7 +381,10 @@ export interface EditorAdapter {
|
|
|
380
381
|
insert(html: string, options?: EditorInsertOptions): void;
|
|
381
382
|
/** Source HTML of one component element, or null when the id is not in the document. */
|
|
382
383
|
getElement(id: string): string | null;
|
|
383
|
-
/**
|
|
384
|
+
/**
|
|
385
|
+
* Replaces one component element in place (inspector edits); the rest of the document is untouched. A cursor inside
|
|
386
|
+
* the element stays inside it: the inspector follows the element at the cursor while it writes.
|
|
387
|
+
*/
|
|
384
388
|
replaceElement(id: string, html: string): void;
|
|
385
389
|
/** The component at the cursor, or null. */
|
|
386
390
|
getSelection(): EditorSelection | null;
|
package/src/checker.ts
CHANGED
|
@@ -17,6 +17,11 @@ export interface CheckRequest {
|
|
|
17
17
|
* `maxChecks` like any check. Never together with `page`.
|
|
18
18
|
*/
|
|
19
19
|
readonly element?: string;
|
|
20
|
+
/**
|
|
21
|
+
* View element ids: grade those interactions at once (a Check element's questions, `CHECK_TAG`), under a policy
|
|
22
|
+
* with `checkScope: 'interaction'`. One check against `maxChecks`. Never together with `page` or `element`.
|
|
23
|
+
*/
|
|
24
|
+
readonly elements?: readonly string[];
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
/**
|
package/src/checks.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Check for several questions (content format 1, additive): `<astl-check id for label>`, a block directly on a page
|
|
3
|
+
* or in a column. Where practice checks one question at a time (`checkScope: 'interaction'`) it checks its questions
|
|
4
|
+
* at once, as one check (`CheckRequest.elements`), and they have no Check of their own; elsewhere (a test, practice
|
|
5
|
+
* that checks everything at once) it does not show, and a page's own Check checks the page as before.
|
|
6
|
+
*
|
|
7
|
+
* `for` names graded questions of its page by source id, space separated, block ones included. Without it the check
|
|
8
|
+
* takes the graded inline questions of the run of text right above it (`planChecks`), as the editor fills `for` when
|
|
9
|
+
* it inserts one. `label` is its button's text (default "Check"). A question belongs to one check at most: a later check
|
|
10
|
+
* that names it again does not take it.
|
|
11
|
+
*/
|
|
12
|
+
import { COLUMN_TAG, COLUMNS_TAG } from './content.js';
|
|
13
|
+
import type { ComponentManifest } from './manifest.js';
|
|
14
|
+
|
|
15
|
+
export const CHECK_TAG = 'astl-check';
|
|
16
|
+
export const CHECK_FOR_ATTRIBUTE = 'for';
|
|
17
|
+
export const CHECK_LABEL_ATTRIBUTE = 'label';
|
|
18
|
+
/** The attributes of a check, in sources and views (with `lang` and `dir`); in a view `id` and `for` are opaque. */
|
|
19
|
+
export const CHECK_ATTRIBUTES: readonly string[] = ['id', CHECK_FOR_ATTRIBUTE, CHECK_LABEL_ATTRIBUTE];
|
|
20
|
+
|
|
21
|
+
/** A graded question: what a check can check (a graded type with something to answer). */
|
|
22
|
+
export function isCheckable(manifest: ComponentManifest): boolean {
|
|
23
|
+
return manifest.graded && manifest.slotKinds.length > 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** The ids a `for` names, in order, each once. */
|
|
27
|
+
export function checkFor(value: string | null | undefined): string[] {
|
|
28
|
+
return [...new Set((value ?? '').split(/\s+/u).filter((id) => id !== ''))];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* One part of a page for the check rule, in reading order. A run of text is what lies between two block components
|
|
33
|
+
* (paragraphs, lists, quotes, pictures), up to the next heading: its graded inline questions, in order. A heading
|
|
34
|
+
* starts a new run (it usually starts a new exercise). A block component is one part, a check another; an edge (where
|
|
35
|
+
* a layout or one of its columns starts or ends) ends a run.
|
|
36
|
+
*/
|
|
37
|
+
export type CheckPart =
|
|
38
|
+
| { readonly kind: 'text'; readonly questions: readonly string[] }
|
|
39
|
+
| { readonly kind: 'block'; readonly question: string | null }
|
|
40
|
+
| { readonly kind: 'check'; readonly for: readonly string[] | null }
|
|
41
|
+
| { readonly kind: 'edge' };
|
|
42
|
+
|
|
43
|
+
/** What `planChecks` makes of a page's parts: the questions of each check, in the order of the checks. */
|
|
44
|
+
export interface CheckPlan {
|
|
45
|
+
/**
|
|
46
|
+
* Each check's questions: those its `for` names (callers pass only graded questions of the page), else the graded
|
|
47
|
+
* inline questions of the run of text right above it; without the ones an earlier check has.
|
|
48
|
+
*/
|
|
49
|
+
readonly targets: readonly (readonly string[])[];
|
|
50
|
+
/** The questions each check names that an earlier check has already (`CHECK_TARGET_TWICE`). */
|
|
51
|
+
readonly twice: readonly (readonly string[])[];
|
|
52
|
+
/**
|
|
53
|
+
* The graded inline questions of each run of text that no check has, for the runs that hold any: where the player
|
|
54
|
+
* puts an automatic Check, after the last of them.
|
|
55
|
+
*/
|
|
56
|
+
readonly uncovered: readonly (readonly string[])[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The one rule for which questions a check takes, shared by the engine (what a view's checks hold), the authoring
|
|
61
|
+
* kit (its outline, the editor's tags and cards) and the player (where it checks several questions at once).
|
|
62
|
+
*/
|
|
63
|
+
export function planChecks(parts: readonly CheckPart[]): CheckPlan {
|
|
64
|
+
const targets: string[][] = [];
|
|
65
|
+
const twice: string[][] = [];
|
|
66
|
+
const taken = new Set<string>();
|
|
67
|
+
parts.forEach((part, index) => {
|
|
68
|
+
if (part.kind !== 'check') return;
|
|
69
|
+
const above = parts[index - 1];
|
|
70
|
+
const named = part.for ?? (above?.kind === 'text' ? above.questions : []);
|
|
71
|
+
const own: string[] = [];
|
|
72
|
+
const again: string[] = [];
|
|
73
|
+
for (const id of new Set(named)) {
|
|
74
|
+
if (taken.has(id)) again.push(id);
|
|
75
|
+
else {
|
|
76
|
+
taken.add(id);
|
|
77
|
+
own.push(id);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
targets.push(own);
|
|
81
|
+
twice.push(again);
|
|
82
|
+
});
|
|
83
|
+
const uncovered = parts.flatMap((part) => {
|
|
84
|
+
if (part.kind !== 'text') return [];
|
|
85
|
+
const left = part.questions.filter((id) => !taken.has(id));
|
|
86
|
+
return left.length === 0 ? [] : [left];
|
|
87
|
+
});
|
|
88
|
+
return { targets, twice, uncovered };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** How `checkParts` reads a tree: the engine's and the authoring kit's (core AST), or the player's (DOM). */
|
|
92
|
+
export interface CheckTree<T> {
|
|
93
|
+
/** An element's tag, or null for text. */
|
|
94
|
+
tag(node: T): string | null;
|
|
95
|
+
children(node: T): readonly T[];
|
|
96
|
+
/** A component: its source id (view id in a view), whether it is a graded question, whether it is a block. */
|
|
97
|
+
component(
|
|
98
|
+
node: T,
|
|
99
|
+
): { readonly id: string | null; readonly graded: boolean; readonly block: boolean } | null;
|
|
100
|
+
/** A check's `for`: the ids it names, or null without the attribute. */
|
|
101
|
+
checkFor(node: T): readonly string[] | null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Headings: each starts a new run of text for the check rule. */
|
|
105
|
+
const HEADINGS: ReadonlySet<string> = new Set(['h2', 'h3', 'h4']);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* A page's content (or a document's without pages) as the parts of the check rule, in reading order: a layout's
|
|
109
|
+
* columns in turn, each between edges. What lies between block components, checks, headings and edges is one run of
|
|
110
|
+
* text: its graded inline questions (none inside a component); a heading opens the next one.
|
|
111
|
+
*/
|
|
112
|
+
export function checkParts<T>(content: readonly T[], tree: CheckTree<T>): CheckPart[] {
|
|
113
|
+
const parts: CheckPart[] = [];
|
|
114
|
+
let run: string[] | null = null;
|
|
115
|
+
const flush = () => {
|
|
116
|
+
if (run !== null) parts.push({ kind: 'text', questions: run });
|
|
117
|
+
run = null;
|
|
118
|
+
};
|
|
119
|
+
const inline = (node: T, into: string[]): void => {
|
|
120
|
+
const component = tree.component(node);
|
|
121
|
+
if (component !== null) {
|
|
122
|
+
if (component.graded && component.id !== null) into.push(component.id);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
for (const child of tree.children(node)) inline(child, into);
|
|
126
|
+
};
|
|
127
|
+
const walk = (nodes: readonly T[]): void => {
|
|
128
|
+
for (const node of nodes) {
|
|
129
|
+
const tag = tree.tag(node);
|
|
130
|
+
const component = tree.component(node);
|
|
131
|
+
if (tag === CHECK_TAG) {
|
|
132
|
+
flush();
|
|
133
|
+
parts.push({ kind: 'check', for: tree.checkFor(node) });
|
|
134
|
+
} else if (component?.block) {
|
|
135
|
+
flush();
|
|
136
|
+
parts.push({ kind: 'block', question: component.graded ? component.id : null });
|
|
137
|
+
} else if (tag === COLUMNS_TAG) {
|
|
138
|
+
flush();
|
|
139
|
+
parts.push({ kind: 'edge' });
|
|
140
|
+
for (const column of tree.children(node)) {
|
|
141
|
+
if (tree.tag(column) !== COLUMN_TAG) continue;
|
|
142
|
+
walk(tree.children(column));
|
|
143
|
+
flush();
|
|
144
|
+
parts.push({ kind: 'edge' });
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
if (tag !== null && HEADINGS.has(tag)) flush();
|
|
148
|
+
run ??= [];
|
|
149
|
+
inline(node, run);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
walk(content);
|
|
154
|
+
flush();
|
|
155
|
+
return parts;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The Check elements of a page's content (or a document's without pages) in the order `checkParts` meets them, so the
|
|
160
|
+
* nth is the one `planChecks` gives the nth targets: directly in the content, and in its layouts' columns.
|
|
161
|
+
*/
|
|
162
|
+
export function checkNodes<T>(content: readonly T[], tree: Pick<CheckTree<T>, 'tag' | 'children'>): T[] {
|
|
163
|
+
const out: T[] = [];
|
|
164
|
+
for (const node of content) {
|
|
165
|
+
const tag = tree.tag(node);
|
|
166
|
+
if (tag === CHECK_TAG) out.push(node);
|
|
167
|
+
else if (tag === COLUMNS_TAG) {
|
|
168
|
+
for (const column of tree.children(node)) {
|
|
169
|
+
if (tree.tag(column) === COLUMN_TAG) out.push(...checkNodes(tree.children(column), tree));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return out;
|
|
174
|
+
}
|
package/src/engine.ts
CHANGED
|
@@ -68,6 +68,8 @@ export interface GradeOptions {
|
|
|
68
68
|
readonly page?: string;
|
|
69
69
|
/** Grade one view element only (a check of one interaction): the groups of its slots. */
|
|
70
70
|
readonly element?: string;
|
|
71
|
+
/** Grade these view elements only (a Check element's questions): the groups of their slots. */
|
|
72
|
+
readonly elements?: readonly string[];
|
|
71
73
|
/**
|
|
72
74
|
* Hints used, by view element id or view page id (the first n of its hints). A group loses the costs of the hints
|
|
73
75
|
* used of its element and of its page, each a fraction of the group's maximum, never below 0. Its verdict stays.
|
package/src/index.ts
CHANGED
|
@@ -43,6 +43,18 @@ export type {
|
|
|
43
43
|
SubmitResponse,
|
|
44
44
|
} from './checker.js';
|
|
45
45
|
export { CheckerError } from './checker.js';
|
|
46
|
+
export type { CheckPart, CheckPlan, CheckTree } from './checks.js';
|
|
47
|
+
export {
|
|
48
|
+
CHECK_ATTRIBUTES,
|
|
49
|
+
CHECK_FOR_ATTRIBUTE,
|
|
50
|
+
CHECK_LABEL_ATTRIBUTE,
|
|
51
|
+
CHECK_TAG,
|
|
52
|
+
checkFor,
|
|
53
|
+
checkNodes,
|
|
54
|
+
checkParts,
|
|
55
|
+
isCheckable,
|
|
56
|
+
planChecks,
|
|
57
|
+
} from './checks.js';
|
|
46
58
|
export type {
|
|
47
59
|
AnswerKey,
|
|
48
60
|
Compilation,
|
package/src/issues.ts
CHANGED
|
@@ -100,6 +100,16 @@ export const EngineIssue = {
|
|
|
100
100
|
EXPLANATION_DUPLICATE: 'EXPLANATION_DUPLICATE',
|
|
101
101
|
/** A layout of the wrong shape: `<astl-columns>` directly on a page, holding 2 to 4 `<astl-column>`, not nested. */
|
|
102
102
|
COLUMNS_INVALID: 'COLUMNS_INVALID',
|
|
103
|
+
/** A Check element (`astl-check`) with no questions to check: it does not show (warning). */
|
|
104
|
+
CHECK_EMPTY: 'CHECK_EMPTY',
|
|
105
|
+
/** A check names an id that is no element of the document: it is left out (warning). */
|
|
106
|
+
CHECK_TARGET_UNKNOWN: 'CHECK_TARGET_UNKNOWN',
|
|
107
|
+
/** A check names an element that is not a graded question: it is left out (warning). */
|
|
108
|
+
CHECK_TARGET_NOT_GRADED: 'CHECK_TARGET_NOT_GRADED',
|
|
109
|
+
/** A check names a question on another page: it is left out (warning). */
|
|
110
|
+
CHECK_TARGET_OTHER_PAGE: 'CHECK_TARGET_OTHER_PAGE',
|
|
111
|
+
/** A check names a question an earlier check has: the earlier one keeps it (warning). */
|
|
112
|
+
CHECK_TARGET_TWICE: 'CHECK_TARGET_TWICE',
|
|
103
113
|
} as const;
|
|
104
114
|
|
|
105
115
|
export type EngineIssueCode = (typeof EngineIssue)[keyof typeof EngineIssue];
|