@edpire/sdk 0.6.12 → 0.8.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 ADDED
@@ -0,0 +1,113 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@edpire/sdk`.
4
+
5
+ This file starts at 0.7.0. Earlier versions are recoverable from the git history
6
+ of `packages/sdk`, but were never written up, which is the reason this exists:
7
+ integrators pin a version and had no way to tell what a bump would change.
8
+
9
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
10
+ the package follows [semantic versioning](https://semver.org/spec/v2.0.0.html).
11
+
12
+ ## [0.8.0] - 2026-09-23
13
+
14
+ ### Added
15
+
16
+ - **`EdpireAssessment.review({ review, container })`**: reopens a finished
17
+ attempt as the corrected paper. The learner's answers are replayed into
18
+ locked questions, with every mark, the expected answer on anything missed,
19
+ and the teacher's comments on open responses. It is the screen the player
20
+ shows on submit, available again afterwards.
21
+
22
+ ```javascript
23
+ const review = await fetch(`/api/attempts/${id}/review`).then((r) => r.json())
24
+ EdpireAssessment.review({ review, container: "#paper" })
25
+ ```
26
+
27
+ `review` is the response of the new `GET /api/v1/submissions/{id}/review`,
28
+ passed through unchanged. Your server fetches it with an API key after
29
+ checking ownership, so there is no token and no browser request to Edpire,
30
+ and the origin allow-list does not apply.
31
+
32
+ - **`flattenReview(review)`**: the same attempt as one step per question, for
33
+ flows that show one question per screen. Each step carries the content, the
34
+ learner's answers, feedback in `/check`'s shape, the score and a status, plus
35
+ the exercise's shared context. Pure, so also in `@edpire/sdk/core` and on the
36
+ CDN global.
37
+
38
+ ```javascript
39
+ const steps = flattenReview(review)
40
+ renderQuestion({ container, content: steps[i].content, initialAnswers: steps[i].answers,
41
+ feedback: steps[i].feedback, readOnly: true })
42
+ ```
43
+
44
+ - **`readOnly`** on `renderQuestion()` and `EdpireQuestion`: answers show but
45
+ cannot change.
46
+
47
+ - **`EdpireClient.getSubmissionReview(id, { learnerRef })`** for that fetch.
48
+ With `learnerRef`, a submission belonging to anyone else is a 404.
49
+
50
+ - **`EdpireClient.getLearnerResults(ref, { assessmentId })`**: one
51
+ assessment's attempt history.
52
+
53
+ - **`AssessmentShellProps.review`** and the **`ShellReview`** type, for React
54
+ consumers rendering the shell directly. **`SubmissionReview`**,
55
+ **`ReviewOptions`** and **`ReviewStep`** types.
56
+
57
+ - **`teacher_feedback`** on `EmbedResult` node results. Only ever present in a
58
+ review: at submit time no teacher has marked anything yet.
59
+
60
+ ### Changed
61
+
62
+ - The back button (`onBack`) now also shows in review mode. Before submission it
63
+ behaves as before.
64
+
65
+ ### Notes for integrators
66
+
67
+ No breaking changes. Review needs the new endpoint, which is live on
68
+ edpire.com from this release. See the attempt history guide:
69
+ https://docs.edpire.com/developer/attempt-history
70
+
71
+ ## [0.7.0] - 2026-09-22
72
+
73
+ ### Added
74
+
75
+ - **`layout.maxWidth`** on `MountOptions`, `EdpireAssessmentPlayerProps` and
76
+ `AssessmentShellProps`. The player fills the container you size, but inside
77
+ that the questions sat in a centred 768px column with no way to change it.
78
+ That is right when the player owns the page and wrong when it is embedded in
79
+ host chrome, where it reads as a column inside a column. Takes any CSS length
80
+ or `"none"`.
81
+
82
+ ```javascript
83
+ EdpireAssessment.mount({ token, container: "#root", layout: { maxWidth: "none" } })
84
+ ```
85
+
86
+ The default is unchanged at `"48rem"`, so no existing embed moves. It stays a
87
+ reading measure by default: 768px already yields roughly 70 to 90 characters
88
+ per line at the runtime's base size.
89
+
90
+ The value also drives the post-submit score banners, so they stay aligned with
91
+ the questions. When an assessment has an annex, wide viewports use a
92
+ two-column layout that already fills the container and only the narrow
93
+ breakpoint takes the value.
94
+
95
+ - **`ShellLayout`** exported from `@edpire/sdk` and `@edpire/sdk/react`.
96
+
97
+ - **Pre-submit warning for unanswered questions.** The confirm dialog now names
98
+ how many questions are not fully answered. It warns and never blocks: the
99
+ learner can still submit. Auto-submit on time expiry does not route through
100
+ the dialog. Translated in en, fr and ar.
101
+
102
+ A question counts as incomplete when any of its inputs is empty, so three of
103
+ four blanks filled is caught.
104
+
105
+ ### Notes for integrators
106
+
107
+ No breaking changes. This is a minor bump only because it adds public API.
108
+
109
+ If you have been working around the 768px column with your own CSS, for example
110
+ by overriding `max-w-3xl` or forcing widths on the shell's children, remove it
111
+ and pass `layout` instead. The class is gone: the width is now an inline style,
112
+ because the shipped `shell.css` is pre-built and a consumer's width can never
113
+ exist as a utility class in it.