@qti-components/delivery 0.1.0-next.5 → 0.1.0-next.7

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/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './model/item-facts.js';
3
3
  export type { XmlElement, XmlNode } from './model/xml-node.js';
4
4
  export * from './lifecycle/item-lifecycle.js';
5
5
  export * from './lifecycle/item-rules.js';
6
+ export * from './lifecycle/item-session.js';
6
7
  export * from './random/seeded-random.js';
7
8
  export * from './random/selection.js';
8
9
  export * from './random/shuffle.js';
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export * from './model/test-model.js';
2
2
  export * from './model/item-facts.js';
3
3
  export * from './lifecycle/item-lifecycle.js';
4
4
  export * from './lifecycle/item-rules.js';
5
+ export * from './lifecycle/item-session.js';
5
6
  export * from './random/seeded-random.js';
6
7
  export * from './random/selection.js';
7
8
  export * from './random/shuffle.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './model/test-model.js';\nexport * from './model/item-facts.js';\nexport type { XmlElement, XmlNode } from './model/xml-node.js';\nexport * from './lifecycle/item-lifecycle.js';\nexport * from './lifecycle/item-rules.js';\nexport * from './random/seeded-random.js';\nexport * from './random/selection.js';\nexport * from './random/shuffle.js';\nexport * from './state/clock.js';\nexport * from './state/commands.js';\nexport * from './state/create-delivery-state.js';\nexport * from './state/delivery-state.js';\nexport * from './processing.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './model/test-model.js';\nexport * from './model/item-facts.js';\nexport type { XmlElement, XmlNode } from './model/xml-node.js';\nexport * from './lifecycle/item-lifecycle.js';\nexport * from './lifecycle/item-rules.js';\nexport * from './lifecycle/item-session.js';\nexport * from './random/seeded-random.js';\nexport * from './random/selection.js';\nexport * from './random/shuffle.js';\nexport * from './state/clock.js';\nexport * from './state/commands.js';\nexport * from './state/create-delivery-state.js';\nexport * from './state/delivery-state.js';\nexport * from './processing.js';\n"]}
@@ -92,3 +92,17 @@ export interface ItemLifecycleInput {
92
92
  export declare function hasAttemptsLeft({ sessionControl: { maxAttempts }, adaptive, numAttempts, completionStatus }: Pick<ItemLifecycleInput, 'sessionControl' | 'adaptive' | 'numAttempts' | 'completionStatus'>): boolean;
93
93
  /** The guards of one item session, from its session control, its facts, its part and its variables. */
94
94
  export declare function itemLifecycleGuards(input: ItemLifecycleInput): ItemLifecycleGuards;
95
+ /** What a version 1 state, or a test restored from one, tells about an item session. */
96
+ export interface ItemLifecycleSeedInput extends Pick<ItemLifecycleInput, 'sessionControl' | 'adaptive' | 'numAttempts' | 'completionStatus'> {
97
+ /** The item is on screen: the current item, or one of the section on screen with `navigate="section"`. */
98
+ presented: boolean;
99
+ /** The item comes before the current one in a linear part: the candidate has left it for good. */
100
+ passed: boolean;
101
+ }
102
+ /**
103
+ * The lifecycle state of an item session that has none stored: a version 1 state, or a test restored
104
+ * or assigned from one (`plans/item-lifecycle.md`). Closed when no attempt is left or a linear part
105
+ * has passed it; interacting when it is on screen; initial before its first ended attempt; else
106
+ * suspended. Never `modalFeedback`, `review` or `solution`: a version 1 state cannot tell them apart.
107
+ */
108
+ export declare function seedItemLifecycle(input: ItemLifecycleSeedInput): ItemLifecycleState;
@@ -141,4 +141,17 @@ export function itemLifecycleGuards(input) {
141
141
  showSolution: input.sessionControl.showSolution
142
142
  };
143
143
  }
