@edpire/sdk 0.12.2 → 0.13.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 CHANGED
@@ -11,6 +11,45 @@ the package follows [semantic versioning](https://semver.org/spec/v2.0.0.html).
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [0.13.0] - 2026-12-01
15
+
16
+ Bundles runtime 3.21.0 and schema 5.8.0 (maths answers, edpire.com T189).
17
+
18
+ ### Added
19
+
20
+ - **The answer sheet.** A teacher's "Detailed answer" (an AI-graded answer with maths on) and any
21
+ written answer with maths switched on show one box where maths typed as written becomes maths
22
+ (`x^2`, `1/2`, `sqrt`, `<=`, `x =`), with maths keys under it. The answer keeps its plain `text`
23
+ (formulas as `$…$`) and adds `content` (the sheet), so code that reads `text` keeps working.
24
+ - `answerSheetHandler` on `AssessmentShell`, `EdpireAssessmentPlayer` and `AssessmentEmbed`, plus
25
+ `createAnswerSheetHandler` / `embedAnswerSheetHandler`: reads a photo of the learner's copy or a
26
+ handwritten formula into the sheet. The embed uses `POST /api/v1/embed/read` by default. The
27
+ builder does not offer photo or handwriting answers yet, so nothing shows them today.
28
+ - `onReportGrade` on `AssessmentShell`: "Report a marking mistake" under each automatically marked
29
+ question once the paper is submitted; the host sends the learner's reason. Without it, no button.
30
+
31
+ ### Upgrade notes
32
+
33
+ - New dependencies `@tiptap/core`, `@tiptap/pm` and `@tiptap/extensions` (the answer sheet), installed
34
+ with the SDK; a test setup that lists the SDK's externals must add them.
35
+ - Nothing to change. Older players show a detailed answer as a plain text box, and it is still
36
+ graded; maths results are checked on our servers for every SDK version.
37
+
38
+ ## [0.12.3] - 2026-11-28
39
+
40
+ ### Fixed
41
+
42
+ - **A restored plain text answer came back blank.** A plain text box (an open response without
43
+ formatting) given saved answers, through `renderQuestion` or `EdpireQuestion` with
44
+ `initialAnswers` and not read-only, showed the saved text, but the runtime's hidden editor
45
+ reported the box empty right after: `onAnswersChange` received a blank for it. Fixed in the
46
+ runtime (3.20.1), now bundled.
47
+ - **A resumed attempt lost its plain text answers** (`AssessmentShell`, as edpire.com uses it).
48
+ When a learner came back to an attempt (a reload, "come back later"), a required question said
49
+ "This question is required" under a filled box, a paper sent the box blank, and the autosave
50
+ wrote the blank over the saved draft. The shell now also keeps the restored text until the
51
+ learner changes that box.
52
+
14
53
  ## [0.12.2] - 2026-11-25
15
54
 
16
55
  ### Fixed
package/README.md CHANGED
@@ -92,7 +92,7 @@ embed.unmount()
92
92
  **CDN (no bundler):**
93
93
 
94
94
  ```html
95
- <script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.12.2/dist/umd/index.global.js"></script>
95
+ <script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.13.0/dist/umd/index.global.js"></script>
96
96
  <script>
97
97
  EdpireSDK.EdpireAssessment.mount({ token, container: "#root", onComplete: handleDone })
98
98
  </script>
@@ -330,7 +330,7 @@ The integration uses two parts:
330
330
  </head>
331
331
  <body>
332
332
  <div id="root"></div>
333
- <script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.12.2/dist/umd/index.global.js"></script>
333
+ <script src="https://cdn.jsdelivr.net/npm/@edpire/sdk@0.13.0/dist/umd/index.global.js"></script>
334
334
  <script>
335
335
  EdpireSDK.EdpireAssessment.mount({
336
336
  token: "{{EMBED_TOKEN}}", // replace server-side before loading
package/dist/index.d.mts CHANGED
@@ -287,6 +287,12 @@ interface MountOptions {
287
287
  * questions with file-upload or recording modes.
288
288
  */
289
289
  mediaHandler?: QuestionRuntimeProps["mediaHandler"];
290
+ /**
291
+ * Reads a photo of the learner's paper copy and a handwritten formula into the answer sheet
292
+ * (Rédaction and open answers with the sheet on, runtime 3.21.0+). Without it the sheet takes
293
+ * typed text and formulas only.
294
+ */
295
+ answerSheetHandler?: QuestionRuntimeProps["answerSheetHandler"];
290
296
  /**
291
297
  * Called when the learner successfully submits the assessment.
292
298
  */