@edpire/sdk 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.d.mts CHANGED
@@ -125,8 +125,9 @@ type NodeDetail = {
125
125
  interface NodeFeedback {
126
126
  nodeId: string;
127
127
  status: "correct" | "partial" | "incorrect" | "awaiting_review";
128
- score: number;
129
- maxScore: number;
128
+ /** Absent when the assessment doesn't show the score to students (see `SubmitResult.scoreHidden`). */
129
+ score?: number;
130
+ maxScore?: number;
130
131
  feedback?: string;
131
132
  displayAnswer?: string;
132
133
  detail?: NodeDetail;
@@ -168,6 +169,11 @@ interface SubmitResult {
168
169
  /** If null/undefined, the shell hides the "View Full Report" button. */
169
170
  returnUrl?: string | null;
170
171
  exerciseFeedback: ExerciseFeedbackData[];
172
+ /**
173
+ * The assessment doesn't show the score to students: the server sent none (the numbers above
174
+ * are then 0 and meaningless). The shell shows the feedback and the correction, no points.
175
+ */
176
+ scoreHidden?: boolean;
171
177
  /** When true, score banners hide the score (still being reviewed). */
172
178
  awaitingManualGrading?: boolean;
173
179
  /**
@@ -176,6 +182,11 @@ interface SubmitResult {
176
182
  * than that a teacher is reviewing open responses.
177
183
  */
178
184
  aiPending?: boolean;
185
+ /**
186
+ * The assessment is a form: it collects answers and grades nothing. The banner thanks the
187
+ * respondent, with no report button. The score fields are 0, as with `scoreHidden`.
188
+ */
189
+ isForm?: boolean;
179
190
  }
180
191
 
181
192
  type SpinnerTheme = "default" | "dots" | "pulse" | "bars";
@@ -211,11 +222,19 @@ type ShellLocale = "en" | "fr" | "ar";
211
222
  type NodeFeedbackStatus = "correct" | "partial" | "incorrect" | "awaiting_review";
212
223
  interface EmbedResult {
213
224
  submission_id: string;
214
- score: number;
215
- max_score: number;
216
- percentage: number;
217
- passed: boolean;
218
- passing_score_percent: number;
225
+ /**
226
+ * `score`, `max_score`, `percentage`, `passed` and `passing_score_percent` are `null` when the
227
+ * assessment doesn't show the score to students (`score_hidden`): this result reaches the
228
+ * learner's browser. Your server still gets the score from `GET /submissions/{id}` and the
229
+ * `submission.created` webhook.
230
+ */
231
+ score: number | null;
232
+ max_score: number | null;
233
+ percentage: number | null;
234
+ passed: boolean | null;
235
+ passing_score_percent: number | null;
236
+ /** True when the teacher chose not to show the score to students (SDK 0.12.0). */
237
+ score_hidden?: boolean;
219
238
  attempt_number: number;
220
239
  /** True when the submission contains open-response nodes still pending teacher review. */
221
240
  awaiting_manual_grading?: boolean;
@@ -223,13 +242,15 @@ interface EmbedResult {
223
242
  ai_pending?: boolean;
224
243
  exercise_results: Array<{
225
244
  exercise_id: string;
226
- total_score: number;
227
- max_score: number;
245
+ /** Null with `score_hidden`. */
246
+ total_score: number | null;
247
+ max_score: number | null;
228
248
  question_results: Array<{
229
249
  question_id: string;
230
- score: number;
250
+ /** Null with `score_hidden`. */
251
+ score: number | null;
231
252
  correct: boolean;
232
- points: number;
253
+ points: number | null;
233
254
  }>;
234
255
  }>;
235
256
  exercise_feedback: Array<{
@@ -244,8 +265,9 @@ interface EmbedResult {
244
265
  node_results: Array<{
245
266
  node_id: string;
246
267
  status: NodeFeedbackStatus;
247
- score: number;
248
- max_score: number;
268
+ /** Absent with `score_hidden`. */
269
+ score?: number;
270
+ max_score?: number;
249
271
  feedback?: string;
250
272
  display_answer?: string;
251
273
  detail?: {
@@ -410,6 +432,22 @@ interface AssessmentShellProps {
410
432
  title: string;
411
433
  category: string | null;
412
434
  };
435
+ /**
436
+ * The assessment doesn't show the score to students (T157): no points anywhere, before or after
437
+ * submitting; the feedback and the correction still show. A result with `scoreHidden` does the
438
+ * same after submitting.
439
+ */
440
+ scoreHidden?: boolean;
441
+ /**
442
+ * The assessment is a form: it collects answers and grades nothing. Submitting says "Send", no
443
+ * grading animation plays, and the end is a thank-you. A result with `isForm` does the same.
444
+ */
445
+ isForm?: boolean;
446
+ /**
447
+ * Questions the learner must answer before sending, every input filled. Each is marked `*`;
448
+ * Submit with one left goes to it and marks every one missing, instead of opening the dialog.
449
+ */
450
+ requiredQuestionIds?: readonly string[];
413
451
  /** Locale for shell strings. Default "en". */
414
452
  locale?: ShellLocale;
415
453
  branding?: TakeBranding;
@@ -486,6 +524,6 @@ interface AssessmentShellProps {
486
524
  */
487
525
  fallbackLogoUrl?: string;
488
526
  }
489
- declare function AssessmentShell({ assessment, meta, locale, branding, timeLimitMinutes, startedAt, initialAnswers, onAnswersChange, saveState, resumed, onSubmit, review, onViewReport, reportLabel, onBack, backLabel, allowReset, onReset, overlayConfig, contained, layout, onClose, mediaHandler, onAddAnnex, fallbackLogoUrl, }: AssessmentShellProps): react_jsx_runtime.JSX.Element;
527
+ declare function AssessmentShell({ assessment, meta, scoreHidden: scoreHiddenProp, isForm: isFormProp, requiredQuestionIds, locale, branding, timeLimitMinutes, startedAt, initialAnswers, onAnswersChange, saveState, resumed, onSubmit, review, onViewReport, reportLabel, onBack, backLabel, allowReset, onReset, overlayConfig, contained, layout, onClose, mediaHandler, onAddAnnex, fallbackLogoUrl, }: AssessmentShellProps): react_jsx_runtime.JSX.Element;
490
528
 
491
529
  export { AssessmentShell, type AssessmentShellProps, EdpireAssessmentPlayer, type EdpireAssessmentPlayerProps, EdpireQuestion, type EdpireQuestionProps, type ExerciseFeedbackData, type NodeDetail, type NodeFeedback, type OverlayConfig, type QuestionFeedback, type ShellLayout, type ShellLocale, type ShellReview, type ShellSaveState, type SpinnerTheme, type SubmitResult, type TakeBranding };