@playcademy/sandbox 0.10.1-beta.2 → 0.10.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +39 -28
- package/dist/server.js +39 -28
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1128,7 +1128,7 @@ var package_default;
|
|
|
1128
1128
|
var init_package = __esm(() => {
|
|
1129
1129
|
package_default = {
|
|
1130
1130
|
name: "@playcademy/sandbox",
|
|
1131
|
-
version: "0.10.1-beta.
|
|
1131
|
+
version: "0.10.1-beta.3",
|
|
1132
1132
|
description: "Local development server for Playcademy game development",
|
|
1133
1133
|
type: "module",
|
|
1134
1134
|
exports: {
|
|
@@ -11002,19 +11002,22 @@ function scorePlatformAssessmentItem(item, responses) {
|
|
|
11002
11002
|
isCorrect: verdicts.length > 0 && verdicts.every(Boolean)
|
|
11003
11003
|
};
|
|
11004
11004
|
}
|
|
11005
|
+
function reviewStandardRef({
|
|
11006
|
+
framework,
|
|
11007
|
+
identifier
|
|
11008
|
+
}) {
|
|
11009
|
+
return { framework, identifier };
|
|
11010
|
+
}
|
|
11005
11011
|
function reportReviewRequiredPairUnavailable(review, administeredItemIdentifiers2, report) {
|
|
11006
|
-
if (!review.requireBothQuestions) {
|
|
11007
|
-
return;
|
|
11008
|
-
}
|
|
11009
11012
|
const administered = new Set(administeredItemIdentifiers2);
|
|
11010
11013
|
const failures = [];
|
|
11011
|
-
for (const standard of review.standards) {
|
|
11014
|
+
for (const standard of review.standards.filter((entry) => entry.requireBothQuestions)) {
|
|
11012
11015
|
const key = assessmentStandardRefKey(standard);
|
|
11013
11016
|
const selected = new Set(review.selections.filter((selection) => assessmentStandardRefKey(selection.standard) === key).map((selection) => selection.itemIdentifier));
|
|
11014
11017
|
const administeredCount = [...selected].filter((identifier) => administered.has(identifier)).length;
|
|
11015
11018
|
if (selected.size < 2 || administeredCount === 1) {
|
|
11016
11019
|
failures.push({
|
|
11017
|
-
standard,
|
|
11020
|
+
standard: reviewStandardRef(standard),
|
|
11018
11021
|
reason: selected.size < 2 ? "selection_shortage" : "not_administered",
|
|
11019
11022
|
requiredCount: 2,
|
|
11020
11023
|
selectedCount: selected.size,
|
|
@@ -11057,6 +11060,9 @@ function canonicalRequestStandards(standards) {
|
|
|
11057
11060
|
}
|
|
11058
11061
|
const canonical = new Map;
|
|
11059
11062
|
for (const input of standards) {
|
|
11063
|
+
if (input.requireBothQuestions !== undefined && typeof input.requireBothQuestions !== "boolean") {
|
|
11064
|
+
throw new Error("review standard requireBothQuestions must be a boolean");
|
|
11065
|
+
}
|
|
11060
11066
|
const standard = canonicalAssessmentStandardRef(input);
|
|
11061
11067
|
if (!reviewStandardFieldsWithinLimits(standard)) {
|
|
11062
11068
|
throw new RangeError(`Review standard fields may contain at most ${TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength} characters`);
|
|
@@ -11065,13 +11071,19 @@ function canonicalRequestStandards(standards) {
|
|
|
11065
11071
|
throw new Error("Review standards require a framework and identifier");
|
|
11066
11072
|
}
|
|
11067
11073
|
const key = assessmentStandardRefKey(standard);
|
|
11068
|
-
if (!canonical.has(key)) {
|
|
11069
|
-
canonical.set(key,
|
|
11074
|
+
if (!canonical.has(key) || input.requireBothQuestions) {
|
|
11075
|
+
canonical.set(key, {
|
|
11076
|
+
...standard,
|
|
11077
|
+
...input.requireBothQuestions ? { requireBothQuestions: true } : {}
|
|
11078
|
+
});
|
|
11070
11079
|
}
|
|
11071
11080
|
}
|
|
11072
|
-
return [...canonical.values()]
|
|
11081
|
+
return [...canonical.values()];
|
|
11073
11082
|
}
|
|
11074
11083
|
function normalizeReviewRequest(request) {
|
|
11084
|
+
if ("requireBothQuestions" in request && request.requireBothQuestions !== undefined) {
|
|
11085
|
+
throw new Error("Set requireBothQuestions on individual review standards, not the review request");
|
|
11086
|
+
}
|
|
11075
11087
|
const candidateItemsPerStandard = request.candidateItemsPerStandard ?? 1;
|
|
11076
11088
|
if (!Number.isInteger(candidateItemsPerStandard) || candidateItemsPerStandard <= 0 || candidateItemsPerStandard > TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.candidateItemsPerStandard) {
|
|
11077
11089
|
throw new RangeError(`candidateItemsPerStandard must be a positive integer at most ${TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.candidateItemsPerStandard}`);
|
|
@@ -11082,20 +11094,20 @@ function normalizeReviewRequest(request) {
|
|
|
11082
11094
|
}
|
|
11083
11095
|
return {
|
|
11084
11096
|
standards,
|
|
11085
|
-
candidateItemsPerStandard
|
|
11086
|
-
...request.requireBothQuestions ? { requireBothQuestions: true } : {}
|
|
11097
|
+
candidateItemsPerStandard
|
|
11087
11098
|
};
|
|
11088
11099
|
}
|
|
11089
11100
|
function reviewRequestFingerprint(request, policy) {
|
|
11090
11101
|
const normalized = normalizeReviewRequest(request);
|
|
11102
|
+
const requiredStandardKeys = normalized.standards.filter((standard) => standard.requireBothQuestions).map(assessmentStandardRefKey);
|
|
11091
11103
|
return JSON.stringify({
|
|
11092
11104
|
kind: "standards-review",
|
|
11093
11105
|
policy: {
|
|
11094
11106
|
version: policy.version
|
|
11095
11107
|
},
|
|
11096
11108
|
candidateItemsPerStandard: normalized.candidateItemsPerStandard,
|
|
11097
|
-
|
|
11098
|
-
|
|
11109
|
+
standardKeys: normalized.standards.map(assessmentStandardRefKey),
|
|
11110
|
+
...requiredStandardKeys.length > 0 ? { requiredStandardKeys } : {}
|
|
11099
11111
|
});
|
|
11100
11112
|
}
|
|
11101
11113
|
function reviewQuestionLineItemId(parentLineItemId, itemIdentifier) {
|
|
@@ -11321,9 +11333,10 @@ function rankedCandidatesByStandard(bank, exposures) {
|
|
|
11321
11333
|
return byStandard;
|
|
11322
11334
|
}
|
|
11323
11335
|
function reviewSlots(request) {
|
|
11324
|
-
return request.standards.flatMap((standard) => Array.from({ length: request.candidateItemsPerStandard }, () => ({
|
|
11325
|
-
standard,
|
|
11326
|
-
standardKey: assessmentStandardRefKey(standard)
|
|
11336
|
+
return request.standards.flatMap((standard, servingIndex) => Array.from({ length: request.candidateItemsPerStandard }, () => ({
|
|
11337
|
+
standard: reviewStandardRef(standard),
|
|
11338
|
+
standardKey: assessmentStandardRefKey(standard),
|
|
11339
|
+
servingIndex
|
|
11327
11340
|
})));
|
|
11328
11341
|
}
|
|
11329
11342
|
function matchingCandidates(candidatesByStandard, slotCount) {
|
|
@@ -11436,7 +11449,7 @@ function fulfillment(request, candidatesByStandard, selections) {
|
|
|
11436
11449
|
const selected = selectedByStandard.get(key) ?? 0;
|
|
11437
11450
|
return selected < request.candidateItemsPerStandard ? [
|
|
11438
11451
|
{
|
|
11439
|
-
standard,
|
|
11452
|
+
standard: reviewStandardRef(standard),
|
|
11440
11453
|
requested: request.candidateItemsPerStandard,
|
|
11441
11454
|
selected,
|
|
11442
11455
|
eligible: candidatesByStandard.get(key)?.length ?? 0
|
|
@@ -11461,10 +11474,10 @@ function fulfillment(request, candidatesByStandard, selections) {
|
|
|
11461
11474
|
function selectReviewItems(input) {
|
|
11462
11475
|
const request = normalizeReviewRequest(input.request);
|
|
11463
11476
|
const candidatesByStandard = rankedCandidatesByStandard(input.bank, input.exposures);
|
|
11464
|
-
const slots = reviewSlots(request);
|
|
11477
|
+
const slots = reviewSlots(request).toSorted((left, right) => compareCodeUnits(left.standardKey, right.standardKey));
|
|
11465
11478
|
const boundedCandidates = matchingCandidates(candidatesByStandard, slots.length);
|
|
11466
11479
|
const selected = preferredDistinctMatching(slots, boundedCandidates);
|
|
11467
|
-
const selections = [...selected.entries()].toSorted(([left], [right]) => left - right).map(([index, itemIdentifier]) => ({
|
|
11480
|
+
const selections = [...selected.entries()].toSorted(([left], [right]) => slots[left].servingIndex - slots[right].servingIndex || left - right).map(([index, itemIdentifier]) => ({
|
|
11468
11481
|
standard: slots[index].standard,
|
|
11469
11482
|
itemIdentifier
|
|
11470
11483
|
}));
|
|
@@ -11603,6 +11616,9 @@ function isAssessmentScore(value) {
|
|
|
11603
11616
|
function isAssessmentStandardRef(value) {
|
|
11604
11617
|
return isRecord(value) && typeof value.framework === "string" && value.framework.length > 0 && typeof value.identifier === "string" && value.identifier.length > 0;
|
|
11605
11618
|
}
|
|
11619
|
+
function isAssessmentReviewStandard(value) {
|
|
11620
|
+
return isRecord(value) && isAssessmentStandardRef(value) && (value.requireBothQuestions === undefined || typeof value.requireBothQuestions === "boolean");
|
|
11621
|
+
}
|
|
11606
11622
|
function isReviewFulfillment(value) {
|
|
11607
11623
|
if (!isRecord(value) || value.status !== "complete" && value.status !== "partial" || !Number.isInteger(value.requestedItemCount) || !Number.isInteger(value.selectedItemCount) || !Array.isArray(value.shortages)) {
|
|
11608
11624
|
return false;
|
|
@@ -11677,7 +11693,7 @@ function isRoutedDiagnosticAttemptMetadata(value, itemSubmissions, responseVersi
|
|
|
11677
11693
|
});
|
|
11678
11694
|
}
|
|
11679
11695
|
function isReviewAttemptMetadata(value) {
|
|
11680
|
-
return isRecord(value) && typeof value.requestFingerprint === "string" && typeof value.bankRevision === "string" && Array.isArray(value.standards) && value.standards.every(
|
|
11696
|
+
return isRecord(value) && typeof value.requestFingerprint === "string" && typeof value.bankRevision === "string" && Array.isArray(value.standards) && value.standards.every(isAssessmentReviewStandard) && Number.isInteger(value.candidateItemsPerStandard) && value.requireBothQuestions === undefined && Array.isArray(value.selections) && value.selections.every((selection) => isRecord(selection) && isAssessmentStandardRef(selection.standard) && typeof selection.itemIdentifier === "string") && isReviewFulfillment(value.fulfillment);
|
|
11681
11697
|
}
|
|
11682
11698
|
function isOptionalInteger(value) {
|
|
11683
11699
|
return value === undefined || Number.isInteger(value);
|
|
@@ -12375,8 +12391,8 @@ var init_assessment_runtime2 = __esm(() => {
|
|
|
12375
12391
|
}),
|
|
12376
12392
|
StartAssessmentBaseSchema.extend({
|
|
12377
12393
|
purpose: exports_external.literal("review"),
|
|
12378
|
-
requireBothQuestions: exports_external.
|
|
12379
|
-
standards: exports_external.array(AssessmentStandardRefSchema2).min(1).max(TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standards),
|
|
12394
|
+
requireBothQuestions: exports_external.never().optional(),
|
|
12395
|
+
standards: exports_external.array(AssessmentStandardRefSchema2.and(exports_external.object({ requireBothQuestions: exports_external.boolean().optional() }))).min(1).max(TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standards),
|
|
12380
12396
|
candidateItemsPerStandard: exports_external.number().int().positive().max(TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.candidateItemsPerStandard).optional()
|
|
12381
12397
|
}),
|
|
12382
12398
|
StartAssessmentBaseSchema.extend({
|
|
@@ -100346,7 +100362,6 @@ function buildConventionalAssessmentSnapshot(input) {
|
|
|
100346
100362
|
purpose: metadata2.purpose,
|
|
100347
100363
|
standards: [...metadata2.review.standards],
|
|
100348
100364
|
candidateItemsPerStandard: metadata2.review.candidateItemsPerStandard,
|
|
100349
|
-
...metadata2.review.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
100350
100365
|
selections: [...metadata2.review.selections],
|
|
100351
100366
|
fulfillment: metadata2.review.fulfillment
|
|
100352
100367
|
};
|
|
@@ -102818,13 +102833,11 @@ function buildPreparedAssessmentMetadata(plan, timestamp6, testName) {
|
|
|
102818
102833
|
review: {
|
|
102819
102834
|
requestFingerprint: reviewRequestFingerprint({
|
|
102820
102835
|
standards: plan.review.standards,
|
|
102821
|
-
candidateItemsPerStandard: plan.review.candidateItemsPerStandard
|
|
102822
|
-
requireBothQuestions: plan.review.requireBothQuestions
|
|
102836
|
+
candidateItemsPerStandard: plan.review.candidateItemsPerStandard
|
|
102823
102837
|
}, DEFAULT_REVIEW_SELECTION_POLICY),
|
|
102824
102838
|
bankRevision: plan.review.bankRevision,
|
|
102825
102839
|
standards: plan.review.standards,
|
|
102826
102840
|
candidateItemsPerStandard: plan.review.candidateItemsPerStandard,
|
|
102827
|
-
...plan.review.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
102828
102841
|
selections: plan.review.selections,
|
|
102829
102842
|
fulfillment: plan.review.fulfillment
|
|
102830
102843
|
}
|
|
@@ -104007,7 +104020,6 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104007
104020
|
bankRevision: catalog.bank.bankRevision,
|
|
104008
104021
|
standards: [...normalized.standards],
|
|
104009
104022
|
candidateItemsPerStandard: normalized.candidateItemsPerStandard,
|
|
104010
|
-
...normalized.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
104011
104023
|
selections: [...selected.selections],
|
|
104012
104024
|
fulfillment: selected.fulfillment
|
|
104013
104025
|
}
|
|
@@ -104279,7 +104291,6 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104279
104291
|
bankRevision: source.bank.bankRevision,
|
|
104280
104292
|
standards: [...normalizedRequest.standards],
|
|
104281
104293
|
candidateItemsPerStandard: normalizedRequest.candidateItemsPerStandard,
|
|
104282
|
-
...normalizedRequest.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
104283
104294
|
selections: [...selected.selections],
|
|
104284
104295
|
fulfillment: selected.fulfillment
|
|
104285
104296
|
}
|
package/dist/server.js
CHANGED
|
@@ -1127,7 +1127,7 @@ var package_default;
|
|
|
1127
1127
|
var init_package = __esm(() => {
|
|
1128
1128
|
package_default = {
|
|
1129
1129
|
name: "@playcademy/sandbox",
|
|
1130
|
-
version: "0.10.1-beta.
|
|
1130
|
+
version: "0.10.1-beta.3",
|
|
1131
1131
|
description: "Local development server for Playcademy game development",
|
|
1132
1132
|
type: "module",
|
|
1133
1133
|
exports: {
|
|
@@ -11001,19 +11001,22 @@ function scorePlatformAssessmentItem(item, responses) {
|
|
|
11001
11001
|
isCorrect: verdicts.length > 0 && verdicts.every(Boolean)
|
|
11002
11002
|
};
|
|
11003
11003
|
}
|
|
11004
|
+
function reviewStandardRef({
|
|
11005
|
+
framework,
|
|
11006
|
+
identifier
|
|
11007
|
+
}) {
|
|
11008
|
+
return { framework, identifier };
|
|
11009
|
+
}
|
|
11004
11010
|
function reportReviewRequiredPairUnavailable(review, administeredItemIdentifiers2, report) {
|
|
11005
|
-
if (!review.requireBothQuestions) {
|
|
11006
|
-
return;
|
|
11007
|
-
}
|
|
11008
11011
|
const administered = new Set(administeredItemIdentifiers2);
|
|
11009
11012
|
const failures = [];
|
|
11010
|
-
for (const standard of review.standards) {
|
|
11013
|
+
for (const standard of review.standards.filter((entry) => entry.requireBothQuestions)) {
|
|
11011
11014
|
const key = assessmentStandardRefKey(standard);
|
|
11012
11015
|
const selected = new Set(review.selections.filter((selection) => assessmentStandardRefKey(selection.standard) === key).map((selection) => selection.itemIdentifier));
|
|
11013
11016
|
const administeredCount = [...selected].filter((identifier) => administered.has(identifier)).length;
|
|
11014
11017
|
if (selected.size < 2 || administeredCount === 1) {
|
|
11015
11018
|
failures.push({
|
|
11016
|
-
standard,
|
|
11019
|
+
standard: reviewStandardRef(standard),
|
|
11017
11020
|
reason: selected.size < 2 ? "selection_shortage" : "not_administered",
|
|
11018
11021
|
requiredCount: 2,
|
|
11019
11022
|
selectedCount: selected.size,
|
|
@@ -11056,6 +11059,9 @@ function canonicalRequestStandards(standards) {
|
|
|
11056
11059
|
}
|
|
11057
11060
|
const canonical = new Map;
|
|
11058
11061
|
for (const input of standards) {
|
|
11062
|
+
if (input.requireBothQuestions !== undefined && typeof input.requireBothQuestions !== "boolean") {
|
|
11063
|
+
throw new Error("review standard requireBothQuestions must be a boolean");
|
|
11064
|
+
}
|
|
11059
11065
|
const standard = canonicalAssessmentStandardRef(input);
|
|
11060
11066
|
if (!reviewStandardFieldsWithinLimits(standard)) {
|
|
11061
11067
|
throw new RangeError(`Review standard fields may contain at most ${TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength} characters`);
|
|
@@ -11064,13 +11070,19 @@ function canonicalRequestStandards(standards) {
|
|
|
11064
11070
|
throw new Error("Review standards require a framework and identifier");
|
|
11065
11071
|
}
|
|
11066
11072
|
const key = assessmentStandardRefKey(standard);
|
|
11067
|
-
if (!canonical.has(key)) {
|
|
11068
|
-
canonical.set(key,
|
|
11073
|
+
if (!canonical.has(key) || input.requireBothQuestions) {
|
|
11074
|
+
canonical.set(key, {
|
|
11075
|
+
...standard,
|
|
11076
|
+
...input.requireBothQuestions ? { requireBothQuestions: true } : {}
|
|
11077
|
+
});
|
|
11069
11078
|
}
|
|
11070
11079
|
}
|
|
11071
|
-
return [...canonical.values()]
|
|
11080
|
+
return [...canonical.values()];
|
|
11072
11081
|
}
|
|
11073
11082
|
function normalizeReviewRequest(request) {
|
|
11083
|
+
if ("requireBothQuestions" in request && request.requireBothQuestions !== undefined) {
|
|
11084
|
+
throw new Error("Set requireBothQuestions on individual review standards, not the review request");
|
|
11085
|
+
}
|
|
11074
11086
|
const candidateItemsPerStandard = request.candidateItemsPerStandard ?? 1;
|
|
11075
11087
|
if (!Number.isInteger(candidateItemsPerStandard) || candidateItemsPerStandard <= 0 || candidateItemsPerStandard > TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.candidateItemsPerStandard) {
|
|
11076
11088
|
throw new RangeError(`candidateItemsPerStandard must be a positive integer at most ${TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.candidateItemsPerStandard}`);
|
|
@@ -11081,20 +11093,20 @@ function normalizeReviewRequest(request) {
|
|
|
11081
11093
|
}
|
|
11082
11094
|
return {
|
|
11083
11095
|
standards,
|
|
11084
|
-
candidateItemsPerStandard
|
|
11085
|
-
...request.requireBothQuestions ? { requireBothQuestions: true } : {}
|
|
11096
|
+
candidateItemsPerStandard
|
|
11086
11097
|
};
|
|
11087
11098
|
}
|
|
11088
11099
|
function reviewRequestFingerprint(request, policy) {
|
|
11089
11100
|
const normalized = normalizeReviewRequest(request);
|
|
11101
|
+
const requiredStandardKeys = normalized.standards.filter((standard) => standard.requireBothQuestions).map(assessmentStandardRefKey);
|
|
11090
11102
|
return JSON.stringify({
|
|
11091
11103
|
kind: "standards-review",
|
|
11092
11104
|
policy: {
|
|
11093
11105
|
version: policy.version
|
|
11094
11106
|
},
|
|
11095
11107
|
candidateItemsPerStandard: normalized.candidateItemsPerStandard,
|
|
11096
|
-
|
|
11097
|
-
|
|
11108
|
+
standardKeys: normalized.standards.map(assessmentStandardRefKey),
|
|
11109
|
+
...requiredStandardKeys.length > 0 ? { requiredStandardKeys } : {}
|
|
11098
11110
|
});
|
|
11099
11111
|
}
|
|
11100
11112
|
function reviewQuestionLineItemId(parentLineItemId, itemIdentifier) {
|
|
@@ -11320,9 +11332,10 @@ function rankedCandidatesByStandard(bank, exposures) {
|
|
|
11320
11332
|
return byStandard;
|
|
11321
11333
|
}
|
|
11322
11334
|
function reviewSlots(request) {
|
|
11323
|
-
return request.standards.flatMap((standard) => Array.from({ length: request.candidateItemsPerStandard }, () => ({
|
|
11324
|
-
standard,
|
|
11325
|
-
standardKey: assessmentStandardRefKey(standard)
|
|
11335
|
+
return request.standards.flatMap((standard, servingIndex) => Array.from({ length: request.candidateItemsPerStandard }, () => ({
|
|
11336
|
+
standard: reviewStandardRef(standard),
|
|
11337
|
+
standardKey: assessmentStandardRefKey(standard),
|
|
11338
|
+
servingIndex
|
|
11326
11339
|
})));
|
|
11327
11340
|
}
|
|
11328
11341
|
function matchingCandidates(candidatesByStandard, slotCount) {
|
|
@@ -11435,7 +11448,7 @@ function fulfillment(request, candidatesByStandard, selections) {
|
|
|
11435
11448
|
const selected = selectedByStandard.get(key) ?? 0;
|
|
11436
11449
|
return selected < request.candidateItemsPerStandard ? [
|
|
11437
11450
|
{
|
|
11438
|
-
standard,
|
|
11451
|
+
standard: reviewStandardRef(standard),
|
|
11439
11452
|
requested: request.candidateItemsPerStandard,
|
|
11440
11453
|
selected,
|
|
11441
11454
|
eligible: candidatesByStandard.get(key)?.length ?? 0
|
|
@@ -11460,10 +11473,10 @@ function fulfillment(request, candidatesByStandard, selections) {
|
|
|
11460
11473
|
function selectReviewItems(input) {
|
|
11461
11474
|
const request = normalizeReviewRequest(input.request);
|
|
11462
11475
|
const candidatesByStandard = rankedCandidatesByStandard(input.bank, input.exposures);
|
|
11463
|
-
const slots = reviewSlots(request);
|
|
11476
|
+
const slots = reviewSlots(request).toSorted((left, right) => compareCodeUnits(left.standardKey, right.standardKey));
|
|
11464
11477
|
const boundedCandidates = matchingCandidates(candidatesByStandard, slots.length);
|
|
11465
11478
|
const selected = preferredDistinctMatching(slots, boundedCandidates);
|
|
11466
|
-
const selections = [...selected.entries()].toSorted(([left], [right]) => left - right).map(([index, itemIdentifier]) => ({
|
|
11479
|
+
const selections = [...selected.entries()].toSorted(([left], [right]) => slots[left].servingIndex - slots[right].servingIndex || left - right).map(([index, itemIdentifier]) => ({
|
|
11467
11480
|
standard: slots[index].standard,
|
|
11468
11481
|
itemIdentifier
|
|
11469
11482
|
}));
|
|
@@ -11602,6 +11615,9 @@ function isAssessmentScore(value) {
|
|
|
11602
11615
|
function isAssessmentStandardRef(value) {
|
|
11603
11616
|
return isRecord(value) && typeof value.framework === "string" && value.framework.length > 0 && typeof value.identifier === "string" && value.identifier.length > 0;
|
|
11604
11617
|
}
|
|
11618
|
+
function isAssessmentReviewStandard(value) {
|
|
11619
|
+
return isRecord(value) && isAssessmentStandardRef(value) && (value.requireBothQuestions === undefined || typeof value.requireBothQuestions === "boolean");
|
|
11620
|
+
}
|
|
11605
11621
|
function isReviewFulfillment(value) {
|
|
11606
11622
|
if (!isRecord(value) || value.status !== "complete" && value.status !== "partial" || !Number.isInteger(value.requestedItemCount) || !Number.isInteger(value.selectedItemCount) || !Array.isArray(value.shortages)) {
|
|
11607
11623
|
return false;
|
|
@@ -11676,7 +11692,7 @@ function isRoutedDiagnosticAttemptMetadata(value, itemSubmissions, responseVersi
|
|
|
11676
11692
|
});
|
|
11677
11693
|
}
|
|
11678
11694
|
function isReviewAttemptMetadata(value) {
|
|
11679
|
-
return isRecord(value) && typeof value.requestFingerprint === "string" && typeof value.bankRevision === "string" && Array.isArray(value.standards) && value.standards.every(
|
|
11695
|
+
return isRecord(value) && typeof value.requestFingerprint === "string" && typeof value.bankRevision === "string" && Array.isArray(value.standards) && value.standards.every(isAssessmentReviewStandard) && Number.isInteger(value.candidateItemsPerStandard) && value.requireBothQuestions === undefined && Array.isArray(value.selections) && value.selections.every((selection) => isRecord(selection) && isAssessmentStandardRef(selection.standard) && typeof selection.itemIdentifier === "string") && isReviewFulfillment(value.fulfillment);
|
|
11680
11696
|
}
|
|
11681
11697
|
function isOptionalInteger(value) {
|
|
11682
11698
|
return value === undefined || Number.isInteger(value);
|
|
@@ -12374,8 +12390,8 @@ var init_assessment_runtime2 = __esm(() => {
|
|
|
12374
12390
|
}),
|
|
12375
12391
|
StartAssessmentBaseSchema.extend({
|
|
12376
12392
|
purpose: exports_external.literal("review"),
|
|
12377
|
-
requireBothQuestions: exports_external.
|
|
12378
|
-
standards: exports_external.array(AssessmentStandardRefSchema2).min(1).max(TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standards),
|
|
12393
|
+
requireBothQuestions: exports_external.never().optional(),
|
|
12394
|
+
standards: exports_external.array(AssessmentStandardRefSchema2.and(exports_external.object({ requireBothQuestions: exports_external.boolean().optional() }))).min(1).max(TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standards),
|
|
12379
12395
|
candidateItemsPerStandard: exports_external.number().int().positive().max(TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.candidateItemsPerStandard).optional()
|
|
12380
12396
|
}),
|
|
12381
12397
|
StartAssessmentBaseSchema.extend({
|
|
@@ -100345,7 +100361,6 @@ function buildConventionalAssessmentSnapshot(input) {
|
|
|
100345
100361
|
purpose: metadata2.purpose,
|
|
100346
100362
|
standards: [...metadata2.review.standards],
|
|
100347
100363
|
candidateItemsPerStandard: metadata2.review.candidateItemsPerStandard,
|
|
100348
|
-
...metadata2.review.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
100349
100364
|
selections: [...metadata2.review.selections],
|
|
100350
100365
|
fulfillment: metadata2.review.fulfillment
|
|
100351
100366
|
};
|
|
@@ -102817,13 +102832,11 @@ function buildPreparedAssessmentMetadata(plan, timestamp6, testName) {
|
|
|
102817
102832
|
review: {
|
|
102818
102833
|
requestFingerprint: reviewRequestFingerprint({
|
|
102819
102834
|
standards: plan.review.standards,
|
|
102820
|
-
candidateItemsPerStandard: plan.review.candidateItemsPerStandard
|
|
102821
|
-
requireBothQuestions: plan.review.requireBothQuestions
|
|
102835
|
+
candidateItemsPerStandard: plan.review.candidateItemsPerStandard
|
|
102822
102836
|
}, DEFAULT_REVIEW_SELECTION_POLICY),
|
|
102823
102837
|
bankRevision: plan.review.bankRevision,
|
|
102824
102838
|
standards: plan.review.standards,
|
|
102825
102839
|
candidateItemsPerStandard: plan.review.candidateItemsPerStandard,
|
|
102826
|
-
...plan.review.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
102827
102840
|
selections: plan.review.selections,
|
|
102828
102841
|
fulfillment: plan.review.fulfillment
|
|
102829
102842
|
}
|
|
@@ -104006,7 +104019,6 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104006
104019
|
bankRevision: catalog.bank.bankRevision,
|
|
104007
104020
|
standards: [...normalized.standards],
|
|
104008
104021
|
candidateItemsPerStandard: normalized.candidateItemsPerStandard,
|
|
104009
|
-
...normalized.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
104010
104022
|
selections: [...selected.selections],
|
|
104011
104023
|
fulfillment: selected.fulfillment
|
|
104012
104024
|
}
|
|
@@ -104278,7 +104290,6 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104278
104290
|
bankRevision: source.bank.bankRevision,
|
|
104279
104291
|
standards: [...normalizedRequest.standards],
|
|
104280
104292
|
candidateItemsPerStandard: normalizedRequest.candidateItemsPerStandard,
|
|
104281
|
-
...normalizedRequest.requireBothQuestions ? { requireBothQuestions: true } : {},
|
|
104282
104293
|
selections: [...selected.selections],
|
|
104283
104294
|
fulfillment: selected.fulfillment
|
|
104284
104295
|
}
|