@astl/server 0.0.0 → 0.1.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 +23 -0
- package/LICENSE +202 -0
- package/README.md +42 -0
- package/dist/handler.d.ts +41 -0
- package/dist/handler.d.ts.map +1 -0
- package/dist/handler.js +290 -0
- package/dist/handler.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/store.d.ts +61 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +60 -0
- package/dist/store.js.map +1 -0
- package/package.json +42 -4
- package/src/handler.ts +340 -0
- package/src/index.ts +4 -0
- package/src/store.ts +124 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @astl/server
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6a4f220: The first release on npm, under the scope `@astl`: `@astl/astrolabe` with everything on by default, and the single packages it is built from, all at one version.
|
|
8
|
+
- 64af38f: Help for students. Three elements of the content format, inside a graded component or on a page: `<astl-hint cost>` (hints on request, one at a time, each costing a share of the points), `<astl-explanation>` (under "Why?" after a check) and `<astl-feedback when="correct|incorrect|partial|omitted">` (a text by the verdict). Compiling moves them into the key (`AnswerKey.help`); the view keeps only what is offered (`hints`, `explanation`, `feedback`). `AttemptPolicy` gets optional `hints`, `checkScope`, `feedback` and `explanations`, whose defaults by mode (`helpPolicy`, `PRACTICE_POLICY`, `TEST_POLICY`) keep old hosts working. The protocol gets `check({ answers, element })` for one interaction, `feedback` and `explanations` on responses, and `POST /hint` (`Checker.hint`, `hints_not_allowed`, `hints_exhausted`); grading takes `hintsUsed`. The server binding serves all of it and records hints with `AttemptStore.recordHint`. The player loads its help module only for views with help: "Hint (1/2)" with the cost said first, "Check" of one interaction, a feedback box by the verdict, "Why?", a page's help at its foot. The editor's card has "Help for students" (hints with cost and order, the explanation, the four feedback texts), "Elements" has "Hint", "Explanation" and "Feedback", the surface shows labelled boxes, and the preview plays them in practice. New issues: `HINT_COST_INVALID`, `FEEDBACK_WHEN_INVALID`, `FEEDBACK_DUPLICATE`, `EXPLANATION_DUPLICATE`, `HELP_UNGRADED`, `HELP_EMPTY`.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [402924c]
|
|
13
|
+
- Updated dependencies [97e412c]
|
|
14
|
+
- Updated dependencies [ec2a249]
|
|
15
|
+
- Updated dependencies [cfa6485]
|
|
16
|
+
- Updated dependencies [4611aeb]
|
|
17
|
+
- Updated dependencies [6a4f220]
|
|
18
|
+
- Updated dependencies [c500ae1]
|
|
19
|
+
- Updated dependencies [871b57a]
|
|
20
|
+
- Updated dependencies [3a4945c]
|
|
21
|
+
- Updated dependencies [64af38f]
|
|
22
|
+
- @astl/core@0.1.0
|
|
23
|
+
- @astl/engine@0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @astl/server
|
|
2
|
+
|
|
3
|
+
Fetch-API grading endpoint for Astrolabe (check and submit) that runs on Node, Deno, Bun and Workers.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @astl/server @astl/engine @astl/components @astl/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Use
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { builtInDefinitions } from '@astl/components/definitions';
|
|
15
|
+
import { PRACTICE_POLICY } from '@astl/core';
|
|
16
|
+
import { createEngine } from '@astl/engine';
|
|
17
|
+
import { createGradingHandler, createMemoryAttemptStore } from '@astl/server';
|
|
18
|
+
|
|
19
|
+
const engine = createEngine({ components: builtInDefinitions, secret: process.env.ASTL_SECRET! });
|
|
20
|
+
const attempts = createMemoryAttemptStore(); // your database in production (the AttemptStore interface)
|
|
21
|
+
const grading = createGradingHandler({ engine, attempts });
|
|
22
|
+
|
|
23
|
+
// For each student: an attempt with the private key from engine.compile and a policy.
|
|
24
|
+
const attempt = await attempts.create({ key: result.key, policy: PRACTICE_POLICY });
|
|
25
|
+
|
|
26
|
+
// In your router, after checking that the signed-in student owns the attempt:
|
|
27
|
+
// POST /api/attempts/:id/:action -> grading(request, { attemptId: id })
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`grading` takes a `Request` and returns a `Response`, so it fits anything that speaks Request to Response: Hono,
|
|
31
|
+
Workers, Deno, Bun.
|
|
32
|
+
|
|
33
|
+
## This package or @astl/astrolabe
|
|
34
|
+
|
|
35
|
+
`@astl/astrolabe/server` exports `createEngine` with every built-in component next to `createGradingHandler`. Pick
|
|
36
|
+
`@astl/server` to pair the endpoint with an engine you configure yourself.
|
|
37
|
+
|
|
38
|
+
Documentation: <https://astrolabe.starship.education/reference/server/>
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
Apache-2.0, see [LICENSE](https://github.com/starship1337/astrolabe/blob/main/LICENSE).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grading endpoint (protocol 1, apps/docs/src/content/docs/reference/protocol.md) on the standard Fetch API, so it
|
|
3
|
+
* runs unchanged on Node 22+, Deno, Bun, Cloudflare Workers and Hono. The rules mirror the engine's `localChecker`, so
|
|
4
|
+
* a player behaves the same against a server as with local grading.
|
|
5
|
+
*/
|
|
6
|
+
import { type Engine } from '@astl/core';
|
|
7
|
+
import type { AttemptStore } from './store.js';
|
|
8
|
+
export interface GradingHandlerOptions {
|
|
9
|
+
readonly engine: Engine;
|
|
10
|
+
readonly attempts: AttemptStore;
|
|
11
|
+
/** Clock in milliseconds, for deadlines and `submittedAt`. Default `Date.now`. */
|
|
12
|
+
readonly now?: () => number;
|
|
13
|
+
/**
|
|
14
|
+
* Called with every internal failure (a store that throws or returns an inconsistent record, a grading error), for
|
|
15
|
+
* logging. The response stays a generic `500 internal_error` either way. Default: nothing.
|
|
16
|
+
*/
|
|
17
|
+
readonly onError?: (error: unknown, request: Request) => void;
|
|
18
|
+
}
|
|
19
|
+
/** Which attempt a request is for, as the host resolved it after authorising the request. */
|
|
20
|
+
export interface GradingContext {
|
|
21
|
+
readonly attemptId: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Handles `POST {endpoint}/check`, `/submit` and `/hint`. The host passes the attempt: the handler reads only the
|
|
25
|
+
* action (the final path segment) from the URL, so no part of the URL can point it at another attempt.
|
|
26
|
+
*/
|
|
27
|
+
export type GradingHandler = (request: Request, context: GradingContext) => Promise<Response>;
|
|
28
|
+
/** Attempt ids the handler accepts; anything else is answered `404 not_found`. */
|
|
29
|
+
export declare const ATTEMPT_ID_PATTERN: RegExp;
|
|
30
|
+
/**
|
|
31
|
+
* A submit this late after the deadline still counts: the player hands in when its countdown ends, and that request
|
|
32
|
+
* needs a moment to arrive. Later submits are refused like any submit on a closed attempt.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DEADLINE_GRACE_MS = 30000;
|
|
35
|
+
/**
|
|
36
|
+
* Creates the grading endpoint. It answers only protocol-1 requests and never sends key data: check responses carry
|
|
37
|
+
* the GradeResult, hints go out one at a time when the policy offers them, feedback and explanations when the policy
|
|
38
|
+
* shows them (`helpShown`), and solutions with a submit only when the attempt's policy reveals answers.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createGradingHandler(options: GradingHandlerOptions): GradingHandler;
|
|
41
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKL,KAAK,MAAM,EAiBZ,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,kFAAkF;IAClF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/D;AAED,6FAA6F;AAC7F,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE9F,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,EAAE,MAAiC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAS,CAAC;AA4JxC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAqHnF"}
|
package/dist/handler.js
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The grading endpoint (protocol 1, apps/docs/src/content/docs/reference/protocol.md) on the standard Fetch API, so it
|
|
3
|
+
* runs unchanged on Node 22+, Deno, Bun, Cloudflare Workers and Hono. The rules mirror the engine's `localChecker`, so
|
|
4
|
+
* a player behaves the same against a server as with local grading.
|
|
5
|
+
*/
|
|
6
|
+
import { fitsAnswer, helpPolicy, isAnswerKey, isAnswers, isAttemptPolicy, JSON_MEDIA_TYPE, MAX_REQUEST_BYTES, PROBLEM_MEDIA_TYPE, ProblemCode, ProtocolPath, } from '@astl/core';
|
|
7
|
+
import { helpShown, hintCount, isGradedElement, nextHint, resultHelp } from '@astl/engine';
|
|
8
|
+
/** Attempt ids the handler accepts; anything else is answered `404 not_found`. */
|
|
9
|
+
export const ATTEMPT_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
|
|
10
|
+
/**
|
|
11
|
+
* A submit this late after the deadline still counts: the player hands in when its countdown ends, and that request
|
|
12
|
+
* needs a moment to arrive. Later submits are refused like any submit on a closed attempt.
|
|
13
|
+
*/
|
|
14
|
+
export const DEADLINE_GRACE_MS = 30_000;
|
|
15
|
+
/** Titles are for developers (RFC 9457); players show their own translated messages per `code`. */
|
|
16
|
+
const PROBLEMS = {
|
|
17
|
+
invalid_request: { status: 400, title: 'The body is not a valid grading request' },
|
|
18
|
+
unauthorized: { status: 401, title: 'The attempt could not be identified' },
|
|
19
|
+
check_not_allowed: { status: 403, title: 'Checking is not allowed in this attempt' },
|
|
20
|
+
checks_exhausted: { status: 403, title: 'No checks are left in this attempt' },
|
|
21
|
+
hints_not_allowed: { status: 403, title: 'Hints are not offered in this attempt' },
|
|
22
|
+
hints_exhausted: { status: 403, title: 'Every hint of this interaction or page is used' },
|
|
23
|
+
not_found: { status: 404, title: 'Unknown attempt, page or element' },
|
|
24
|
+
method_not_allowed: { status: 405, title: 'Only POST is allowed' },
|
|
25
|
+
attempt_closed: { status: 409, title: 'The attempt is already submitted' },
|
|
26
|
+
payload_too_large: { status: 413, title: 'The body is larger than 256 KiB' },
|
|
27
|
+
internal_error: { status: 500, title: 'Internal server error' },
|
|
28
|
+
};
|
|
29
|
+
const HEADERS = { 'cache-control': 'no-store' };
|
|
30
|
+
function json(body) {
|
|
31
|
+
return new Response(JSON.stringify(body), {
|
|
32
|
+
status: 200,
|
|
33
|
+
headers: { ...HEADERS, 'content-type': JSON_MEDIA_TYPE },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function problem(code, headers = {}) {
|
|
37
|
+
const { status, title } = PROBLEMS[code];
|
|
38
|
+
const body = { type: `urn:astrolabe:problem:${code}`, title, status, code };
|
|
39
|
+
return new Response(JSON.stringify(body), {
|
|
40
|
+
status,
|
|
41
|
+
headers: { ...HEADERS, ...headers, 'content-type': PROBLEM_MEDIA_TYPE },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** The final path segment when it is an action; null otherwise (a trailing slash included). */
|
|
45
|
+
function actionOf(url) {
|
|
46
|
+
const last = new URL(url).pathname.split('/').at(-1);
|
|
47
|
+
return last === ProtocolPath.check || last === ProtocolPath.submit || last === ProtocolPath.hint
|
|
48
|
+
? last
|
|
49
|
+
: null;
|
|
50
|
+
}
|
|
51
|
+
const usedOf = (record, id) => {
|
|
52
|
+
const used = record.hintsUsed;
|
|
53
|
+
return used !== undefined && Object.hasOwn(used, id) ? (used[id] ?? 0) : 0;
|
|
54
|
+
};
|
|
55
|
+
/** Hints used, what grading takes off: valid counts of a record (the store's own data, checked by `isRecord`). */
|
|
56
|
+
const isHintsUsed = (value) => typeof value === 'object' &&
|
|
57
|
+
value !== null &&
|
|
58
|
+
!Array.isArray(value) &&
|
|
59
|
+
Object.values(value).every((n) => Number.isInteger(n) && n >= 0);
|
|
60
|
+
/** A store record the handler can trust: it is the requested attempt, with a valid key, policy and counters. */
|
|
61
|
+
function isRecord(value, id) {
|
|
62
|
+
if (typeof value !== 'object' || value === null)
|
|
63
|
+
return false;
|
|
64
|
+
const r = value;
|
|
65
|
+
return (r.id === id &&
|
|
66
|
+
isAnswerKey(r.key) &&
|
|
67
|
+
isAttemptPolicy(r.policy) &&
|
|
68
|
+
Number.isInteger(r.checksUsed) &&
|
|
69
|
+
r.checksUsed >= 0 &&
|
|
70
|
+
typeof r.submitted === 'boolean' &&
|
|
71
|
+
(r.hintsUsed === undefined || isHintsUsed(r.hintsUsed)));
|
|
72
|
+
}
|
|
73
|
+
class TooLarge extends Error {
|
|
74
|
+
}
|
|
75
|
+
/** The body as text, read with a running size check: Content-Length can be missing or wrong. */
|
|
76
|
+
async function readBody(request) {
|
|
77
|
+
const declared = Number(request.headers.get('content-length') ?? '');
|
|
78
|
+
if (declared > MAX_REQUEST_BYTES)
|
|
79
|
+
throw new TooLarge();
|
|
80
|
+
if (request.body === null)
|
|
81
|
+
return '';
|
|
82
|
+
const reader = request.body.getReader();
|
|
83
|
+
const chunks = [];
|
|
84
|
+
let size = 0;
|
|
85
|
+
for (;;) {
|
|
86
|
+
const { done, value } = await reader.read();
|
|
87
|
+
if (done)
|
|
88
|
+
break;
|
|
89
|
+
size += value.byteLength;
|
|
90
|
+
if (size > MAX_REQUEST_BYTES) {
|
|
91
|
+
await reader.cancel().catch(() => undefined);
|
|
92
|
+
throw new TooLarge();
|
|
93
|
+
}
|
|
94
|
+
chunks.push(value);
|
|
95
|
+
}
|
|
96
|
+
const bytes = new Uint8Array(size);
|
|
97
|
+
let offset = 0;
|
|
98
|
+
for (const chunk of chunks) {
|
|
99
|
+
bytes.set(chunk, offset);
|
|
100
|
+
offset += chunk.byteLength;
|
|
101
|
+
}
|
|
102
|
+
// Fatal: invalid UTF-8 is a malformed request, not text to guess at.
|
|
103
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* CheckRequest, SubmitRequest or HintRequest from untrusted JSON; null when it does not match the schema (a check
|
|
107
|
+
* naming both a page and an element included).
|
|
108
|
+
*/
|
|
109
|
+
function parseRequest(action, value) {
|
|
110
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
111
|
+
return null;
|
|
112
|
+
const { answers, page, element } = value;
|
|
113
|
+
const optional = (v) => v === undefined || typeof v === 'string';
|
|
114
|
+
if (action === ProtocolPath.hint) {
|
|
115
|
+
return typeof element === 'string' ? { action, request: { element } } : null;
|
|
116
|
+
}
|
|
117
|
+
if (!isAnswers(answers))
|
|
118
|
+
return null;
|
|
119
|
+
if (action === ProtocolPath.submit)
|
|
120
|
+
return { action, answers };
|
|
121
|
+
if (!optional(page) || !optional(element) || (page !== undefined && element !== undefined))
|
|
122
|
+
return null;
|
|
123
|
+
const request = {
|
|
124
|
+
answers,
|
|
125
|
+
...(page === undefined ? {} : { page: page }),
|
|
126
|
+
...(element === undefined ? {} : { element: element }),
|
|
127
|
+
};
|
|
128
|
+
return { action, request };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The answers a submission stores: those within the length limit of their slot's kind (open answers 2000 code points,
|
|
132
|
+
* the others 500). Longer ones count as unanswered, so they are not kept either.
|
|
133
|
+
*/
|
|
134
|
+
function storable(key, answers) {
|
|
135
|
+
return Object.fromEntries(Object.entries(answers).filter(([id, value]) => fitsAnswer(value, Object.hasOwn(key.slots, id) ? key.slots[id]?.kind : undefined)));
|
|
136
|
+
}
|
|
137
|
+
/** The hints used of a record as grading options: nothing when there are none, so old records grade as before. */
|
|
138
|
+
function hintsOf(record) {
|
|
139
|
+
return record.hintsUsed === undefined ? {} : { hintsUsed: record.hintsUsed };
|
|
140
|
+
}
|
|
141
|
+
/** Same rule and rounding as the engine's `localChecker`. */
|
|
142
|
+
function passes(result, passMark) {
|
|
143
|
+
return result.max === 0 || Math.round((result.score / result.max) * 1e6) / 1e6 >= passMark;
|
|
144
|
+
}
|
|
145
|
+
/** From the deadline (plus `grace`) on. Fails closed: a deadline or clock that is not a number closes the attempt. */
|
|
146
|
+
function pastDeadline(policy, now, grace = 0) {
|
|
147
|
+
return policy.deadline !== null && !(now <= Date.parse(policy.deadline) + grace);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Creates the grading endpoint. It answers only protocol-1 requests and never sends key data: check responses carry
|
|
151
|
+
* the GradeResult, hints go out one at a time when the policy offers them, feedback and explanations when the policy
|
|
152
|
+
* shows them (`helpShown`), and solutions with a submit only when the attempt's policy reveals answers.
|
|
153
|
+
*/
|
|
154
|
+
export function createGradingHandler(options) {
|
|
155
|
+
const { engine, attempts } = options;
|
|
156
|
+
const now = options.now ?? Date.now;
|
|
157
|
+
/** A store answer the handler can act on; anything inconsistent throws, which fails the request closed (500). */
|
|
158
|
+
function trusted(record, id, from) {
|
|
159
|
+
if (record === null || isRecord(record, id))
|
|
160
|
+
return record;
|
|
161
|
+
throw new TypeError(`AttemptStore.${from} returned an invalid record for attempt ${id}`);
|
|
162
|
+
}
|
|
163
|
+
async function check(id, request) {
|
|
164
|
+
const record = trusted(await attempts.get(id), id, 'get');
|
|
165
|
+
if (record === null)
|
|
166
|
+
return problem(ProblemCode.notFound);
|
|
167
|
+
const { policy, key } = record;
|
|
168
|
+
if (policy.mode !== 'practice')
|
|
169
|
+
return problem(ProblemCode.checkNotAllowed);
|
|
170
|
+
if (record.submitted || pastDeadline(policy, now()))
|
|
171
|
+
return problem(ProblemCode.attemptClosed);
|
|
172
|
+
const { page, element } = request;
|
|
173
|
+
if (element !== undefined && helpPolicy(policy).checkScope !== 'interaction') {
|
|
174
|
+
return problem(ProblemCode.checkNotAllowed);
|
|
175
|
+
}
|
|
176
|
+
if (page !== undefined && !key.pages.includes(page))
|
|
177
|
+
return problem(ProblemCode.notFound);
|
|
178
|
+
if (element !== undefined && !isGradedElement(key, element))
|
|
179
|
+
return problem(ProblemCode.notFound);
|
|
180
|
+
const max = policy.maxChecks;
|
|
181
|
+
if (max !== null && record.checksUsed >= max)
|
|
182
|
+
return problem(ProblemCode.checksExhausted);
|
|
183
|
+
// Count first, then decide on the counted record: a parallel check cannot slip past maxChecks.
|
|
184
|
+
const counted = trusted(await attempts.recordCheck(id), id, 'recordCheck');
|
|
185
|
+
if (counted === null)
|
|
186
|
+
return problem(ProblemCode.notFound);
|
|
187
|
+
if (counted.submitted)
|
|
188
|
+
return problem(ProblemCode.attemptClosed);
|
|
189
|
+
if (max !== null && counted.checksUsed > max)
|
|
190
|
+
return problem(ProblemCode.checksExhausted);
|
|
191
|
+
const scope = page !== undefined ? { page } : element !== undefined ? { element } : {};
|
|
192
|
+
const result = engine.grade(key, request.answers, { ...scope, ...hintsOf(counted) });
|
|
193
|
+
return json({
|
|
194
|
+
result,
|
|
195
|
+
checksLeft: max === null ? null : Math.max(0, max - counted.checksUsed),
|
|
196
|
+
...resultHelp(key, result, helpShown(policy, 'check'), element),
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
async function hint(id, request) {
|
|
200
|
+
const record = trusted(await attempts.get(id), id, 'get');
|
|
201
|
+
if (record === null)
|
|
202
|
+
return problem(ProblemCode.notFound);
|
|
203
|
+
const { policy, key } = record;
|
|
204
|
+
if (!helpPolicy(policy).hints || attempts.recordHint === undefined)
|
|
205
|
+
return problem(ProblemCode.hintsNotAllowed);
|
|
206
|
+
if (record.submitted || pastDeadline(policy, now()))
|
|
207
|
+
return problem(ProblemCode.attemptClosed);
|
|
208
|
+
const { element } = request;
|
|
209
|
+
const total = hintCount(key, element);
|
|
210
|
+
if (total === 0)
|
|
211
|
+
return problem(ProblemCode.notFound);
|
|
212
|
+
if (usedOf(record, element) >= total)
|
|
213
|
+
return problem(ProblemCode.hintsExhausted);
|
|
214
|
+
// Count first, then serve the counted one: parallel requests get a hint each, never the same one twice.
|
|
215
|
+
const counted = trusted(await attempts.recordHint(id, element), id, 'recordHint');
|
|
216
|
+
if (counted === null)
|
|
217
|
+
return problem(ProblemCode.notFound);
|
|
218
|
+
if (counted.submitted)
|
|
219
|
+
return problem(ProblemCode.attemptClosed);
|
|
220
|
+
const next = nextHint(key, element, usedOf(counted, element) - 1);
|
|
221
|
+
return next === null ? problem(ProblemCode.hintsExhausted) : json(next);
|
|
222
|
+
}
|
|
223
|
+
async function submit(id, sent) {
|
|
224
|
+
const record = trusted(await attempts.get(id), id, 'get');
|
|
225
|
+
if (record === null)
|
|
226
|
+
return problem(ProblemCode.notFound);
|
|
227
|
+
const { policy, key } = record;
|
|
228
|
+
if (record.submitted || policy.mode === 'review' || pastDeadline(policy, now(), DEADLINE_GRACE_MS)) {
|
|
229
|
+
return problem(ProblemCode.attemptClosed);
|
|
230
|
+
}
|
|
231
|
+
const answers = storable(key, sent);
|
|
232
|
+
const result = engine.grade(key, answers, hintsOf(record));
|
|
233
|
+
const revealed = policy.reveal !== 'nothing';
|
|
234
|
+
const response = {
|
|
235
|
+
result: revealed ? result : null,
|
|
236
|
+
solution: policy.reveal === 'answers' ? engine.solution(key) : null,
|
|
237
|
+
passed: revealed && policy.passMark !== null ? passes(result, policy.passMark) : null,
|
|
238
|
+
submittedAt: new Date(now()).toISOString(),
|
|
239
|
+
...(revealed ? resultHelp(key, result, helpShown(policy, 'submit')) : {}),
|
|
240
|
+
};
|
|
241
|
+
// Only an explicit `true` closes the attempt for this request: anything else is treated as "already submitted".
|
|
242
|
+
if ((await attempts.recordSubmit(id, { answers, response })) !== true)
|
|
243
|
+
return problem(ProblemCode.attemptClosed);
|
|
244
|
+
return json(response);
|
|
245
|
+
}
|
|
246
|
+
async function handle(request, context) {
|
|
247
|
+
if (request.method !== 'POST')
|
|
248
|
+
return problem(ProblemCode.methodNotAllowed, { allow: 'POST' });
|
|
249
|
+
const action = actionOf(request.url);
|
|
250
|
+
// JavaScript callers may leave the context out: no attempt, nothing to grade.
|
|
251
|
+
const id = context?.attemptId;
|
|
252
|
+
if (action === null || typeof id !== 'string' || !ATTEMPT_ID_PATTERN.test(id)) {
|
|
253
|
+
return problem(ProblemCode.notFound);
|
|
254
|
+
}
|
|
255
|
+
// JSON only: other media types are not protocol requests, and requiring this one makes cross-site form posts
|
|
256
|
+
// (which cannot set it without a CORS preflight) fail before they touch an attempt.
|
|
257
|
+
const type = (request.headers.get('content-type') ?? '').split(';')[0]?.trim().toLowerCase();
|
|
258
|
+
if (type !== JSON_MEDIA_TYPE)
|
|
259
|
+
return problem(ProblemCode.invalidRequest);
|
|
260
|
+
let body;
|
|
261
|
+
try {
|
|
262
|
+
body = JSON.parse(await readBody(request));
|
|
263
|
+
}
|
|
264
|
+
catch (error) {
|
|
265
|
+
return problem(error instanceof TooLarge ? ProblemCode.payloadTooLarge : ProblemCode.invalidRequest);
|
|
266
|
+
}
|
|
267
|
+
const parsed = parseRequest(action, body);
|
|
268
|
+
if (parsed === null)
|
|
269
|
+
return problem(ProblemCode.invalidRequest);
|
|
270
|
+
if (parsed.action === ProtocolPath.check)
|
|
271
|
+
return check(id, parsed.request);
|
|
272
|
+
return parsed.action === ProtocolPath.hint ? hint(id, parsed.request) : submit(id, parsed.answers);
|
|
273
|
+
}
|
|
274
|
+
return async (request, context) => {
|
|
275
|
+
try {
|
|
276
|
+
return await handle(request, context);
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
try {
|
|
280
|
+
options.onError?.(error, request);
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
// A failing logger must not change the answer.
|
|
284
|
+
}
|
|
285
|
+
// Storage or grading failed: say so without details (they may describe the key or the database).
|
|
286
|
+
return problem(ProblemCode.internal);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAML,UAAU,EAIV,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EAGX,YAAY,GAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B3F,kFAAkF;AAClF,MAAM,CAAC,MAAM,kBAAkB,GAAW,wBAAwB,CAAC;AAEnE;;;GAGG;AAC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1
|
+
export type { GradingContext, GradingHandler, GradingHandlerOptions } from './handler.js';
|
|
2
|
+
export { ATTEMPT_ID_PATTERN, createGradingHandler, DEADLINE_GRACE_MS } from './handler.js';
|
|
3
|
+
export type { AttemptRecord, AttemptStore, MemoryAttemptStore, NewAttempt, Submission } from './store.js';
|
|
4
|
+
export { createMemoryAttemptStore } from './store.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC3F,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
|