@intellectif/lk-react 2.0.0 → 3.0.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/WrittenResponse-B50EjVR0.d.cts +87 -0
- package/dist/WrittenResponse-BHhP936i.d.ts +87 -0
- package/dist/{chunk-32WWQOG3.js → chunk-3X7MYAFT.js} +99 -26
- package/dist/chunk-3X7MYAFT.js.map +1 -0
- package/dist/chunk-7MW7HGOA.cjs +258 -0
- package/dist/chunk-7MW7HGOA.cjs.map +1 -0
- package/dist/chunk-AEQQ7VPF.js +256 -0
- package/dist/chunk-AEQQ7VPF.js.map +1 -0
- package/dist/chunk-BGWXN44S.js +152 -0
- package/dist/chunk-BGWXN44S.js.map +1 -0
- package/dist/chunk-HO3AC3WQ.cjs +154 -0
- package/dist/chunk-HO3AC3WQ.cjs.map +1 -0
- package/dist/{chunk-73XCWYKD.cjs → chunk-UXO6KYSZ.cjs} +97 -24
- package/dist/chunk-UXO6KYSZ.cjs.map +1 -0
- package/dist/{chunk-MKH5THDR.cjs → chunk-W6BH2YMZ.cjs} +119 -36
- package/dist/chunk-W6BH2YMZ.cjs.map +1 -0
- package/dist/{chunk-G5ZEWJRA.js → chunk-ZVFWJTT4.js} +119 -36
- package/dist/chunk-ZVFWJTT4.js.map +1 -0
- package/dist/components/ActivitySequence.cjs +5 -4
- package/dist/components/ActivitySequence.d.cts +52 -4
- package/dist/components/ActivitySequence.d.ts +52 -4
- package/dist/components/ActivitySequence.js +4 -3
- package/dist/components/FillInTheBlanks.cjs +2 -2
- package/dist/components/FillInTheBlanks.d.cts +7 -1
- package/dist/components/FillInTheBlanks.d.ts +7 -1
- package/dist/components/FillInTheBlanks.js +1 -1
- package/dist/components/MultipleChoice.cjs +2 -2
- package/dist/components/MultipleChoice.d.cts +14 -3
- package/dist/components/MultipleChoice.d.ts +14 -3
- package/dist/components/MultipleChoice.js +1 -1
- package/dist/components/WrittenResponse.cjs +2 -2
- package/dist/components/WrittenResponse.d.cts +5 -38
- package/dist/components/WrittenResponse.d.ts +5 -38
- package/dist/components/WrittenResponse.js +1 -1
- package/dist/index.cjs +13 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/theme/skin.css +75 -0
- package/dist/types-CNmjqD6M.d.cts +108 -0
- package/dist/types-CNmjqD6M.d.ts +108 -0
- package/package.json +70 -28
- package/dist/chunk-32WWQOG3.js.map +0 -1
- package/dist/chunk-73XCWYKD.cjs.map +0 -1
- package/dist/chunk-G5ZEWJRA.js.map +0 -1
- package/dist/chunk-KJNQLAB5.cjs +0 -158
- package/dist/chunk-KJNQLAB5.cjs.map +0 -1
- package/dist/chunk-MKH5THDR.cjs.map +0 -1
- package/dist/chunk-OS7MO2OW.js +0 -109
- package/dist/chunk-OS7MO2OW.js.map +0 -1
- package/dist/chunk-SH7BRP4M.cjs +0 -111
- package/dist/chunk-SH7BRP4M.cjs.map +0 -1
- package/dist/chunk-V5EN3ESV.js +0 -156
- package/dist/chunk-V5EN3ESV.js.map +0 -1
- package/dist/types-iknDq5tf.d.cts +0 -17
- package/dist/types-iknDq5tf.d.ts +0 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/MultipleChoice/MultipleChoice.tsx","../src/components/MultipleChoice/index.tsx"],"names":["MultipleChoice","jsx"],"mappings":";;;;;;AAsBA,SAAS,SAAS,KAAA,EAAuB;AACvC,EAAA,IAAI,IAAI,UAAA,KAAe,CAAA;AACvB,EAAA,KAAA,IAAS,IAAI,CAAA,EAAG,CAAA,GAAI,KAAA,CAAM,MAAA,EAAQ,KAAK,CAAA,EAAG;AACxC,IAAA,CAAA,IAAK,KAAA,CAAM,WAAW,CAAC,CAAA;AACvB,IAAA,CAAA,GAAI,IAAA,CAAK,IAAA,CAAK,CAAA,EAAG,QAAQ,CAAA,KAAM,CAAA;AAAA,EAC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;AAAA,QAAC,QAAA;AAAA,QAAA;AAAA,UACC,EAAA,EAAI,UAAA;AAAA,UAEJ,uBAAA,EAAyB,EAAE,MAAA,EAAQ,YAAA;AAAa;AAAA,OAClD;AAAA,MASD,QAAA,mBACC,GAAA,CAAC,KAAA,EAAA,EAAI,IAAA,EAAK,YAAA,EAAa,iBAAA,EAAiB,UAAA,EACrC,QAAA,EAAA,UAAA,EACH,CAAA,mBAEA,GAAA,CAAC,KAAA,EAAA,EAAK,QAAA,EAAA,UAAA,EAAW,CAAA;AAAA,MAGlB,QAAA,GAAW,uBACV,GAAA,CAAC,QAAA,EAAA,EAAO,MAAK,QAAA,EAAS,QAAA,EAAU,UAAU,QAAA,EAAA,QAAA,EAE1C;AAAA,KAAA,EAEJ,CAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,cAAA,EAAA,EAAe,EAAA,EAAI,CAAA,EAAG,IAAA,CAAK,EAAE,CAAA,SAAA,CAAA,EAC3B,QAAA,EAAA,QAAA,GAAW,kBAAA,CAAmB,OAAO,CAAA,GAAI,OAAA,EAC5C;AAAA,GAAA,EACF,CAAA;AAEJ;AClYO,SAASA,gBAAe,KAAA,EAA4B;AACzD,EAAA,uBACEC,GAAAA,CAAC,qBAAA,EAAA,EAAsB,aAAA,EAAe,KAAA,CAAM,IAAA,EAAM,KAAA,EAChD,QAAA,kBAAAA,GAAAA,CAAC,cAAA,EAAA,EAAoB,GAAG,KAAA,EAAO,CAAA,EACjC,CAAA;AAEJ","file":"chunk-ZVFWJTT4.js","sourcesContent":["'use client';\n\nimport {\n ActivitySchemaError,\n type ItemOutcome,\n type LearnerResponse,\n type MultipleChoiceData,\n type MultipleChoiceLearnerResponse,\n type MultipleChoiceOption,\n type ScoringDetail,\n score,\n validateActivity,\n xAPIBuilder,\n} from '@intellectif/lk-core';\nimport { type CSSProperties, useEffect, useMemo, useRef, useState } from 'react';\nimport { useActivityState } from '../../hooks/useActivityState.js';\nimport { ANONYMOUS_ACTOR, isDevelopment, objectIdFor, randomSessionId } from '../_internal.js';\nimport { ActivityMedia } from '../shared/ActivityMedia.js';\nimport { FeedbackRegion } from '../shared/FeedbackRegion.js';\nimport type { ActivityProps } from '../types.js';\n\n/** FNV-1a hash → 32-bit seed. */\nfunction hashSeed(input: string): number {\n let h = 2166136261 >>> 0;\n for (let i = 0; i < input.length; i += 1) {\n h ^= input.charCodeAt(i);\n h = Math.imul(h, 16777619) >>> 0;\n }\n return h;\n}\n\n/** Deterministic LCG Fisher–Yates; returns a permutation (no loss/dupe). */\nfunction seededShuffle<T>(items: readonly T[], seed: number): T[] {\n const out = [...items];\n let s = seed >>> 0 || 1;\n for (let i = out.length - 1; i > 0; i -= 1) {\n s = (Math.imul(s, 1664525) + 1013904223) >>> 0;\n const j = s % (i + 1);\n [out[i], out[j]] = [out[j] as T, out[i] as T];\n }\n return out;\n}\n\n/**\n * Selected option ids carried by a learner response. Any other response shape\n * (a caller wiring the wrong item's state through `value`) reads as \"nothing\n * selected\" rather than throwing mid-exam.\n */\nfunction selectionOf(response: LearnerResponse | undefined): string[] {\n return response?.type === 'multiple-choice' ? response.selectedOptionIds : [];\n}\n\n/**\n * Whether an option is part of the correct answer, derived from the SERVER's\n * outcome — review mode never holds an answer key of its own.\n * {@link ScoringDetail.outcome} states this unambiguously. For 0.2-era details\n * that carry only the deprecated `correct` flag (which means \"the learner\n * ACTED correctly on this option\", not \"this option is the answer\") the fact\n * is still recoverable, because we know whether the learner selected it:\n * `isCorrect = wasSelected ? correct : !correct`.\n */\nfunction isAnswerOption(detail: ScoringDetail, wasSelected: boolean): boolean {\n switch (detail.outcome) {\n case 'correct':\n case 'incorrect-omission':\n return true;\n case 'incorrect':\n case 'correct-omission':\n return false;\n default:\n return wasSelected ? detail.correct : !detail.correct;\n }\n}\n\n/** Announcement for `review` mode, built only from the server-supplied outcome. */\nfunction reviewAnnouncement(outcome: ItemOutcome | undefined): string | null {\n if (outcome === undefined) {\n return null;\n }\n if (outcome.status === 'scored') {\n const overall = outcome.feedback;\n return `Score ${Math.round(outcome.score * 100)}%. ${\n outcome.passed ? 'Passed.' : 'Not passed.'\n }${overall ? ` ${overall}` : ''}`;\n }\n if (outcome.status === 'deferred') {\n // Never \"0%\": ungraded is not the same as wrong.\n return 'Not graded yet.';\n }\n return null;\n}\n\nexport interface MultipleChoiceProps extends ActivityProps<MultipleChoiceData> {\n /**\n * Seed for the deterministic option shuffle. Supply one (e.g. the attempt\n * id) to make the shuffled order reproducible server-side, stable across\n * page reloads, and identical between SSR and hydration. When absent, a\n * random per-mount session seed is used (order stable within the mount\n * only — the v1 behaviour).\n */\n shuffleSeed?: string;\n}\n\nexport function MultipleChoice({\n data,\n onComplete,\n onSubmit,\n value,\n defaultValue,\n onChange,\n renderMode = 'practice',\n outcome,\n sanitizeHtml,\n onInteraction,\n theme,\n locale,\n disabled,\n shuffleSeed,\n}: MultipleChoiceProps) {\n // Dev-only boundary validation (Req 2.3). Throwing during render lets\n // ActivityErrorBoundary catch it. Memoised so it only re-runs on data change.\n const devError = useMemo(() => {\n if (!isDevelopment()) {\n return null;\n }\n // A `redact()` projection cannot satisfy the full content schema — the\n // answer key is gone by design — and must not be checked against the\n // strict redacted schema either, since a `reveal: 'after-submit'`\n // projection legitimately carries answer-key fields for review renders.\n if (data.redacted === true) {\n return null;\n }\n const result = validateActivity('multiple-choice', data);\n return result.success ? null : new ActivitySchemaError('multiple-choice', result.errors);\n }, [data]);\n\n // Lazily created only when shuffling without a caller seed: avoids calling\n // crypto.randomUUID (absent on non-secure http origins) unless needed.\n const sessionIdRef = useRef<string | null>(null);\n const { state, start, complete, getTimeSpent, reset } = useActivityState();\n // Uncontrolled state. `defaultValue` seeds the mount only (React convention);\n // to re-seed later, remount with a `key` or drive the component with `value`.\n const [internalSelection, setInternalSelection] = useState<string[]>(() =>\n selectionOf(defaultValue),\n );\n const [summary, setSummary] = useState<string | null>(null);\n\n // Reset on data-prop CHANGE (Req 3.7). The identity guard makes the mount\n // run a no-op, which it always was before `defaultValue` existed — without\n // it this effect would wipe the seed immediately after the first render.\n // (It also makes the reset StrictMode-safe: a remount with unchanged data\n // no longer discards the learner's selection.)\n // Clears to empty rather than back to `defaultValue`: carrying a stale\n // answer into a different question is the one failure mode a summative\n // component must never have.\n const lastDataRef = useRef(data);\n useEffect(() => {\n if (lastDataRef.current === data) {\n return;\n }\n lastDataRef.current = data;\n setInternalSelection([]);\n setSummary(null);\n reset();\n }, [data, reset]);\n\n const displayedOptions = useMemo<MultipleChoiceOption[]>(() => {\n if (!data.shuffle) {\n return [...data.options];\n }\n // biome-ignore lint/suspicious/noAssignInExpressions: sanctioned lazy ref initialization\n const seedSource = shuffleSeed ?? (sessionIdRef.current ??= randomSessionId());\n return seededShuffle(data.options, hashSeed(`${seedSource}:${data.id}`));\n }, [data, shuffleSeed]);\n\n // Per-option correctness for `review`, indexed by option id. Null unless the\n // caller supplied a SCORED outcome — the only source of truth this mode has.\n const reviewDetails = useMemo(() => {\n if (renderMode !== 'review' || outcome === undefined || outcome.status !== 'scored') {\n return null;\n }\n return new Map(outcome.details.map((detail) => [detail.itemId, detail]));\n }, [renderMode, outcome]);\n\n // All hooks are called before these throws, so hook order stays stable.\n if (devError) {\n throw devError;\n }\n // Practice grades locally, which a redacted projection cannot support:\n // `score()` would throw from the submit handler — where no error boundary\n // can catch it — AFTER the learner has answered. Fail loudly at render\n // instead, in production too. Wiring an exam item into the self-grading\n // mode is precisely the accident `renderMode` exists to prevent.\n if (data.redacted === true && renderMode === 'practice') {\n throw new Error(\n `Multiple Choice \"${data.id}\" received redacted activity data in renderMode \"practice\", ` +\n 'which grades locally and has no answer key to grade against. ' +\n 'Render redacted data with renderMode=\"exam\" (server grades) or \"review\" (pass `outcome`).',\n );\n }\n\n const isSingle = data.mode === 'single';\n const isExam = renderMode === 'exam';\n const isReview = renderMode === 'review';\n const submitted = state === 'completed';\n const inactive = disabled === true || submitted || isReview;\n const isControlled = value !== undefined;\n const selected = isControlled ? selectionOf(value) : internalSelection;\n /**\n * Whether correctness and authored feedback may be shown. Practice earns it\n * by grading locally after submit; review shows what the server already\n * graded. Exam never reveals anything — not before, not after submit.\n */\n const reveal = isReview || (renderMode === 'practice' && submitted);\n\n const fireInteraction = (\n type: 'option-selected' | 'option-deselected' | 'submitted',\n payload: Record<string, unknown>,\n ): void => {\n onInteraction?.({ type, activityId: data.id, timestamp: Date.now(), payload });\n };\n\n /** Single funnel for every response change: owns state only when uncontrolled. */\n const emitChange = (selectedOptionIds: string[]): void => {\n if (!isControlled) {\n setInternalSelection(selectedOptionIds);\n }\n onChange?.({ type: 'multiple-choice', selectedOptionIds });\n };\n\n const selectSingle = (optionId: string): void => {\n if (inactive) {\n return;\n }\n if (state === 'idle') {\n start();\n }\n emitChange([optionId]);\n fireInteraction('option-selected', { optionId });\n };\n\n const toggleMulti = (optionId: string, checked: boolean): void => {\n if (inactive) {\n return;\n }\n if (state === 'idle') {\n start();\n }\n emitChange(checked ? [...selected, optionId] : selected.filter((id) => id !== optionId));\n fireInteraction(checked ? 'option-selected' : 'option-deselected', { optionId });\n };\n\n const handleSubmit = (event: React.FormEvent): void => {\n event.preventDefault();\n if (inactive) {\n return;\n }\n const response: MultipleChoiceLearnerResponse = {\n type: 'multiple-choice',\n selectedOptionIds: selected,\n };\n // Always first, and before anything that can throw: an exam runner must be\n // able to persist the raw response no matter what happens after.\n onSubmit?.(response);\n\n if (isExam) {\n // No score(), no answer key read, no onComplete, no xAPI — the server\n // grades. The announcement deliberately carries no correctness signal.\n complete();\n setSummary('Answer submitted.');\n fireInteraction('submitted', { selectedOptionIds: selected });\n return;\n }\n\n const scoringResult = score('multiple-choice', data as MultipleChoiceData, response);\n complete();\n const timeSpent = getTimeSpent();\n const xapiStatement = xAPIBuilder.buildAnsweredStatement({\n actor: ANONYMOUS_ACTOR,\n object: {\n id: objectIdFor(data.id),\n name: { [data.locale ?? 'en-US']: data.title },\n type: 'http://adlnet.gov/expapi/activities/cmi.interaction',\n interactionType: 'choice',\n correctResponsesPattern: [\n data.options\n .filter((option) => option.isCorrect)\n .map((option) => option.id)\n .join('[,]'),\n ],\n choices: data.options.map((option) => ({\n id: option.id,\n description: { [data.locale ?? 'en-US']: option.text },\n })),\n },\n scoringResult,\n timeSpentMs: timeSpent,\n response: selected.join(','),\n });\n onComplete?.({\n score: scoringResult.score,\n maxScore: scoringResult.maxScore,\n passed: scoringResult.passed,\n timeSpent,\n xapiStatement,\n });\n // Core selects the authored overall feedback on `passed` (B3 fix).\n const overall = scoringResult.feedback;\n setSummary(\n `Answer submitted. Score ${Math.round(scoringResult.score * 100)}%. ${\n scoringResult.passed ? 'Passed.' : 'Not passed.'\n }${overall ? ` ${overall}` : ''}`,\n );\n fireInteraction('submitted', {\n selectedOptionIds: selected,\n score: scoringResult.score,\n });\n };\n\n const questionId = `${data.id}-question`;\n // Rich text renders ONLY through a caller-supplied sanitiser; without one we\n // fall back to the plain-text field, escaped by React (types.ts HtmlSanitizer).\n const questionHtml =\n sanitizeHtml !== undefined && data.questionHtml !== undefined\n ? sanitizeHtml(data.questionHtml)\n : null;\n\n const optionList = displayedOptions.map((option) => {\n const checked = selected.includes(option.id);\n // `data-correct` means \"this option is part of the correct answer\".\n let correctness: string | undefined;\n if (isReview) {\n const detail = reviewDetails?.get(option.id);\n correctness = detail === undefined ? undefined : String(isAnswerOption(detail, checked));\n } else if (reveal) {\n correctness = String(option.isCorrect);\n }\n return (\n <label key={option.id} className=\"lk-mc-option\" data-correct={correctness}>\n <input\n type={isSingle ? 'radio' : 'checkbox'}\n name={isSingle ? `${data.id}-options` : undefined}\n value={option.id}\n checked={checked}\n disabled={inactive}\n aria-disabled={inactive || undefined}\n onChange={(e) =>\n isSingle ? selectSingle(option.id) : toggleMulti(option.id, e.target.checked)\n }\n />\n <span>{option.text}</span>\n {reveal && option.feedback ? (\n <span className=\"lk-mc-option-feedback\" role=\"note\">\n {option.feedback}\n </span>\n ) : null}\n </label>\n );\n });\n\n return (\n <div className=\"lk-mc\" lang={locale} style={theme as CSSProperties | undefined}>\n {data.media ? <ActivityMedia media={data.media} /> : null}\n <form onSubmit={handleSubmit}>\n <fieldset disabled={inactive}>\n {questionHtml === null ? (\n <legend id={questionId}>{data.question}</legend>\n ) : (\n <legend\n id={questionId}\n // biome-ignore lint/security/noDangerouslySetInnerHtml: HTML is the output of the caller-supplied sanitizeHtml (types.ts HtmlSanitizer contract)\n dangerouslySetInnerHTML={{ __html: questionHtml }}\n />\n )}\n {/*\n single: an explicit radiogroup is meaningful (fieldset's implicit\n role is `group`, not `radiogroup`). multi: the fieldset + legend\n already provide a named group — an explicit role=\"group\" here would\n be a redundant, duplicate same-named group in the a11y tree, so we\n use a plain layout div. (Refines the design ARIA sketch.)\n */}\n {isSingle ? (\n <div role=\"radiogroup\" aria-labelledby={questionId}>\n {optionList}\n </div>\n ) : (\n <div>{optionList}</div>\n )}\n {/* review is read-only: there is nothing left to submit. */}\n {isReview ? null : (\n <button type=\"submit\" disabled={inactive}>\n Submit\n </button>\n )}\n </fieldset>\n </form>\n <FeedbackRegion id={`${data.id}-feedback`}>\n {isReview ? reviewAnnouncement(outcome) : summary}\n </FeedbackRegion>\n </div>\n );\n}\n","'use client';\n\nimport { ActivityErrorBoundary } from '../ActivityErrorBoundary.js';\nimport {\n MultipleChoice as MultipleChoiceCore,\n type MultipleChoiceProps,\n} from './MultipleChoice.js';\n\nexport type { MultipleChoiceProps } from './MultipleChoice.js';\n\n/**\n * Public Multiple Choice activity: the core component wrapped in\n * `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation\n * throw) degrades to an accessible fallback instead of crashing the host.\n */\nexport function MultipleChoice(props: MultipleChoiceProps) {\n return (\n <ActivityErrorBoundary activityTitle={props.data?.title}>\n <MultipleChoiceCore {...props} />\n </ActivityErrorBoundary>\n );\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkHO3AC3WQ_cjs = require('../chunk-HO3AC3WQ.cjs');
|
|
4
|
+
require('../chunk-W6BH2YMZ.cjs');
|
|
5
|
+
require('../chunk-UXO6KYSZ.cjs');
|
|
6
|
+
require('../chunk-7MW7HGOA.cjs');
|
|
6
7
|
require('../chunk-QHOV2A6M.cjs');
|
|
7
8
|
require('../chunk-HD2AIQRD.cjs');
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@ require('../chunk-HD2AIQRD.cjs');
|
|
|
10
11
|
|
|
11
12
|
Object.defineProperty(exports, "ActivitySequence", {
|
|
12
13
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkHO3AC3WQ_cjs.ActivitySequence; }
|
|
14
15
|
});
|
|
15
16
|
//# sourceMappingURL=ActivitySequence.cjs.map
|
|
16
17
|
//# sourceMappingURL=ActivitySequence.cjs.map
|
|
@@ -1,14 +1,62 @@
|
|
|
1
1
|
import { ActivityData, ActivityResult, InteractionEvent, ThemeTokens } from '@intellectif/lk-core';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { A as ActivityProps, R as RenderMode } from '../types-CNmjqD6M.cjs';
|
|
4
|
+
import { a as WrittenResponseSubmission } from '../WrittenResponse-B50EjVR0.cjs';
|
|
2
5
|
|
|
6
|
+
/**
|
|
7
|
+
* What one finished slot in a sequence produced. Two kinds, because two kinds
|
|
8
|
+
* of activity exist: those the SDK scores at submit time, and those a grader
|
|
9
|
+
* scores later. Collapsing them would mean inventing a score for ungraded
|
|
10
|
+
* work — the exact defect the deferred outcome exists to prevent.
|
|
11
|
+
*/
|
|
12
|
+
type SequenceItemOutcome = {
|
|
13
|
+
kind: 'scored';
|
|
14
|
+
index: number;
|
|
15
|
+
activityId: string;
|
|
16
|
+
result: ActivityResult;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'submitted';
|
|
19
|
+
index: number;
|
|
20
|
+
activityId: string;
|
|
21
|
+
/** Ungraded submission; the grade arrives asynchronously. */
|
|
22
|
+
submission: WrittenResponseSubmission;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A component that can render one activity inside a sequence. Register one per
|
|
26
|
+
* activity `type` to put a consumer-defined type on screen — the React half of
|
|
27
|
+
* the activity-type registry, matching `registerActivityType` in lk-core.
|
|
28
|
+
*/
|
|
29
|
+
type ActivityRenderer = ComponentType<ActivityProps>;
|
|
3
30
|
interface ActivitySequenceProps {
|
|
4
31
|
/** The ordered set of activities to present, one at a time. */
|
|
5
32
|
activities: ActivityData[];
|
|
6
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Renderers for activity types beyond the built-ins, keyed by `data.type`.
|
|
35
|
+
* A key matching a built-in overrides it, so a consumer can replace the
|
|
36
|
+
* bundled renderer without forking the sequencer.
|
|
37
|
+
*/
|
|
38
|
+
renderers?: Readonly<Record<string, ActivityRenderer>>;
|
|
39
|
+
/** Called whenever an individual activity is scored at submit time. */
|
|
7
40
|
onActivityComplete?: (result: ActivityResult, index: number) => void;
|
|
8
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Called once every activity has been completed, with the scored results.
|
|
43
|
+
*
|
|
44
|
+
* Fires only when EVERY item produced a score. A set containing a
|
|
45
|
+
* deferred-graded activity (a written response) can never satisfy that, so
|
|
46
|
+
* use `onFinished` for mixed sets — it is the general completion signal and
|
|
47
|
+
* reports both kinds of outcome.
|
|
48
|
+
*/
|
|
9
49
|
onComplete?: (results: ActivityResult[]) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called once every activity has been completed, whether it was scored at
|
|
52
|
+
* submit time or submitted for later grading. Use this for any set that
|
|
53
|
+
* mixes graded and deferred-graded activities.
|
|
54
|
+
*/
|
|
55
|
+
onFinished?: (items: SequenceItemOutcome[]) => void;
|
|
10
56
|
/** Forwarded to each activity. */
|
|
11
57
|
onInteraction?: (event: InteractionEvent) => void;
|
|
58
|
+
/** Forwarded to each activity. `exam` and `review` disable local scoring. */
|
|
59
|
+
renderMode?: RenderMode;
|
|
12
60
|
theme?: Partial<ThemeTokens>;
|
|
13
61
|
locale?: string;
|
|
14
62
|
disabled?: boolean;
|
|
@@ -20,6 +68,6 @@ interface ActivitySequenceProps {
|
|
|
20
68
|
* scoring. On navigation, focus moves to the question region and the position
|
|
21
69
|
* is announced via an aria-live region.
|
|
22
70
|
*/
|
|
23
|
-
declare function ActivitySequence({ activities, onActivityComplete, onComplete, onInteraction, theme, locale, disabled, }: ActivitySequenceProps): React.JSX.Element;
|
|
71
|
+
declare function ActivitySequence({ activities, renderers, onActivityComplete, onComplete, onFinished, onInteraction, renderMode, theme, locale, disabled, }: ActivitySequenceProps): React.JSX.Element;
|
|
24
72
|
|
|
25
|
-
export { ActivitySequence, type ActivitySequenceProps };
|
|
73
|
+
export { type ActivityRenderer, ActivitySequence, type ActivitySequenceProps, type SequenceItemOutcome };
|
|
@@ -1,14 +1,62 @@
|
|
|
1
1
|
import { ActivityData, ActivityResult, InteractionEvent, ThemeTokens } from '@intellectif/lk-core';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { A as ActivityProps, R as RenderMode } from '../types-CNmjqD6M.js';
|
|
4
|
+
import { a as WrittenResponseSubmission } from '../WrittenResponse-BHhP936i.js';
|
|
2
5
|
|
|
6
|
+
/**
|
|
7
|
+
* What one finished slot in a sequence produced. Two kinds, because two kinds
|
|
8
|
+
* of activity exist: those the SDK scores at submit time, and those a grader
|
|
9
|
+
* scores later. Collapsing them would mean inventing a score for ungraded
|
|
10
|
+
* work — the exact defect the deferred outcome exists to prevent.
|
|
11
|
+
*/
|
|
12
|
+
type SequenceItemOutcome = {
|
|
13
|
+
kind: 'scored';
|
|
14
|
+
index: number;
|
|
15
|
+
activityId: string;
|
|
16
|
+
result: ActivityResult;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'submitted';
|
|
19
|
+
index: number;
|
|
20
|
+
activityId: string;
|
|
21
|
+
/** Ungraded submission; the grade arrives asynchronously. */
|
|
22
|
+
submission: WrittenResponseSubmission;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A component that can render one activity inside a sequence. Register one per
|
|
26
|
+
* activity `type` to put a consumer-defined type on screen — the React half of
|
|
27
|
+
* the activity-type registry, matching `registerActivityType` in lk-core.
|
|
28
|
+
*/
|
|
29
|
+
type ActivityRenderer = ComponentType<ActivityProps>;
|
|
3
30
|
interface ActivitySequenceProps {
|
|
4
31
|
/** The ordered set of activities to present, one at a time. */
|
|
5
32
|
activities: ActivityData[];
|
|
6
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Renderers for activity types beyond the built-ins, keyed by `data.type`.
|
|
35
|
+
* A key matching a built-in overrides it, so a consumer can replace the
|
|
36
|
+
* bundled renderer without forking the sequencer.
|
|
37
|
+
*/
|
|
38
|
+
renderers?: Readonly<Record<string, ActivityRenderer>>;
|
|
39
|
+
/** Called whenever an individual activity is scored at submit time. */
|
|
7
40
|
onActivityComplete?: (result: ActivityResult, index: number) => void;
|
|
8
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Called once every activity has been completed, with the scored results.
|
|
43
|
+
*
|
|
44
|
+
* Fires only when EVERY item produced a score. A set containing a
|
|
45
|
+
* deferred-graded activity (a written response) can never satisfy that, so
|
|
46
|
+
* use `onFinished` for mixed sets — it is the general completion signal and
|
|
47
|
+
* reports both kinds of outcome.
|
|
48
|
+
*/
|
|
9
49
|
onComplete?: (results: ActivityResult[]) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called once every activity has been completed, whether it was scored at
|
|
52
|
+
* submit time or submitted for later grading. Use this for any set that
|
|
53
|
+
* mixes graded and deferred-graded activities.
|
|
54
|
+
*/
|
|
55
|
+
onFinished?: (items: SequenceItemOutcome[]) => void;
|
|
10
56
|
/** Forwarded to each activity. */
|
|
11
57
|
onInteraction?: (event: InteractionEvent) => void;
|
|
58
|
+
/** Forwarded to each activity. `exam` and `review` disable local scoring. */
|
|
59
|
+
renderMode?: RenderMode;
|
|
12
60
|
theme?: Partial<ThemeTokens>;
|
|
13
61
|
locale?: string;
|
|
14
62
|
disabled?: boolean;
|
|
@@ -20,6 +68,6 @@ interface ActivitySequenceProps {
|
|
|
20
68
|
* scoring. On navigation, focus moves to the question region and the position
|
|
21
69
|
* is announced via an aria-live region.
|
|
22
70
|
*/
|
|
23
|
-
declare function ActivitySequence({ activities, onActivityComplete, onComplete, onInteraction, theme, locale, disabled, }: ActivitySequenceProps): React.JSX.Element;
|
|
71
|
+
declare function ActivitySequence({ activities, renderers, onActivityComplete, onComplete, onFinished, onInteraction, renderMode, theme, locale, disabled, }: ActivitySequenceProps): React.JSX.Element;
|
|
24
72
|
|
|
25
|
-
export { ActivitySequence, type ActivitySequenceProps };
|
|
73
|
+
export { type ActivityRenderer, ActivitySequence, type ActivitySequenceProps, type SequenceItemOutcome };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { ActivitySequence } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { ActivitySequence } from '../chunk-BGWXN44S.js';
|
|
2
|
+
import '../chunk-ZVFWJTT4.js';
|
|
3
|
+
import '../chunk-3X7MYAFT.js';
|
|
4
|
+
import '../chunk-AEQQ7VPF.js';
|
|
4
5
|
import '../chunk-UIGIYYGY.js';
|
|
5
6
|
import '../chunk-5HVUKXF3.js';
|
|
6
7
|
//# sourceMappingURL=ActivitySequence.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkUXO6KYSZ_cjs = require('../chunk-UXO6KYSZ.cjs');
|
|
4
4
|
require('../chunk-QHOV2A6M.cjs');
|
|
5
5
|
require('../chunk-HD2AIQRD.cjs');
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ require('../chunk-HD2AIQRD.cjs');
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "FillInTheBlanks", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkUXO6KYSZ_cjs.FillInTheBlanks; }
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=FillInTheBlanks.cjs.map
|
|
14
14
|
//# sourceMappingURL=FillInTheBlanks.cjs.map
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { FillInTheBlanksData } from '@intellectif/lk-core';
|
|
3
|
-
import { A as ActivityProps } from '../types-
|
|
3
|
+
import { A as ActivityProps } from '../types-CNmjqD6M.cjs';
|
|
4
4
|
|
|
5
5
|
interface FillInTheBlanksProps extends ActivityProps<FillInTheBlanksData> {
|
|
6
6
|
/**
|
|
7
7
|
* After submission, replace each incorrectly-answered blank with its first
|
|
8
8
|
* accepted answer, styled distinctly (Req 5.7). Component-specific prop: it
|
|
9
9
|
* is presentation, not activity data, and is outside the fixed Req-3.1 set.
|
|
10
|
+
*
|
|
11
|
+
* Ignored in `exam` mode — revealing the key is precisely what an exam must
|
|
12
|
+
* not do, and on a `redact()` projection there is no key to reveal. In
|
|
13
|
+
* `review` mode it applies only to blanks the supplied `outcome` marks
|
|
14
|
+
* incorrect, and only when the caller passed data that still carries the key
|
|
15
|
+
* (e.g. `redact(data, { reveal: 'after-submit' })`).
|
|
10
16
|
*/
|
|
11
17
|
showCorrectAnswers?: boolean;
|
|
12
18
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { FillInTheBlanksData } from '@intellectif/lk-core';
|
|
3
|
-
import { A as ActivityProps } from '../types-
|
|
3
|
+
import { A as ActivityProps } from '../types-CNmjqD6M.js';
|
|
4
4
|
|
|
5
5
|
interface FillInTheBlanksProps extends ActivityProps<FillInTheBlanksData> {
|
|
6
6
|
/**
|
|
7
7
|
* After submission, replace each incorrectly-answered blank with its first
|
|
8
8
|
* accepted answer, styled distinctly (Req 5.7). Component-specific prop: it
|
|
9
9
|
* is presentation, not activity data, and is outside the fixed Req-3.1 set.
|
|
10
|
+
*
|
|
11
|
+
* Ignored in `exam` mode — revealing the key is precisely what an exam must
|
|
12
|
+
* not do, and on a `redact()` projection there is no key to reveal. In
|
|
13
|
+
* `review` mode it applies only to blanks the supplied `outcome` marks
|
|
14
|
+
* incorrect, and only when the caller passed data that still carries the key
|
|
15
|
+
* (e.g. `redact(data, { reveal: 'after-submit' })`).
|
|
10
16
|
*/
|
|
11
17
|
showCorrectAnswers?: boolean;
|
|
12
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkW6BH2YMZ_cjs = require('../chunk-W6BH2YMZ.cjs');
|
|
4
4
|
require('../chunk-QHOV2A6M.cjs');
|
|
5
5
|
require('../chunk-HD2AIQRD.cjs');
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ require('../chunk-HD2AIQRD.cjs');
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "MultipleChoice", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkW6BH2YMZ_cjs.MultipleChoice; }
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=MultipleChoice.cjs.map
|
|
14
14
|
//# sourceMappingURL=MultipleChoice.cjs.map
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { MultipleChoiceData } from '@intellectif/lk-core';
|
|
3
|
-
import { A as ActivityProps } from '../types-
|
|
3
|
+
import { A as ActivityProps } from '../types-CNmjqD6M.cjs';
|
|
4
|
+
|
|
5
|
+
interface MultipleChoiceProps extends ActivityProps<MultipleChoiceData> {
|
|
6
|
+
/**
|
|
7
|
+
* Seed for the deterministic option shuffle. Supply one (e.g. the attempt
|
|
8
|
+
* id) to make the shuffled order reproducible server-side, stable across
|
|
9
|
+
* page reloads, and identical between SSR and hydration. When absent, a
|
|
10
|
+
* random per-mount session seed is used (order stable within the mount
|
|
11
|
+
* only — the v1 behaviour).
|
|
12
|
+
*/
|
|
13
|
+
shuffleSeed?: string;
|
|
14
|
+
}
|
|
4
15
|
|
|
5
16
|
/**
|
|
6
17
|
* Public Multiple Choice activity: the core component wrapped in
|
|
7
18
|
* `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation
|
|
8
19
|
* throw) degrades to an accessible fallback instead of crashing the host.
|
|
9
20
|
*/
|
|
10
|
-
declare function MultipleChoice(props:
|
|
21
|
+
declare function MultipleChoice(props: MultipleChoiceProps): react_jsx_runtime.JSX.Element;
|
|
11
22
|
|
|
12
|
-
export {
|
|
23
|
+
export { MultipleChoice, type MultipleChoiceProps };
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { MultipleChoiceData } from '@intellectif/lk-core';
|
|
3
|
-
import { A as ActivityProps } from '../types-
|
|
3
|
+
import { A as ActivityProps } from '../types-CNmjqD6M.js';
|
|
4
|
+
|
|
5
|
+
interface MultipleChoiceProps extends ActivityProps<MultipleChoiceData> {
|
|
6
|
+
/**
|
|
7
|
+
* Seed for the deterministic option shuffle. Supply one (e.g. the attempt
|
|
8
|
+
* id) to make the shuffled order reproducible server-side, stable across
|
|
9
|
+
* page reloads, and identical between SSR and hydration. When absent, a
|
|
10
|
+
* random per-mount session seed is used (order stable within the mount
|
|
11
|
+
* only — the v1 behaviour).
|
|
12
|
+
*/
|
|
13
|
+
shuffleSeed?: string;
|
|
14
|
+
}
|
|
4
15
|
|
|
5
16
|
/**
|
|
6
17
|
* Public Multiple Choice activity: the core component wrapped in
|
|
7
18
|
* `ActivityErrorBoundary` so a render failure (incl. the dev schema-validation
|
|
8
19
|
* throw) degrades to an accessible fallback instead of crashing the host.
|
|
9
20
|
*/
|
|
10
|
-
declare function MultipleChoice(props:
|
|
21
|
+
declare function MultipleChoice(props: MultipleChoiceProps): react_jsx_runtime.JSX.Element;
|
|
11
22
|
|
|
12
|
-
export {
|
|
23
|
+
export { MultipleChoice, type MultipleChoiceProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7MW7HGOA_cjs = require('../chunk-7MW7HGOA.cjs');
|
|
4
4
|
require('../chunk-QHOV2A6M.cjs');
|
|
5
5
|
require('../chunk-HD2AIQRD.cjs');
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ require('../chunk-HD2AIQRD.cjs');
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "WrittenResponse", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunk7MW7HGOA_cjs.WrittenResponse; }
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=WrittenResponse.cjs.map
|
|
14
14
|
//# sourceMappingURL=WrittenResponse.cjs.map
|
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* DEFERRED (asynchronous AI/human grading), so there is no score here — and
|
|
7
|
-
* deliberately no fake one: an ungraded submission must never be shown or
|
|
8
|
-
* stored as a 0. The consumer persists `text` and grades it out-of-band.
|
|
9
|
-
*/
|
|
10
|
-
interface WrittenResponseSubmission {
|
|
11
|
-
/** The submitted text, verbatim. */
|
|
12
|
-
text: string;
|
|
13
|
-
/** Word count of `text`, recomputed with the canonical `countWords()`. */
|
|
14
|
-
wordCount: number;
|
|
15
|
-
/** Whether `wordCount` falls within the activity's `[minWords, maxWords]`. */
|
|
16
|
-
withinWordBounds: boolean;
|
|
17
|
-
/** Time in milliseconds from first interaction to submission. */
|
|
18
|
-
timeSpent: number;
|
|
19
|
-
/** The SUBMITTED-verb xAPI statement built for this submission (no score fields). */
|
|
20
|
-
xapiStatement: XAPIStatement;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Props for {@link WrittenResponse}. Mirrors `ActivityProps` except for the
|
|
24
|
-
* completion callback: a deferred-grading activity completes with a
|
|
25
|
-
* {@link WrittenResponseSubmission} (`onSubmitted`), not a scored
|
|
26
|
-
* `ActivityResult` (`onComplete`) — deviation from Req 22.8 recorded in the
|
|
27
|
-
* roadmap (§3.1): fabricating a score of 0 for ungraded work is the exact
|
|
28
|
-
* bug this type exists to fix.
|
|
29
|
-
*/
|
|
30
|
-
interface WrittenResponseProps {
|
|
31
|
-
data: WrittenResponseData;
|
|
32
|
-
onSubmitted: (submission: WrittenResponseSubmission) => void;
|
|
33
|
-
onInteraction?: (event: InteractionEvent) => void;
|
|
34
|
-
/** Per-instance token overrides, applied as inline CSS vars on the root. */
|
|
35
|
-
theme?: Partial<ThemeTokens>;
|
|
36
|
-
locale?: string;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
}
|
|
2
|
+
import { W as WrittenResponseProps } from '../WrittenResponse-B50EjVR0.cjs';
|
|
3
|
+
export { a as WrittenResponseSubmission } from '../WrittenResponse-B50EjVR0.cjs';
|
|
4
|
+
export { H as HtmlSanitizer, R as RenderMode, a as Renderable } from '../types-CNmjqD6M.cjs';
|
|
5
|
+
import '@intellectif/lk-core';
|
|
39
6
|
|
|
40
7
|
/**
|
|
41
8
|
* Public Written Response activity: a labelled textarea with a live word
|
|
@@ -45,4 +12,4 @@ interface WrittenResponseProps {
|
|
|
45
12
|
*/
|
|
46
13
|
declare function WrittenResponse(props: WrittenResponseProps): react_jsx_runtime.JSX.Element;
|
|
47
14
|
|
|
48
|
-
export { WrittenResponse,
|
|
15
|
+
export { WrittenResponse, WrittenResponseProps };
|
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* DEFERRED (asynchronous AI/human grading), so there is no score here — and
|
|
7
|
-
* deliberately no fake one: an ungraded submission must never be shown or
|
|
8
|
-
* stored as a 0. The consumer persists `text` and grades it out-of-band.
|
|
9
|
-
*/
|
|
10
|
-
interface WrittenResponseSubmission {
|
|
11
|
-
/** The submitted text, verbatim. */
|
|
12
|
-
text: string;
|
|
13
|
-
/** Word count of `text`, recomputed with the canonical `countWords()`. */
|
|
14
|
-
wordCount: number;
|
|
15
|
-
/** Whether `wordCount` falls within the activity's `[minWords, maxWords]`. */
|
|
16
|
-
withinWordBounds: boolean;
|
|
17
|
-
/** Time in milliseconds from first interaction to submission. */
|
|
18
|
-
timeSpent: number;
|
|
19
|
-
/** The SUBMITTED-verb xAPI statement built for this submission (no score fields). */
|
|
20
|
-
xapiStatement: XAPIStatement;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Props for {@link WrittenResponse}. Mirrors `ActivityProps` except for the
|
|
24
|
-
* completion callback: a deferred-grading activity completes with a
|
|
25
|
-
* {@link WrittenResponseSubmission} (`onSubmitted`), not a scored
|
|
26
|
-
* `ActivityResult` (`onComplete`) — deviation from Req 22.8 recorded in the
|
|
27
|
-
* roadmap (§3.1): fabricating a score of 0 for ungraded work is the exact
|
|
28
|
-
* bug this type exists to fix.
|
|
29
|
-
*/
|
|
30
|
-
interface WrittenResponseProps {
|
|
31
|
-
data: WrittenResponseData;
|
|
32
|
-
onSubmitted: (submission: WrittenResponseSubmission) => void;
|
|
33
|
-
onInteraction?: (event: InteractionEvent) => void;
|
|
34
|
-
/** Per-instance token overrides, applied as inline CSS vars on the root. */
|
|
35
|
-
theme?: Partial<ThemeTokens>;
|
|
36
|
-
locale?: string;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
}
|
|
2
|
+
import { W as WrittenResponseProps } from '../WrittenResponse-BHhP936i.js';
|
|
3
|
+
export { a as WrittenResponseSubmission } from '../WrittenResponse-BHhP936i.js';
|
|
4
|
+
export { H as HtmlSanitizer, R as RenderMode, a as Renderable } from '../types-CNmjqD6M.js';
|
|
5
|
+
import '@intellectif/lk-core';
|
|
39
6
|
|
|
40
7
|
/**
|
|
41
8
|
* Public Written Response activity: a labelled textarea with a live word
|
|
@@ -45,4 +12,4 @@ interface WrittenResponseProps {
|
|
|
45
12
|
*/
|
|
46
13
|
declare function WrittenResponse(props: WrittenResponseProps): react_jsx_runtime.JSX.Element;
|
|
47
14
|
|
|
48
|
-
export { WrittenResponse,
|
|
15
|
+
export { WrittenResponse, WrittenResponseProps };
|
package/dist/index.cjs
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkHO3AC3WQ_cjs = require('./chunk-HO3AC3WQ.cjs');
|
|
4
|
+
var chunkW6BH2YMZ_cjs = require('./chunk-W6BH2YMZ.cjs');
|
|
5
|
+
var chunkUXO6KYSZ_cjs = require('./chunk-UXO6KYSZ.cjs');
|
|
6
|
+
var chunk7MW7HGOA_cjs = require('./chunk-7MW7HGOA.cjs');
|
|
7
7
|
require('./chunk-QHOV2A6M.cjs');
|
|
8
8
|
var chunkHD2AIQRD_cjs = require('./chunk-HD2AIQRD.cjs');
|
|
9
9
|
var chunkIYLQSNLE_cjs = require('./chunk-IYLQSNLE.cjs');
|
|
10
10
|
var chunkCPF2JJG6_cjs = require('./chunk-CPF2JJG6.cjs');
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/components/types.ts
|
|
13
|
+
function asRenderable(redacted) {
|
|
14
|
+
return redacted;
|
|
15
|
+
}
|
|
13
16
|
|
|
14
17
|
Object.defineProperty(exports, "ActivitySequence", {
|
|
15
18
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkHO3AC3WQ_cjs.ActivitySequence; }
|
|
17
20
|
});
|
|
18
21
|
Object.defineProperty(exports, "MultipleChoice", {
|
|
19
22
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkW6BH2YMZ_cjs.MultipleChoice; }
|
|
21
24
|
});
|
|
22
25
|
Object.defineProperty(exports, "FillInTheBlanks", {
|
|
23
26
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkUXO6KYSZ_cjs.FillInTheBlanks; }
|
|
25
28
|
});
|
|
26
29
|
Object.defineProperty(exports, "WrittenResponse", {
|
|
27
30
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk7MW7HGOA_cjs.WrittenResponse; }
|
|
29
32
|
});
|
|
30
33
|
Object.defineProperty(exports, "useActivityState", {
|
|
31
34
|
enumerable: true,
|
|
@@ -51,5 +54,6 @@ Object.defineProperty(exports, "useTheme", {
|
|
|
51
54
|
enumerable: true,
|
|
52
55
|
get: function () { return chunkCPF2JJG6_cjs.useTheme; }
|
|
53
56
|
});
|
|
57
|
+
exports.asRenderable = asRenderable;
|
|
54
58
|
//# sourceMappingURL=index.cjs.map
|
|
55
59
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
1
|
+
{"version":3,"sources":["../src/components/types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAqHO,SAAS,aACd,QAAA,EACmB;AACnB,EAAA,OAAO,QAAA;AACT","file":"index.cjs","sourcesContent":["import type {\n ActivityData,\n ActivityResult,\n InteractionEvent,\n ItemOutcome,\n LearnerResponse,\n RedactedActivityData,\n ThemeTokens,\n} from '@intellectif/lk-core';\n\n/**\n * How an activity is being presented. This is the single switch that decides\n * whether the component may grade, reveal, or submit — the three things a\n * summative exam must take away from the client.\n *\n * - `practice` (default, v1 behaviour): the component owns the attempt. It\n * scores locally on submit, reveals correctness and feedback, and calls\n * `onComplete` with a full {@link ActivityResult}.\n * - `exam`: the component NEVER scores and NEVER reveals correctness. Submit\n * emits the raw learner response through `onSubmit`; the server grades it.\n * Safe to render redacted data, because nothing here needs the answer key.\n * - `review`: read-only. Renders the learner's submitted answer, and marks\n * correctness only from an `outcome` the caller supplies (which the server\n * computed). Nothing is submittable.\n */\nexport type RenderMode = 'practice' | 'exam' | 'review';\n\n/**\n * Makes the answer-key-bearing parts of an activity optional, so a component\n * can render either full activity data OR a `redact()` projection with the\n * same props. Fields the SDK classifies `answer-key` become optional here;\n * a component in `exam` mode must not read them at all.\n */\nexport type Renderable<TData> = Omit<TData, 'scoringStrategy'> & {\n scoringStrategy?: unknown;\n /** Present on a `redact()` projection. */\n redacted?: true;\n};\n\n/**\n * Sanitiser for author-supplied rich text (`questionHtml`, `passageHtml`,\n * `promptHtml`). The SDK deliberately ships NO sanitiser — that would add a\n * dependency and, worse, a false promise. Rich text is rendered only when you\n * supply this function; without it the component falls back to the plain-text\n * field, which is always escaped. Fail-safe by construction: the SDK never\n * injects HTML it was not explicitly given a sanitiser for.\n */\nexport type HtmlSanitizer = (html: string) => string;\n\n/**\n * The prop contract shared by every activity component (Req 3.1). Defined\n * here (React-specific) rather than in lk-core, which is React-free.\n *\n * Controlled / uncontrolled follows the React convention: pass `value` +\n * `onChange` to own the learner's answer (restore an in-progress attempt,\n * autosave a delta, drive a review); pass `defaultValue` to seed an\n * uncontrolled component; pass neither for the v1 behaviour.\n */\nexport interface ActivityProps<TData extends ActivityData = ActivityData> {\n /** Activity content. Accepts a `redact()` projection in `exam` mode. */\n data: Renderable<TData>;\n /**\n * Called when the component scored the attempt itself. Only ever fires in\n * `practice` mode — in `exam` mode the client does not grade, so there is\n * no `ActivityResult` to give you; use `onSubmit`.\n */\n onComplete?: (result: ActivityResult) => void;\n /**\n * Called on submit with the raw learner response and no grade. Fires in\n * every mode, before `onComplete`, so an exam runner can persist the\n * response and let the server score it.\n */\n onSubmit?: (response: LearnerResponse) => void;\n /** Controlled value: the learner's current response. */\n value?: LearnerResponse;\n /** Initial response for an uncontrolled component (ignored when `value` is set). */\n defaultValue?: LearnerResponse;\n /** Fires on every change to the learner's response. Required for a controlled component. */\n onChange?: (response: LearnerResponse) => void;\n /** Presentation mode. Defaults to `practice`. */\n renderMode?: RenderMode;\n /**\n * Server-computed outcome, used by `review` mode to mark correctness\n * without the client ever scoring. Ignored in other modes.\n */\n outcome?: ItemOutcome;\n /** Renders author-supplied rich text when provided. See {@link HtmlSanitizer}. */\n sanitizeHtml?: HtmlSanitizer;\n onInteraction?: (event: InteractionEvent) => void;\n /** Per-instance token overrides, applied as inline CSS vars on the root. */\n theme?: Partial<ThemeTokens>;\n locale?: string;\n disabled?: boolean;\n}\n\n/**\n * Bridges a server-produced `redact()` projection into the `data` prop.\n *\n * `RedactedActivityData` is deliberately index-signature typed in lk-core — it\n * proves a payload is learner-safe, not what shape it has — so TypeScript\n * cannot know it still carries the public fields a renderer needs. This is the\n * SDK's single, documented crossing of that gap, so an exam runner does not\n * have to write `as unknown as` at every call site:\n *\n * ```tsx\n * <MultipleChoice\n * data={asRenderable<MultipleChoiceData>(redactedFromServer)}\n * renderMode=\"exam\"\n * onSubmit={persist}\n * />\n * ```\n *\n * Safe because `exam` mode reads only public fields; the answer-key fields the\n * type claims are exactly the ones the component is forbidden to touch there.\n * A future release will derive per-type redacted interfaces so this becomes\n * unnecessary.\n */\nexport function asRenderable<TData extends ActivityData>(\n redacted: RedactedActivityData,\n): Renderable<TData> {\n return redacted as unknown as Renderable<TData>;\n}\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { ActivitySequence, ActivitySequenceProps } from './components/ActivitySequence.cjs';
|
|
1
|
+
export { ActivityRenderer, ActivitySequence, ActivitySequenceProps, SequenceItemOutcome } from './components/ActivitySequence.cjs';
|
|
2
2
|
export { FillInTheBlanks, FillInTheBlanksProps } from './components/FillInTheBlanks.cjs';
|
|
3
|
-
export { MultipleChoice } from './components/MultipleChoice.cjs';
|
|
4
|
-
export {
|
|
3
|
+
export { MultipleChoice, MultipleChoiceProps } from './components/MultipleChoice.cjs';
|
|
4
|
+
export { A as ActivityProps, H as HtmlSanitizer, R as RenderMode, a as Renderable, b as asRenderable } from './types-CNmjqD6M.cjs';
|
|
5
|
+
export { WrittenResponse } from './components/WrittenResponse.cjs';
|
|
5
6
|
export { ActivityState, UseActivityStateResult, useActivityState } from './hooks/useActivityState.cjs';
|
|
6
7
|
export { UseXAPIResult, useXAPI } from './hooks/useXAPI.cjs';
|
|
7
8
|
export { ThemeProvider, ThemeProviderProps, darkTheme, defaultTheme, useTheme } from './theme/ThemeProvider.cjs';
|
|
8
|
-
export {
|
|
9
|
+
export { W as WrittenResponseProps, a as WrittenResponseSubmission } from './WrittenResponse-B50EjVR0.cjs';
|
|
9
10
|
import '@intellectif/lk-core';
|
|
10
|
-
import 'react/jsx-runtime';
|
|
11
11
|
import 'react';
|
|
12
|
+
import 'react/jsx-runtime';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { ActivitySequence, ActivitySequenceProps } from './components/ActivitySequence.js';
|
|
1
|
+
export { ActivityRenderer, ActivitySequence, ActivitySequenceProps, SequenceItemOutcome } from './components/ActivitySequence.js';
|
|
2
2
|
export { FillInTheBlanks, FillInTheBlanksProps } from './components/FillInTheBlanks.js';
|
|
3
|
-
export { MultipleChoice } from './components/MultipleChoice.js';
|
|
4
|
-
export {
|
|
3
|
+
export { MultipleChoice, MultipleChoiceProps } from './components/MultipleChoice.js';
|
|
4
|
+
export { A as ActivityProps, H as HtmlSanitizer, R as RenderMode, a as Renderable, b as asRenderable } from './types-CNmjqD6M.js';
|
|
5
|
+
export { WrittenResponse } from './components/WrittenResponse.js';
|
|
5
6
|
export { ActivityState, UseActivityStateResult, useActivityState } from './hooks/useActivityState.js';
|
|
6
7
|
export { UseXAPIResult, useXAPI } from './hooks/useXAPI.js';
|
|
7
8
|
export { ThemeProvider, ThemeProviderProps, darkTheme, defaultTheme, useTheme } from './theme/ThemeProvider.js';
|
|
8
|
-
export {
|
|
9
|
+
export { W as WrittenResponseProps, a as WrittenResponseSubmission } from './WrittenResponse-BHhP936i.js';
|
|
9
10
|
import '@intellectif/lk-core';
|
|
10
|
-
import 'react/jsx-runtime';
|
|
11
11
|
import 'react';
|
|
12
|
+
import 'react/jsx-runtime';
|