144
+ /**
145
+ * The lifecycle state of an item session that has none stored: a version 1 state, or a test restored
146
+ * or assigned from one (`plans/item-lifecycle.md`). Closed when no attempt is left or a linear part
147
+ * has passed it; interacting when it is on screen; initial before its first ended attempt; else
148
+ * suspended. Never `modalFeedback`, `review` or `solution`: a version 1 state cannot tell them apart.
149
+ */
150
+ export function seedItemLifecycle(input) {
151
+ if (!hasAttemptsLeft(input) || input.passed)
152
+ return 'closed';
153
+ if (input.presented)
154
+ return 'interacting';
155
+ return input.numAttempts === 0 ? 'initial' : 'suspended';
156
+ }
144
157
  //# sourceMappingURL=item-lifecycle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item-lifecycle.js","sourceRoot":"","sources":["../../src/lifecycle/item-lifecycle.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,aAAa;IACb,eAAe;IACf,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;CACF,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,cAAc;IACd,YAAY;IACZ,qBAAqB;IACrB,uBAAuB;IACvB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,eAAe;IACf,aAAa;CACL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Aa,EAAE,KAAK,CAAC,aAAa;QAClC,6FAA6F;QAC7F,SAAS,EAAE,KAAK,CAAC,cAAc,KAAK,WAAW,IAAI,CAAC,KAAK,CAAC,IAAI;QAC9D,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW;QAC7C,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY;KAChD,CAAC;AACJ,CAAC","sourcesContent":["import type { SessionControl, TestPartModel } from '../model/test-model.js';\n\n/**\n * The item session lifecycle (QTI 3 info model §2.2.1, Figure 2.1) as one finite state machine per\n * item instance: every item session is in exactly one of these states, and only the transitions in\n * `ITEM_LIFECYCLE` happen. Each rule of item session control is a guard on one of them.\n *\n * ```mermaid\n * stateDiagram-v2\n * [*] --> initial\n * initial --> interacting: beginAttempt [attemptsLeft]\n * initial --> closed: endItemSession\n * interacting --> closed: endAttempt [individualSubmission, no attemptsLeft]\n * interacting --> modalFeedback: endAttempt [individualSubmission, attemptsLeft, modalFeedback]\n * interacting --> interacting: endAttempt [individualSubmission, attemptsLeft]\n * interacting --> suspended: endCandidateSession\n * interacting --> closed: endItemSession\n * modalFeedback --> interacting: beginAttempt [attemptsLeft]\n * modalFeedback --> suspended: endCandidateSession\n * modalFeedback --> closed: endItemSession\n * suspended --> interacting: beginCandidateSession [mayResume]\n * suspended --> closed: endItemSession\n * closed --> review: beginReview [allowReview]\n * review --> closed: endReview\n * closed --> solution: beginSolution [showSolution]\n * solution --> closed: endSolution\n * ```\n *\n * What QTI ties to the states: interactions are enabled in `interacting` only; in `closed` and\n * `review` the responses show but are fixed; in `solution` the correct responses show instead. An\n * item that goes from `initial` straight to `closed` keeps NULL responses.\n *\n * The text of §2.2.1 names six states; `modalFeedback` comes from its figure (Figure 2.1, as this\n * plan reads it): the item after an attempt whose response processing set modal feedback, with\n * attempts left (\"modal feedback is shown to the candidate directly following response\n * processing\", §2.6). The candidate reads it before trying again.\n *\n * Experimental (0.x): roadmap 1 phase T3; see `plans/delivery-state.md`.\n */\nexport const ITEM_LIFECYCLE_STATES = [\n 'initial',\n 'interacting',\n 'modalFeedback',\n 'suspended',\n 'closed',\n 'review',\n 'solution'\n] as const;\n\nexport type ItemLifecycleState = (typeof ITEM_LIFECYCLE_STATES)[number];\n\n/**\n * What happens to an item session, in QTI's words (info model §2.2.1). The delivery's commands\n * (`navigate`, `beginAttempt`, `endAttempt`, `endTestPart`, `timeUp`) are turned into these, per item.\n */\nexport const ITEM_LIFECYCLE_EVENTS = [\n 'beginAttempt',\n 'endAttempt',\n 'endCandidateSession',\n 'beginCandidateSession',\n 'endItemSession',\n 'beginReview',\n 'endReview',\n 'beginSolution',\n 'endSolution'\n] as const;\n\nexport type ItemLifecycleEvent = (typeof ITEM_LIFECYCLE_EVENTS)[number];\n\n/** The conditions a transition can depend on; `itemLifecycleGuards` reads them for one item. */\nexport const ITEM_LIFECYCLE_GUARDS = [\n 'attemptsLeft',\n 'individualSubmission',\n 'modalFeedback',\n 'mayResume',\n 'allowReview',\n 'showSolution'\n] as const;\n\nexport type ItemLifecycleGuard = (typeof ITEM_LIFECYCLE_GUARDS)[number];\n\nexport type ItemLifecycleGuards = Readonly<Record<ItemLifecycleGuard, boolean>>;\n\n/** One way out of a state: taken when every `when` guard holds and no `unless` guard does. */\nexport interface ItemLifecycleBranch {\n readonly to: ItemLifecycleState;\n readonly when?: readonly ItemLifecycleGuard[];\n readonly unless?: readonly ItemLifecycleGuard[];\n}\n\n/** A state with no guard, or branches tried in order, the first that holds taken. */\nexport type ItemLifecycleTarget = ItemLifecycleState | readonly ItemLifecycleBranch[];\n\n/** The transition table: a pair it does not list is refused. */\nexport const ITEM_LIFECYCLE: Readonly<\n Record<ItemLifecycleState, Readonly<Partial<Record<ItemLifecycleEvent, ItemLifecycleTarget>>>>\n> = {\n initial: {\n beginAttempt: [{ to: 'interacting', when: ['attemptsLeft'] }],\n endItemSession: 'closed'\n },\n interacting: {\n // The guards are read after response processing, with the ended attempt counted.\n endAttempt: [\n { to: 'closed', when: ['individualSubmission'], unless: ['attemptsLeft'] },\n { to: 'modalFeedback', when: ['individualSubmission', 'attemptsLeft', 'modalFeedback'] },\n { to: 'interacting', when: ['individualSubmission', 'attemptsLeft'] }\n ],\n endCandidateSession: 'suspended',\n endItemSession: 'closed'\n },\n modalFeedback: {\n beginAttempt: [{ to: 'interacting', when: ['attemptsLeft'] }],\n endCandidateSession: 'suspended',\n endItemSession: 'closed'\n },\n suspended: {\n beginCandidateSession: [{ to: 'interacting', when: ['mayResume'] }],\n endItemSession: 'closed'\n },\n closed: {\n beginReview: [{ to: 'review', when: ['allowReview'] }],\n beginSolution: [{ to: 'solution', when: ['showSolution'] }]\n },\n review: {\n endReview: 'closed'\n },\n solution: {\n endSolution: 'closed'\n }\n};\n\n/**\n * The state an item session goes to on `event`, or null when the table refuses it: the pair is not\n * listed, or no branch's guards hold. Pure: the same state, event and guards give the same answer\n * on every runtime.\n */\nexport function transition(\n state: ItemLifecycleState,\n event: ItemLifecycleEvent,\n guards: ItemLifecycleGuards\n): ItemLifecycleState | null {\n const target = ITEM_LIFECYCLE[state][event];\n if (target === undefined) return null;\n if (typeof target === 'string') return target;\n const branch = target.find(\n ({ when = [], unless = [] }) => when.every(guard => guards[guard]) && !unless.some(guard => guards[guard])\n );\n return branch?.to ?? null;\n}\n\n/** What the guards of one item session are read from. */\nexport interface ItemLifecycleInput {\n /** The item-ref's resolved session control (`ItemRefModel.sessionControl`). */\n sessionControl: Pick<SessionControl, 'maxAttempts' | 'allowReview' | 'showSolution'>;\n /** From the item's facts (`ItemFacts.adaptive`). */\n adaptive: boolean;\n navigationMode: TestPartModel['navigationMode'];\n submissionMode: TestPartModel['submissionMode'];\n /**\n * The attempts the candidate has ended. QTI's `numAttempts` counts an attempt as it begins; this\n * delivery counts it when it ends, and T3d keeps that (`plans/item-lifecycle.md`).\n */\n numAttempts: number;\n /** The item's `completionStatus` (`not_attempted`, `unknown`, `incomplete`, `completed`). */\n completionStatus: string | null;\n /** The candidate has moved on from the item; in a linear part there is no way back. */\n left: boolean;\n /** The last response processing set modal feedback to show. */\n modalFeedback: boolean;\n}\n\n/**\n * Whether another attempt is allowed (implementation guide §4.4.2.1): a non-adaptive item until it\n * has used `max-attempts` (0 is unlimited); an adaptive item, which ignores `max-attempts`, until its\n * response processing set `completionStatus` to `completed`.\n */\nexport function hasAttemptsLeft({\n sessionControl: { maxAttempts },\n adaptive,\n numAttempts,\n completionStatus\n}: Pick<ItemLifecycleInput, 'sessionControl' | 'adaptive' | 'numAttempts' | 'completionStatus'>): boolean {\n if (adaptive) return completionStatus !== 'completed';\n return maxAttempts === 0 || numAttempts < maxAttempts;\n}\n\n/** The guards of one item session, from its session control, its facts, its part and its variables. */\nexport function itemLifecycleGuards(input: ItemLifecycleInput): ItemLifecycleGuards {\n return {\n attemptsLeft: hasAttemptsLeft(input),\n // In a simultaneous part every response is processed when the part is submitted (§4.1).\n individualSubmission: input.submissionMode === 'individual',\n modalFeedback: input.modalFeedback,\n // A linear part restricts the candidate to each item in turn: once left, never again (§4.1).\n mayResume: input.navigationMode === 'nonlinear' || !input.left,\n allowReview: input.sessionControl.allowReview,\n showSolution: input.sessionControl.showSolution\n };\n}\n"]}
