@pie-qti/assessment-player 1.0.0-beta.5 → 1.0.0-beta.6
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/core/AssessmentPlayer.js +12 -16
- package/dist/core/AssessmentPlayer.js.map +1 -1
- package/dist/core/navigationPolicy.d.ts +1 -5
- package/dist/core/navigationPolicy.js +4 -8
- package/dist/core/navigationPolicy.js.map +1 -1
- package/dist/core/submissionPolicy.d.ts +0 -3
- package/dist/core/submissionPolicy.js +0 -4
- package/dist/core/submissionPolicy.js.map +1 -1
- package/dist/core/templateDefaults.js +1 -2
- package/dist/core/templateDefaults.js.map +1 -1
- package/dist/core/testStructure.d.ts +2 -2
- package/dist/core/testStructure.js +7 -10
- package/dist/core/testStructure.js.map +1 -1
- package/dist/integration/ReferenceBackendAdapter.js +4 -4
- package/dist/integration/ReferenceBackendAdapter.js.map +1 -1
- package/dist/integration/api-contract.d.ts +4 -7
- package/dist/integration/api-contract.js.map +1 -1
- package/dist/integration/qti-test-parser.js +0 -29
- package/dist/integration/qti-test-parser.js.map +1 -1
- package/package.json +16 -16
|
@@ -22,7 +22,7 @@ import { flattenItems, partOrderOf, presentedSectionOf, presentedSections, } fro
|
|
|
22
22
|
import { ScopeLocks, isItemLocked, lockingScopeOf, scopeKey, scopeLimitRanOut, } from './scopeLocks.js';
|
|
23
23
|
import { canNavigateByTestPart, isLegalSectionTarget } from './navigationPolicy.js';
|
|
24
24
|
import { branchExitLeavesPart, branchLandingOf, branchTargetIndex, endedEnclosingSection, resolveExitBoundary, } from './exitBoundaries.js';
|
|
25
|
-
import {
|
|
25
|
+
import { submissionBlockerFor, submissionGate as submissionGatePolicy, throwForBlockers, } from './submissionPolicy.js';
|
|
26
26
|
import { ReviewInfoCache, resultsSummaryOf, reviewItemRow } from './reviewViews.js';
|
|
27
27
|
import { assertMinTimeElapsed, effectiveItemTimeLimits, submitTimingEvidence, } from './timePolicy.js';
|
|
28
28
|
import { templateDefaultsFor } from './templateDefaults.js';
|
|
@@ -685,7 +685,7 @@ export class AssessmentPlayer {
|
|
|
685
685
|
return !this.responsesUnchangedSinceSubmission(q.identifier, this.sessionCoordinator.getResponses(q.identifier));
|
|
686
686
|
}
|
|
687
687
|
isIndividual(q) {
|
|
688
|
-
return
|
|
688
|
+
return q.testPart.submissionMode === 'individual';
|
|
689
689
|
}
|
|
690
690
|
/**
|
|
691
691
|
* Whether submissions carry the serialized item session: always for a backend that
|
|
@@ -935,7 +935,6 @@ export class AssessmentPlayer {
|
|
|
935
935
|
return isLegalSectionTarget({
|
|
936
936
|
section,
|
|
937
937
|
items: this.items,
|
|
938
|
-
assessment: this.assessment,
|
|
939
938
|
finalized: this.finalized,
|
|
940
939
|
currentIndex: this.currentItemIndex,
|
|
941
940
|
isItemLocked: (q) => this.isItemLocked(q),
|
|
@@ -1463,7 +1462,7 @@ export class AssessmentPlayer {
|
|
|
1463
1462
|
const countAttempt = this.endAttemptResponseMap(q).get(responseId);
|
|
1464
1463
|
if (countAttempt === undefined)
|
|
1465
1464
|
return;
|
|
1466
|
-
if (
|
|
1465
|
+
if (q.testPart.submissionMode !== 'individual')
|
|
1467
1466
|
return;
|
|
1468
1467
|
queueMicrotask(() => {
|
|
1469
1468
|
void this.runExclusive(async () => {
|
|
@@ -1651,7 +1650,7 @@ export class AssessmentPlayer {
|
|
|
1651
1650
|
}
|
|
1652
1651
|
// Enforce navigation rules (UI hints, still backend-authoritative for real deployments).
|
|
1653
1652
|
if (!options.restoring && this.currentItemIndex >= 0 && !this.canNavigateByTestPart(index, this.currentItemIndex)) {
|
|
1654
|
-
const currentMode = this.items[this.currentItemIndex]?.testPart.navigationMode
|
|
1653
|
+
const currentMode = this.items[this.currentItemIndex]?.testPart.navigationMode;
|
|
1655
1654
|
if (currentMode === 'linear' && index > this.nextUnlockedIndex(this.currentItemIndex)) {
|
|
1656
1655
|
throw new AssessmentPlayerError('linearNavigationOnly', 'In linear navigation mode, you can only move to the next question.');
|
|
1657
1656
|
}
|
|
@@ -1674,7 +1673,7 @@ export class AssessmentPlayer {
|
|
|
1674
1673
|
// a direct jump leaves the current item behind, so it is included here.
|
|
1675
1674
|
if (target.testPart !== currentItem.testPart)
|
|
1676
1675
|
this.assertCanLeaveScope(currentItem);
|
|
1677
|
-
if (target.testPart !== currentItem.testPart &&
|
|
1676
|
+
if (target.testPart !== currentItem.testPart && currentItem.testPart.submissionMode === 'simultaneous') {
|
|
1678
1677
|
// Commit this part before leaving it; a failed request keeps the learner
|
|
1679
1678
|
// in the current part so its remaining answers can be retried.
|
|
1680
1679
|
await this.submitSimultaneousItems(this.items.filter((q) => q.testPart === currentItem.testPart));
|
|
@@ -1890,7 +1889,7 @@ export class AssessmentPlayer {
|
|
|
1890
1889
|
}
|
|
1891
1890
|
/** The part's effective QTI submission mode. */
|
|
1892
1891
|
isSimultaneousSubmission(q) {
|
|
1893
|
-
return
|
|
1892
|
+
return q.testPart.submissionMode === 'simultaneous';
|
|
1894
1893
|
}
|
|
1895
1894
|
/**
|
|
1896
1895
|
* Whether `next()` from the item submits it: an individual part's item whose attempts
|
|
@@ -2002,7 +2001,7 @@ export class AssessmentPlayer {
|
|
|
2002
2001
|
if (!this.hasDeliveryRules)
|
|
2003
2002
|
return this.nextUnlockedIndex(q.index);
|
|
2004
2003
|
const decls = this.navigationDeclarationsFor(q);
|
|
2005
|
-
const first = this.indexOfItem(nextItemIdentifier(this.
|
|
2004
|
+
const first = this.indexOfItem(nextItemIdentifier(this.deliveredForRules, q.index, decls, Math.random, this.reportTestConditionFailure));
|
|
2006
2005
|
if (first < 0)
|
|
2007
2006
|
return -1;
|
|
2008
2007
|
if (!this.isItemLocked(this.items[first]))
|
|
@@ -2031,7 +2030,7 @@ export class AssessmentPlayer {
|
|
|
2031
2030
|
let previous = this.deliveredForRules[fromIndex];
|
|
2032
2031
|
let start = fromIndex + 1;
|
|
2033
2032
|
while (start < this.items.length) {
|
|
2034
|
-
const index = this.indexOfItem(firstEligibleItem(this.
|
|
2033
|
+
const index = this.indexOfItem(firstEligibleItem(this.deliveredForRules, start, previous, declarations, Math.random, this.reportTestConditionFailure));
|
|
2035
2034
|
if (index < 0)
|
|
2036
2035
|
return;
|
|
2037
2036
|
yield index;
|
|
@@ -2128,7 +2127,7 @@ export class AssessmentPlayer {
|
|
|
2128
2127
|
if (!q)
|
|
2129
2128
|
return null;
|
|
2130
2129
|
const id = q.identifier;
|
|
2131
|
-
const mode =
|
|
2130
|
+
const mode = q.testPart.submissionMode;
|
|
2132
2131
|
const adaptive = isAdaptiveItemXml(q.item.itemXml);
|
|
2133
2132
|
if (mode !== 'individual') {
|
|
2134
2133
|
return {
|
|
@@ -2525,7 +2524,7 @@ export class AssessmentPlayer {
|
|
|
2525
2524
|
if (partEnded) {
|
|
2526
2525
|
// The part's pending simultaneous-mode responses are due when it ends.
|
|
2527
2526
|
await this.submitSimultaneousItems(this.items.filter((item) => item.testPart === current.testPart &&
|
|
2528
|
-
|
|
2527
|
+
item.testPart.submissionMode === 'simultaneous'));
|
|
2529
2528
|
}
|
|
2530
2529
|
if (nextIdx >= 0) {
|
|
2531
2530
|
await this.performNavigateTo(nextIdx, { restoring: true });
|
|
@@ -2588,7 +2587,6 @@ export class AssessmentPlayer {
|
|
|
2588
2587
|
targetIndex,
|
|
2589
2588
|
currentIndex,
|
|
2590
2589
|
items: this.items,
|
|
2591
|
-
assessment: this.assessment,
|
|
2592
2590
|
forward,
|
|
2593
2591
|
});
|
|
2594
2592
|
}
|
|
@@ -2871,9 +2869,7 @@ export class AssessmentPlayer {
|
|
|
2871
2869
|
this.unreachableCollection = new Set(this.getUnreachableSubmissionBlockers().map((blocker) => blocker.identifier));
|
|
2872
2870
|
}
|
|
2873
2871
|
const isIndividual = (q) => this.isIndividual(q);
|
|
2874
|
-
|
|
2875
|
-
// a fallback for older hosts that do not supply a mode on each part.
|
|
2876
|
-
await this.submitSimultaneousItems(this.items.filter((q) => effectiveSubmissionMode(q.testPart, this.assessment) === 'simultaneous'));
|
|
2872
|
+
await this.submitSimultaneousItems(this.items.filter((q) => q.testPart.submissionMode === 'simultaneous'));
|
|
2877
2873
|
if (this.finalized && this.finalResults)
|
|
2878
2874
|
return this.finalResults;
|
|
2879
2875
|
await this.submitSimultaneousItems(this.items.filter((q) => q !== current &&
|
|
@@ -3395,7 +3391,7 @@ export class AssessmentPlayer {
|
|
|
3395
3391
|
if (this.isOpenTarget(q))
|
|
3396
3392
|
return i;
|
|
3397
3393
|
}
|
|
3398
|
-
const mode = from.testPart.navigationMode
|
|
3394
|
+
const mode = from.testPart.navigationMode;
|
|
3399
3395
|
if (mode === 'nonlinear') {
|
|
3400
3396
|
for (let i = fromIndex - 1; i >= 0; i--) {
|
|
3401
3397
|
const q = this.items[i];
|