@edpire/sdk 0.8.1 → 0.8.3

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
@@ -147,12 +147,22 @@ interface ShellReview {
147
147
  /** The attempt's marking. Drives the score banner and every per-node mark. */
148
148
  result: SubmitResult;
149
149
  }
150
+ /**
151
+ * Where the host's saving of answers in progress stands, shown quietly in the
152
+ * top bar. "failed" means saving keeps failing: the shell then says so plainly.
153
+ */
154
+ type ShellSaveState = "saving" | "saved" | "failed";
150
155
  interface SubmitResult {
151
156
  submissionId: string;
152
157
  totalScore: number;
153
158
  maxScore: number;
154
159
  percentage: number;
155
160
  passed: boolean;
161
+ /**
162
+ * False when the assessment has no pass mark: the banner shows the score in
163
+ * ink, with no "passed" / "not passed". Default true (unchanged).
164
+ */
165
+ showVerdict?: boolean;
156
166
  /** If null/undefined, the shell hides the "View Full Report" button. */
157
167
  returnUrl?: string | null;
158
168
  exerciseFeedback: ExerciseFeedbackData[];
@@ -399,6 +409,25 @@ interface AssessmentShellProps {
399
409
  timeLimitMinutes?: number | null;
400
410
  /** ISO timestamp of attempt start — anchors the countdown server-side. */
401
411
  startedAt?: string;
412
+ /**
413
+ * Answers saved earlier in this attempt. They are filled in and stay
414
+ * editable, and are part of what `onSubmit` receives even if the learner
415
+ * changes nothing. Read on mount only.
416
+ */
417
+ initialAnswers?: AssessmentAnswers;
418
+ /**
419
+ * Called with the whole set of answers on every change, for hosts that save
420
+ * progress. Restored answers are included.
421
+ */
422
+ onAnswersChange?: (answers: AssessmentAnswers) => void;
423
+ /** The host's saving state, shown quietly in the top bar. Omit when the host doesn't save. */
424
+ saveState?: ShellSaveState | null;
425
+ /**
426
+ * The learner is coming back to an attempt they opened before: a short note
427
+ * says so, whether their answers are back, and with a time limit how much
428
+ * time is left (the clock keeps running while they are away).
429
+ */
430
+ resumed?: boolean;
402
431
  /** Called when the learner submits. Should throw on error. */
403
432
  onSubmit: (answers: AssessmentAnswers) => Promise<SubmitResult>;
404
433
  /**
@@ -449,6 +478,6 @@ interface AssessmentShellProps {
449
478
  */
450
479
  fallbackLogoUrl?: string;
451
480
  }
452
- declare function AssessmentShell({ assessment, meta, locale, branding, timeLimitMinutes, startedAt, onSubmit, review, onViewReport, reportLabel, onBack, backLabel, allowReset, onReset, overlayConfig, contained, layout, onClose, mediaHandler, onAddAnnex, fallbackLogoUrl, }: AssessmentShellProps): react_jsx_runtime.JSX.Element;
481
+ 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;
453
482
 
454
- 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 SpinnerTheme, type SubmitResult, type TakeBranding };
483
+ 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 };