1
+ {"version":3,"file":"item-lifecycle.js","sourceRoot":"","sources":["../../src/lifecycle/item-lifecycle.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,aAAa;IACb,eAAe;IACf,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;CACF,CAAC;AAIX;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,cAAc;IACd,YAAY;IACZ,qBAAqB;IACrB,uBAAuB;IACvB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,eAAe;IACf,aAAa;CACL,CAAC;AAIX,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,cAAc;IACd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Ac,KAAK,WAAW,IAAI,CAAC,KAAK,CAAC,IAAI;QAC9D,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW;QAC7C,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY;KAChD,CAAC;AACJ,CAAC;AAWD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;IAC7D,IAAI,KAAK,CAAC,SAAS;QAAE,OAAO,aAAa,CAAC;IAC1C,OAAO,KAAK,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;AAC3D,CAAC","sourcesContent":["import type { SessionControl, TestPartModel } from '../model/test-model.js';\n\n/**\n * The item session lifecycle (QTI 3 info model §2.2.1, Figure 2.1) as one finite state machine per\n * item instance: every item session is in exactly one of these states, and only the transitions in\n * `ITEM_LIFECYCLE` happen. Each rule of item session control is a guard on one of them.\n *\n * ```mermaid\n * stateDiagram-v2\n * [*] --> initial\n * initial --> interacting: beginAttempt [attemptsLeft]\n * initial --> closed: endItemSession\n * interacting --> closed: endAttempt [individualSubmission, no attemptsLeft]\n * interacting --> modalFeedback: endAttempt [individualSubmission, attemptsLeft, modalFeedback]\n * interacting --> interacting: endAttempt [individualSubmission, attemptsLeft]\n * interacting --> suspended: endCandidateSession\n * interacting --> closed: endItemSession\n * modalFeedback --> interacting: beginAttempt [attemptsLeft]\n * modalFeedback --> suspended: endCandidateSession\n * modalFeedback --> closed: endItemSession\n * suspended --> interacting: beginCandidateSession [mayResume]\n * suspended --> closed: endItemSession\n * closed --> review: beginReview [allowReview]\n * review --> closed: endReview\n * closed --> solution: beginSolution [showSolution]\n * solution --> closed: endSolution\n * ```\n *\n * What QTI ties to the states: interactions are enabled in `interacting` only; in `closed` and\n * `review` the responses show but are fixed; in `solution` the correct responses show instead. An\n * item that goes from `initial` straight to `closed` keeps NULL responses.\n *\n * The text of §2.2.1 names six states; `modalFeedback` comes from its figure (Figure 2.1, as this\n * plan reads it): the item after an attempt whose response processing set modal feedback, with\n * attempts left (\"modal feedback is shown to the candidate directly following response\n * processing\", §2.6). The candidate reads it before trying again.\n *\n * Experimental (0.x): roadmap 1 phase T3; see `plans/delivery-state.md`.\n */\nexport const ITEM_LIFECYCLE_STATES = [\n 'initial',\n 'interacting',\n 'modalFeedback',\n 'suspended',\n 'closed',\n 'review',\n 'solution'\n] as const;\n\nexport type ItemLifecycleState = (typeof ITEM_LIFECYCLE_STATES)[number];\n\n/**\n * What happens to an item session, in QTI's words (info model §2.2.1). The delivery's commands\n * (`navigate`, `beginAttempt`, `endAttempt`, `endTestPart`, `timeUp`) are turned into these, per item.\n */\nexport const ITEM_LIFECYCLE_EVENTS = [\n 'beginAttempt',\n 'endAttempt',\n 'endCandidateSession',\n 'beginCandidateSession',\n 'endItemSession',\n 'beginReview',\n 'endReview',\n 'beginSolution',\n 'endSolution'\n] as const;\n\nexport type ItemLifecycleEvent = (typeof ITEM_LIFECYCLE_EVENTS)[number];\n\n/** The conditions a transition can depend on; `itemLifecycleGuards` reads them for one item. */\nexport const ITEM_LIFECYCLE_GUARDS = [\n 'attemptsLeft',\n 'individualSubmission',\n 'modalFeedback',\n 'mayResume',\n 'allowReview',\n 'showSolution'\n] as const;\n\nexport type ItemLifecycleGuard = (typeof ITEM_LIFECYCLE_GUARDS)[number];\n\nexport type ItemLifecycleGuards = Readonly<Record<ItemLifecycleGuard, boolean>>;\n\n/** One way out of a state: taken when every `when` guard holds and no `unless` guard does. */\nexport interface ItemLifecycleBranch {\n readonly to: ItemLifecycleState;\n readonly when?: readonly ItemLifecycleGuard[];\n readonly unless?: readonly ItemLifecycleGuard[];\n}\n\n/** A state with no guard, or branches tried in order, the first that holds taken. */\nexport type ItemLifecycleTarget = ItemLifecycleState | readonly ItemLifecycleBranch[];\n\n/** The transition table: a pair it does not list is refused. */\nexport const ITEM_LIFECYCLE: Readonly<\n Record<ItemLifecycleState, Readonly<Partial<Record<ItemLifecycleEvent, ItemLifecycleTarget>>>>\n> = {\n initial: {\n beginAttempt: [{ to: 'interacting', when: ['attemptsLeft'] }],\n endItemSession: 'closed'\n },\n interacting: {\n // The guards are read after response processing, with the ended attempt counted.\n endAttempt: [\n { to: 'closed', when: ['individualSubmission'], unless: ['attemptsLeft'] },\n { to: 'modalFeedback', when: ['individualSubmission', 'attemptsLeft', 'modalFeedback'] },\n { to: 'interacting', when: ['individualSubmission', 'attemptsLeft'] }\n ],\n endCandidateSession: 'suspended',\n endItemSession: 'closed'\n },\n modalFeedback: {\n beginAttempt: [{ to: 'interacting', when: ['attemptsLeft'] }],\n endCandidateSession: 'suspended',\n endItemSession: 'closed'\n },\n suspended: {\n beginCandidateSession: [{ to: 'interacting', when: ['mayResume'] }],\n endItemSession: 'closed'\n },\n closed: {\n beginReview: [{ to: 'review', when: ['allowReview'] }],\n beginSolution: [{ to: 'solution', when: ['showSolution'] }]\n },\n review: {\n endReview: 'closed'\n },\n solution: {\n endSolution: 'closed'\n }\n};\n\n/**\n * The state an item session goes to on `event`, or null when the table refuses it: the pair is not\n * listed, or no branch's guards hold. Pure: the same state, event and guards give the same answer\n * on every runtime.\n */\nexport function transition(\n state: ItemLifecycleState,\n event: ItemLifecycleEvent,\n guards: ItemLifecycleGuards\n): ItemLifecycleState | null {\n const target = ITEM_LIFECYCLE[state][event];\n if (target === undefined) return null;\n if (typeof target === 'string') return target;\n const branch = target.find(\n ({ when = [], unless = [] }) => when.every(guard => guards[guard]) && !unless.some(guard => guards[guard])\n );\n return branch?.to ?? null;\n}\n\n/** What the guards of one item session are read from. */\nexport interface ItemLifecycleInput {\n /** The item-ref's resolved session control (`ItemRefModel.sessionControl`). */\n sessionControl: Pick<SessionControl, 'maxAttempts' | 'allowReview' | 'showSolution'>;\n /** From the item's facts (`ItemFacts.adaptive`). */\n adaptive: boolean;\n navigationMode: TestPartModel['navigationMode'];\n submissionMode: TestPartModel['submissionMode'];\n /**\n * The attempts the candidate has ended. QTI's `numAttempts` counts an attempt as it begins; this\n * delivery counts it when it ends, and T3d keeps that (`plans/item-lifecycle.md`).\n */\n numAttempts: number;\n /** The item's `completionStatus` (`not_attempted`, `unknown`, `incomplete`, `completed`). */\n completionStatus: string | null;\n /** The candidate has moved on from the item; in a linear part there is no way back. */\n left: boolean;\n /** The last response processing set modal feedback to show. */\n modalFeedback: boolean;\n}\n\n/**\n * Whether another attempt is allowed (implementation guide §4.4.2.1): a non-adaptive item until it\n * has used `max-attempts` (0 is unlimited); an adaptive item, which ignores `max-attempts`, until its\n * response processing set `completionStatus` to `completed`.\n */\nexport function hasAttemptsLeft({\n sessionControl: { maxAttempts },\n adaptive,\n numAttempts,\n completionStatus\n}: Pick<ItemLifecycleInput, 'sessionControl' | 'adaptive' | 'numAttempts' | 'completionStatus'>): boolean {\n if (adaptive) return completionStatus !== 'completed';\n return maxAttempts === 0 || numAttempts < maxAttempts;\n}\n\n/** The guards of one item session, from its session control, its facts, its part and its variables. */\nexport function itemLifecycleGuards(input: ItemLifecycleInput): ItemLifecycleGuards {\n return {\n attemptsLeft: hasAttemptsLeft(input),\n // In a simultaneous part every response is processed when the part is submitted (§4.1).\n individualSubmission: input.submissionMode === 'individual',\n modalFeedback: input.modalFeedback,\n // A linear part restricts the candidate to each item in turn: once left, never again (§4.1).\n mayResume: input.navigationMode === 'nonlinear' || !input.left,\n allowReview: input.sessionControl.allowReview,\n showSolution: input.sessionControl.showSolution\n };\n}\n\n/** What a version 1 state, or a test restored from one, tells about an item session. */\nexport interface ItemLifecycleSeedInput\n extends Pick<ItemLifecycleInput, 'sessionControl' | 'adaptive' | 'numAttempts' | 'completionStatus'> {\n /** The item is on screen: the current item, or one of the section on screen with `navigate=\"section\"`. */\n presented: boolean;\n /** The item comes before the current one in a linear part: the candidate has left it for good. */\n passed: boolean;\n}\n\n/**\n * The lifecycle state of an item session that has none stored: a version 1 state, or a test restored\n * or assigned from one (`plans/item-lifecycle.md`). Closed when no attempt is left or a linear part\n * has passed it; interacting when it is on screen; initial before its first ended attempt; else\n * suspended. Never `modalFeedback`, `review` or `solution`: a version 1 state cannot tell them apart.\n */\nexport function seedItemLifecycle(input: ItemLifecycleSeedInput): ItemLifecycleState {\n if (!hasAttemptsLeft(input) || input.passed) return 'closed';\n if (input.presented) return 'interacting';\n return input.numAttempts === 0 ? 'initial' : 'suspended';\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import type { ItemLifecycleInput, ItemLifecycleSeedInput, ItemLifecycleState } from './item-lifecycle.js';
2
+ /** One item session as a delivery keeps it between updates: its state, and the attempts it was last seen with. */
3
+ export interface ItemSession {
4
+ readonly state: ItemLifecycleState;
5
+ /** The ended attempts when `state` was last set; a different count means the state came from elsewhere. */
6
+ readonly numAttempts: number;
7
+ /** Whether the item was adaptive when `state` was last set; its facts may arrive after the first update. */
8
+ readonly adaptive: boolean;
9
+ }
10
+ /** What a delivery knows about an item session at an update. */
11
+ export interface ItemSessionFacts extends ItemLifecycleSeedInput, Pick<ItemLifecycleInput, 'navigationMode' | 'submissionMode'> {
12
+ sessionControl: ItemLifecycleInput['sessionControl'];
13
+ }
14
+ /**
15
+ * The session after the candidate moved (or a state was restored), through the lifecycle table: an
16
+ * item put on screen begins its attempt or resumes, one taken off screen is suspended, and one a
17
+ * linear part has passed is closed. A session not seen before, or whose attempts changed outside
18
+ * `endItemAttempt` (a restored or assigned state) or whose item turned out adaptive (its facts came
19
+ * later), is seeded again with `seedItemLifecycle`.
20
+ */
21
+ export declare function followItemSession(previous: ItemSession | undefined, facts: ItemSessionFacts): ItemSession;
22
+ /**
23
+ * The session after an attempt ended, `facts.numAttempts` counting it. An interacting session goes
24
+ * through the table's `endAttempt`; one in any other state had its attempt ended before this delivery
25
+ * saw it begin, so it is seeded as an item on screen.
26
+ */
27
+ export declare function endItemAttempt(previous: ItemSession | undefined, facts: ItemSessionFacts): ItemSession;
@@ -0,0 +1,47 @@
1
+ import { itemLifecycleGuards, seedItemLifecycle, transition } from './item-lifecycle.js';
2
+ const guardsFor = (facts) =>
3
+ // Modal feedback does not stop a session yet: nothing reports it, so `modalFeedback` is never entered.
4
+ itemLifecycleGuards({ ...facts, left: facts.passed, modalFeedback: false });
5
+ const OVER = ['closed', 'review', 'solution'];
6
+ /**
7
+ * The session after the candidate moved (or a state was restored), through the lifecycle table: an
8
+ * item put on screen begins its attempt or resumes, one taken off screen is suspended, and one a
9
+ * linear part has passed is closed. A session not seen before, or whose attempts changed outside
10
+ * `endItemAttempt` (a restored or assigned state) or whose item turned out adaptive (its facts came
11
+ * later), is seeded again with `seedItemLifecycle`.
12
+ */
13
+ export function followItemSession(previous, facts) {
14
+ const { numAttempts, adaptive } = facts;
15
+ if (!previous || previous.numAttempts !== numAttempts || previous.adaptive !== adaptive) {
16
+ return { state: seedItemLifecycle(facts), numAttempts, adaptive };
17
+ }
18
+ const guards = guardsFor(facts);
19
+ let state = previous.state;
20
+ if (facts.passed) {
21
+ if (!OVER.includes(state))
22
+ state = transition(state, 'endItemSession', guards) ?? state;
23
+ }
24
+ else if (facts.presented) {
25
+ if (state === 'initial')
26
+ state = transition(state, 'beginAttempt', guards) ?? state;
27
+ else if (state === 'suspended')
28
+ state = transition(state, 'beginCandidateSession', guards) ?? state;
29
+ }
30
+ else if (state === 'interacting' || state === 'modalFeedback') {
31
+ state = transition(state, 'endCandidateSession', guards) ?? state;
32
+ }
33
+ return { state, numAttempts, adaptive };
34
+ }
35
+ /**
36
+ * The session after an attempt ended, `facts.numAttempts` counting it. An interacting session goes
37
+ * through the table's `endAttempt`; one in any other state had its attempt ended before this delivery
38
+ * saw it begin, so it is seeded as an item on screen.
39
+ */
40
+ export function endItemAttempt(previous, facts) {
41
+ const { numAttempts, adaptive } = facts;
42
+ if (previous?.state !== 'interacting') {
43
+ return { state: seedItemLifecycle({ ...facts, presented: true }), numAttempts, adaptive };
44
+ }
45
+ return { state: transition('interacting', 'endAttempt', guardsFor(facts)) ?? 'interacting', numAttempts, adaptive };
46
+ }
47
+ //# sourceMappingURL=item-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-session.js","sourceRoot":"","sources":["../../src/lifecycle/item-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAoBzF,MAAM,SAAS,GAAG,CAAC,KAAuB,EAAE,EAAE;AAC5C,uGAAuG;AACvG,mBAAmB,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;AAE9E,MAAM,IAAI,GAAkC,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAiC,EAAE,KAAuB;IAC1F,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,WAAW,KAAK,WAAW,IAAI,QAAQ,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACxF,OAAO,EAAE,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IACpE,CAAC;IACD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC3B,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC;IAC1F,CAAC;SAAM,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QAC3B,IAAI,KAAK,KAAK,SAAS;YAAE,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC;aAC/E,IAAI,KAAK,KAAK,WAAW;YAAE,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,uBAAuB,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC;IACtG,CAAC;SAAM,IAAI,KAAK,KAAK,aAAa,IAAI,KAAK,KAAK,eAAe,EAAE,CAAC;QAChE,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,qBAAqB,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC;IACpE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAiC,EAAE,KAAuB;IACvF,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACxC,IAAI,QAAQ,EAAE,KAAK,KAAK,aAAa,EAAE,CAAC;QACtC,OAAO,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IAC5F,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,aAAa,EAAE,YAAY,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AACtH,CAAC","sourcesContent":["import { itemLifecycleGuards, seedItemLifecycle, transition } from './item-lifecycle.js';\n\nimport type { ItemLifecycleInput, ItemLifecycleSeedInput, ItemLifecycleState } from './item-lifecycle.js';\n\n/** One item session as a delivery keeps it between updates: its state, and the attempts it was last seen with. */\nexport interface ItemSession {\n readonly state: ItemLifecycleState;\n /** The ended attempts when `state` was last set; a different count means the state came from elsewhere. */\n readonly numAttempts: number;\n /** Whether the item was adaptive when `state` was last set; its facts may arrive after the first update. */\n readonly adaptive: boolean;\n}\n\n/** What a delivery knows about an item session at an update. */\nexport interface ItemSessionFacts\n extends ItemLifecycleSeedInput,\n Pick<ItemLifecycleInput, 'navigationMode' | 'submissionMode'> {\n sessionControl: ItemLifecycleInput['sessionControl'];\n}\n\nconst guardsFor = (facts: ItemSessionFacts) =>\n // Modal feedback does not stop a session yet: nothing reports it, so `modalFeedback` is never entered.\n itemLifecycleGuards({ ...facts, left: facts.passed, modalFeedback: false });\n\nconst OVER: readonly ItemLifecycleState[] = ['closed', 'review', 'solution'];\n\n/**\n * The session after the candidate moved (or a state was restored), through the lifecycle table: an\n * item put on screen begins its attempt or resumes, one taken off screen is suspended, and one a\n * linear part has passed is closed. A session not seen before, or whose attempts changed outside\n * `endItemAttempt` (a restored or assigned state) or whose item turned out adaptive (its facts came\n * later), is seeded again with `seedItemLifecycle`.\n */\nexport function followItemSession(previous: ItemSession | undefined, facts: ItemSessionFacts): ItemSession {\n const { numAttempts, adaptive } = facts;\n if (!previous || previous.numAttempts !== numAttempts || previous.adaptive !== adaptive) {\n return { state: seedItemLifecycle(facts), numAttempts, adaptive };\n }\n const guards = guardsFor(facts);\n let state = previous.state;\n if (facts.passed) {\n if (!OVER.includes(state)) state = transition(state, 'endItemSession', guards) ?? state;\n } else if (facts.presented) {\n if (state === 'initial') state = transition(state, 'beginAttempt', guards) ?? state;\n else if (state === 'suspended') state = transition(state, 'beginCandidateSession', guards) ?? state;\n } else if (state === 'interacting' || state === 'modalFeedback') {\n state = transition(state, 'endCandidateSession', guards) ?? state;\n }\n return { state, numAttempts, adaptive };\n}\n\n/**\n * The session after an attempt ended, `facts.numAttempts` counting it. An interacting session goes\n * through the table's `endAttempt`; one in any other state had its attempt ended before this delivery\n * saw it begin, so it is seeded as an item on screen.\n */\nexport function endItemAttempt(previous: ItemSession | undefined, facts: ItemSessionFacts): ItemSession {\n const { numAttempts, adaptive } = facts;\n if (previous?.state !== 'interacting') {\n return { state: seedItemLifecycle({ ...facts, presented: true }), numAttempts, adaptive };\n }\n return { state: transition('interacting', 'endAttempt', guardsFor(facts)) ?? 'interacting', numAttempts, adaptive };\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qti-components/delivery",
3
3
  "description": "The QTI 3 delivery engine: test model, item session lifecycle, sequencing and session state, with no browser globals",
4
- "version": "0.1.0-next.5",
4
+ "version": "0.1.0-next.7",
5
5
  "author": "",
6
6
  "keywords": [
7
7
  "qti",