@playcademy/sandbox 0.8.1-beta.7 → 0.9.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/cli.js +38 -9
- package/dist/server.js +38 -9
- 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.
|
|
1131
|
+
version: "0.9.0",
|
|
1132
1132
|
description: "Local development server for Playcademy game development",
|
|
1133
1133
|
type: "module",
|
|
1134
1134
|
exports: {
|
|
@@ -100429,6 +100429,20 @@ function assessmentAttemptId(input) {
|
|
|
100429
100429
|
String(input.attemptNumber)
|
|
100430
100430
|
].join("\x00"));
|
|
100431
100431
|
}
|
|
100432
|
+
function buildAssessmentAttemptResultWhere(scope) {
|
|
100433
|
+
return {
|
|
100434
|
+
"student.sourcedId": scope.studentId,
|
|
100435
|
+
status: ONEROSTER_STATUS2.active,
|
|
100436
|
+
[`metadata.${PLAYCADEMY_ASSESSMENT_RESULT_METADATA_KEY}.activityId`]: scope.activityId
|
|
100437
|
+
};
|
|
100438
|
+
}
|
|
100439
|
+
function buildAssessmentChildResultWhere(scope) {
|
|
100440
|
+
return {
|
|
100441
|
+
"student.sourcedId": scope.studentId,
|
|
100442
|
+
status: ONEROSTER_STATUS2.active,
|
|
100443
|
+
[`metadata.${PLAYCADEMY_ASSESSMENT_ITEM_RESULT_METADATA_KEY}.payload.attempt.activityId`]: scope.activityId
|
|
100444
|
+
};
|
|
100445
|
+
}
|
|
100432
100446
|
async function findLatestAssessmentResult(results, match) {
|
|
100433
100447
|
let latest = null;
|
|
100434
100448
|
let latestTimestamp = 0;
|
|
@@ -100868,6 +100882,7 @@ var PLAYABLE_SHAPE_SET;
|
|
|
100868
100882
|
var init_timeback_assessment_runtime_util = __esm(() => {
|
|
100869
100883
|
init_src();
|
|
100870
100884
|
init_assessment_runtime2();
|
|
100885
|
+
init_constants3();
|
|
100871
100886
|
init_qti();
|
|
100872
100887
|
init_types2();
|
|
100873
100888
|
init_utils6();
|
|
@@ -103728,7 +103743,11 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
103728
103743
|
const startedAt = Date.now();
|
|
103729
103744
|
const [candidates, results] = await Promise.all([
|
|
103730
103745
|
this.candidateIntegrations(params.gameId, params.studentId, params.input),
|
|
103731
|
-
this.
|
|
103746
|
+
this.activityAssessmentResults({
|
|
103747
|
+
studentId: params.studentId,
|
|
103748
|
+
activityId: params.input.activityId,
|
|
103749
|
+
purpose: params.input.purpose
|
|
103750
|
+
})
|
|
103732
103751
|
]);
|
|
103733
103752
|
const context2 = await this.selectIntegration(candidates, params.input);
|
|
103734
103753
|
const attemptScope = {
|
|
@@ -104791,12 +104810,19 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104791
104810
|
standard: assessmentStandardForRow(row)
|
|
104792
104811
|
})).filter((test) => !matchesMasteryStandard || matchesMasteryStandard(test.standard));
|
|
104793
104812
|
}
|
|
104794
|
-
async
|
|
104813
|
+
async activityAssessmentResults(scope) {
|
|
104814
|
+
const [parents, children] = await Promise.all([
|
|
104815
|
+
this.collectAssessmentResults(buildAssessmentAttemptResultWhere(scope)),
|
|
104816
|
+
scope.purpose === "review" ? this.activityChildResults(scope) : []
|
|
104817
|
+
]);
|
|
104818
|
+
return [...parents, ...children];
|
|
104819
|
+
}
|
|
104820
|
+
activityChildResults(scope) {
|
|
104821
|
+
return this.collectAssessmentResults(buildAssessmentChildResultWhere(scope));
|
|
104822
|
+
}
|
|
104823
|
+
async collectAssessmentResults(where) {
|
|
104795
104824
|
const stream = this.requireClient().api.oneroster.assessmentResults.stream({
|
|
104796
|
-
where
|
|
104797
|
-
"student.sourcedId": studentId,
|
|
104798
|
-
status: ONEROSTER_STATUS2.active
|
|
104799
|
-
}
|
|
104825
|
+
where
|
|
104800
104826
|
});
|
|
104801
104827
|
const results = [];
|
|
104802
104828
|
for await (const result of stream) {
|
|
@@ -104805,7 +104831,7 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104805
104831
|
return results;
|
|
104806
104832
|
}
|
|
104807
104833
|
async listAttempts(scope) {
|
|
104808
|
-
return this.attemptListing(await this.
|
|
104834
|
+
return this.attemptListing(await this.activityAssessmentResults(scope), scope);
|
|
104809
104835
|
}
|
|
104810
104836
|
async attemptListing(results, scope) {
|
|
104811
104837
|
const attempts = new Map;
|
|
@@ -105570,7 +105596,10 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
105570
105596
|
const graded = await resumeAssessmentTranscript({
|
|
105571
105597
|
suppliedTranscript,
|
|
105572
105598
|
checkpointTranscript: metadata2.transcript,
|
|
105573
|
-
recover: async () => recoverAssessmentTranscript(context2, await this.
|
|
105599
|
+
recover: async () => recoverAssessmentTranscript(context2, await this.activityChildResults({
|
|
105600
|
+
studentId: context2.studentId,
|
|
105601
|
+
activityId: context2.metadata.activityId
|
|
105602
|
+
})),
|
|
105574
105603
|
grade: (transcript) => this.gradeTranscript(context2, transcript)
|
|
105575
105604
|
});
|
|
105576
105605
|
const session2 = await this.assessmentSession(context2, graded.transcript);
|
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.
|
|
1130
|
+
version: "0.9.0",
|
|
1131
1131
|
description: "Local development server for Playcademy game development",
|
|
1132
1132
|
type: "module",
|
|
1133
1133
|
exports: {
|
|
@@ -100428,6 +100428,20 @@ function assessmentAttemptId(input) {
|
|
|
100428
100428
|
String(input.attemptNumber)
|
|
100429
100429
|
].join("\x00"));
|
|
100430
100430
|
}
|
|
100431
|
+
function buildAssessmentAttemptResultWhere(scope) {
|
|
100432
|
+
return {
|
|
100433
|
+
"student.sourcedId": scope.studentId,
|
|
100434
|
+
status: ONEROSTER_STATUS2.active,
|
|
100435
|
+
[`metadata.${PLAYCADEMY_ASSESSMENT_RESULT_METADATA_KEY}.activityId`]: scope.activityId
|
|
100436
|
+
};
|
|
100437
|
+
}
|
|
100438
|
+
function buildAssessmentChildResultWhere(scope) {
|
|
100439
|
+
return {
|
|
100440
|
+
"student.sourcedId": scope.studentId,
|
|
100441
|
+
status: ONEROSTER_STATUS2.active,
|
|
100442
|
+
[`metadata.${PLAYCADEMY_ASSESSMENT_ITEM_RESULT_METADATA_KEY}.payload.attempt.activityId`]: scope.activityId
|
|
100443
|
+
};
|
|
100444
|
+
}
|
|
100431
100445
|
async function findLatestAssessmentResult(results, match) {
|
|
100432
100446
|
let latest = null;
|
|
100433
100447
|
let latestTimestamp = 0;
|
|
@@ -100867,6 +100881,7 @@ var PLAYABLE_SHAPE_SET;
|
|
|
100867
100881
|
var init_timeback_assessment_runtime_util = __esm(() => {
|
|
100868
100882
|
init_src();
|
|
100869
100883
|
init_assessment_runtime2();
|
|
100884
|
+
init_constants3();
|
|
100870
100885
|
init_qti();
|
|
100871
100886
|
init_types2();
|
|
100872
100887
|
init_utils6();
|
|
@@ -103727,7 +103742,11 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
103727
103742
|
const startedAt = Date.now();
|
|
103728
103743
|
const [candidates, results] = await Promise.all([
|
|
103729
103744
|
this.candidateIntegrations(params.gameId, params.studentId, params.input),
|
|
103730
|
-
this.
|
|
103745
|
+
this.activityAssessmentResults({
|
|
103746
|
+
studentId: params.studentId,
|
|
103747
|
+
activityId: params.input.activityId,
|
|
103748
|
+
purpose: params.input.purpose
|
|
103749
|
+
})
|
|
103731
103750
|
]);
|
|
103732
103751
|
const context2 = await this.selectIntegration(candidates, params.input);
|
|
103733
103752
|
const attemptScope = {
|
|
@@ -104790,12 +104809,19 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104790
104809
|
standard: assessmentStandardForRow(row)
|
|
104791
104810
|
})).filter((test) => !matchesMasteryStandard || matchesMasteryStandard(test.standard));
|
|
104792
104811
|
}
|
|
104793
|
-
async
|
|
104812
|
+
async activityAssessmentResults(scope) {
|
|
104813
|
+
const [parents, children] = await Promise.all([
|
|
104814
|
+
this.collectAssessmentResults(buildAssessmentAttemptResultWhere(scope)),
|
|
104815
|
+
scope.purpose === "review" ? this.activityChildResults(scope) : []
|
|
104816
|
+
]);
|
|
104817
|
+
return [...parents, ...children];
|
|
104818
|
+
}
|
|
104819
|
+
activityChildResults(scope) {
|
|
104820
|
+
return this.collectAssessmentResults(buildAssessmentChildResultWhere(scope));
|
|
104821
|
+
}
|
|
104822
|
+
async collectAssessmentResults(where) {
|
|
104794
104823
|
const stream = this.requireClient().api.oneroster.assessmentResults.stream({
|
|
104795
|
-
where
|
|
104796
|
-
"student.sourcedId": studentId,
|
|
104797
|
-
status: ONEROSTER_STATUS2.active
|
|
104798
|
-
}
|
|
104824
|
+
where
|
|
104799
104825
|
});
|
|
104800
104826
|
const results = [];
|
|
104801
104827
|
for await (const result of stream) {
|
|
@@ -104804,7 +104830,7 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
104804
104830
|
return results;
|
|
104805
104831
|
}
|
|
104806
104832
|
async listAttempts(scope) {
|
|
104807
|
-
return this.attemptListing(await this.
|
|
104833
|
+
return this.attemptListing(await this.activityAssessmentResults(scope), scope);
|
|
104808
104834
|
}
|
|
104809
104835
|
async attemptListing(results, scope) {
|
|
104810
104836
|
const attempts = new Map;
|
|
@@ -105569,7 +105595,10 @@ var init_timeback_assessment_runtime_service = __esm(async () => {
|
|
|
105569
105595
|
const graded = await resumeAssessmentTranscript({
|
|
105570
105596
|
suppliedTranscript,
|
|
105571
105597
|
checkpointTranscript: metadata2.transcript,
|
|
105572
|
-
recover: async () => recoverAssessmentTranscript(context2, await this.
|
|
105598
|
+
recover: async () => recoverAssessmentTranscript(context2, await this.activityChildResults({
|
|
105599
|
+
studentId: context2.studentId,
|
|
105600
|
+
activityId: context2.metadata.activityId
|
|
105601
|
+
})),
|
|
105573
105602
|
grade: (transcript) => this.gradeTranscript(context2, transcript)
|
|
105574
105603
|
});
|
|
105575
105604
|
const session2 = await this.assessmentSession(context2, graded.transcript);
|