@playcademy/sdk 0.16.1-beta.8 → 0.16.1-beta.9
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.js +18 -3
- package/dist/internal.d.ts +3 -1
- package/dist/internal.js +20 -5
- package/dist/server/edge.js +6 -2
- package/dist/server.js +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -823,7 +823,7 @@ var TIMEBACK_SUBJECTS = [
|
|
|
823
823
|
"Math",
|
|
824
824
|
"None"
|
|
825
825
|
];
|
|
826
|
-
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review"];
|
|
826
|
+
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review", "mastery"];
|
|
827
827
|
var TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS = {
|
|
828
828
|
standards: 20,
|
|
829
829
|
itemsPerStandard: 5,
|
|
@@ -2957,7 +2957,7 @@ var VALID_MASTERY_INCLUDE_OPTIONS = ["perCourse"];
|
|
|
2957
2957
|
var ASSESSMENTS_ROUTE = TIMEBACK_ROUTES.ASSESSMENTS;
|
|
2958
2958
|
function validateAssessmentFilters(options) {
|
|
2959
2959
|
if (!isAssessmentPurpose(options?.purpose)) {
|
|
2960
|
-
throw new Error("purpose must be end_of_course, diagnostic, or
|
|
2960
|
+
throw new Error("purpose must be end_of_course, diagnostic, review, or mastery");
|
|
2961
2961
|
}
|
|
2962
2962
|
if (options.grade !== undefined && !isValidGrade(options.grade)) {
|
|
2963
2963
|
throw new Error(`Invalid grade: ${options.grade}. Valid grades: ${VALID_GRADES.join(", ")}`);
|
|
@@ -2965,6 +2965,17 @@ function validateAssessmentFilters(options) {
|
|
|
2965
2965
|
if (options.subject !== undefined && !isValidSubject(options.subject)) {
|
|
2966
2966
|
throw new Error(`Invalid subject: ${options.subject}. Valid subjects: ${VALID_SUBJECTS.join(", ")}`);
|
|
2967
2967
|
}
|
|
2968
|
+
if (options.purpose === "mastery") {
|
|
2969
|
+
const { standard } = options;
|
|
2970
|
+
const framework = typeof standard?.framework === "string" ? standard.framework.trim() : "";
|
|
2971
|
+
const identifier = typeof standard?.identifier === "string" ? standard.identifier.trim() : "";
|
|
2972
|
+
if (!framework || !identifier) {
|
|
2973
|
+
throw new Error("mastery standard requires a canonical framework and identifier");
|
|
2974
|
+
}
|
|
2975
|
+
if (framework.length > TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength || identifier.length > TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength) {
|
|
2976
|
+
throw new Error(`mastery standard fields must be at most ${TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength} characters`);
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2968
2979
|
}
|
|
2969
2980
|
function createTimebackNamespace(client) {
|
|
2970
2981
|
const engine = createTimebackEngine(client);
|
|
@@ -3008,6 +3019,10 @@ function createTimebackNamespace(client) {
|
|
|
3008
3019
|
if (options.grade !== undefined) {
|
|
3009
3020
|
params.set("grade", String(options.grade));
|
|
3010
3021
|
}
|
|
3022
|
+
if (options.purpose === "mastery") {
|
|
3023
|
+
params.set("standardFramework", options.standard.framework);
|
|
3024
|
+
params.set("standardIdentifier", options.standard.identifier);
|
|
3025
|
+
}
|
|
3011
3026
|
return client["requestGameBackend"](`${ASSESSMENTS_ROUTE}/latest?${params.toString()}`, "GET");
|
|
3012
3027
|
},
|
|
3013
3028
|
get: async (attemptId) => {
|
|
@@ -3445,7 +3460,7 @@ async function request({
|
|
|
3445
3460
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
3446
3461
|
}
|
|
3447
3462
|
// src/version.ts
|
|
3448
|
-
var SDK_VERSION = "0.16.1-beta.
|
|
3463
|
+
var SDK_VERSION = "0.16.1-beta.9";
|
|
3449
3464
|
|
|
3450
3465
|
// src/clients/base.ts
|
|
3451
3466
|
class PlaycademyBaseClient {
|
package/dist/internal.d.ts
CHANGED
|
@@ -3985,10 +3985,12 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
|
|
|
3985
3985
|
create: (gameId: string, courseId: string, data: {
|
|
3986
3986
|
title: string;
|
|
3987
3987
|
purpose: _playcademy_types.AssessmentPurpose;
|
|
3988
|
+
standard?: _playcademy_types.AssessmentStandardRef;
|
|
3988
3989
|
}) => Promise<_playcademy_types.AssessmentRow>;
|
|
3989
3990
|
update: (gameId: string, courseId: string, testIdentifier: string, data: {
|
|
3990
3991
|
title?: string;
|
|
3991
3992
|
purpose?: _playcademy_types.AssessmentPurpose;
|
|
3993
|
+
standard?: _playcademy_types.AssessmentStandardRef;
|
|
3992
3994
|
status?: _playcademy_types.AssessmentStatus;
|
|
3993
3995
|
}) => Promise<_playcademy_types.AssessmentRow>;
|
|
3994
3996
|
reorder: (gameId: string, courseId: string, purpose: _playcademy_types.AssessmentPurpose, testIdentifiers: string[]) => Promise<{
|
|
@@ -3998,7 +4000,7 @@ declare class PlaycademyInternalClient extends PlaycademyBaseClient {
|
|
|
3998
4000
|
action: 'discarded' | 'archived';
|
|
3999
4001
|
}>;
|
|
4000
4002
|
listTestLibrary: (gameId: string, courseId: string, options?: QtiLibraryQueryOptions) => Promise<_playcademy_types.QtiAssessmentTestListResponse>;
|
|
4001
|
-
copy: (gameId: string, courseId: string, testIdentifier: string, purpose: _playcademy_types.AssessmentPurpose) => Promise<_playcademy_types.AssessmentRow>;
|
|
4003
|
+
copy: (gameId: string, courseId: string, testIdentifier: string, purpose: _playcademy_types.AssessmentPurpose, standard?: _playcademy_types.AssessmentStandardRef) => Promise<_playcademy_types.AssessmentRow>;
|
|
4002
4004
|
listQuestions: (gameId: string, courseId: string, testIdentifier: string) => Promise<_playcademy_types.QtiTestQuestionsResponse>;
|
|
4003
4005
|
listQuestionLibrary: (gameId: string, courseId: string, options?: QtiLibraryQueryOptions) => Promise<_playcademy_types.QtiAssessmentItemListResponse>;
|
|
4004
4006
|
createQuestion: (gameId: string, courseId: string, testIdentifier: string, data: _playcademy_types.QtiQuestionCreateInput) => Promise<_playcademy_types.QtiTestQuestionRef>;
|
package/dist/internal.js
CHANGED
|
@@ -823,7 +823,7 @@ var TIMEBACK_SUBJECTS = [
|
|
|
823
823
|
"Math",
|
|
824
824
|
"None"
|
|
825
825
|
];
|
|
826
|
-
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review"];
|
|
826
|
+
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review", "mastery"];
|
|
827
827
|
var TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS = {
|
|
828
828
|
standards: 20,
|
|
829
829
|
itemsPerStandard: 5,
|
|
@@ -2957,7 +2957,7 @@ var VALID_MASTERY_INCLUDE_OPTIONS = ["perCourse"];
|
|
|
2957
2957
|
var ASSESSMENTS_ROUTE = TIMEBACK_ROUTES.ASSESSMENTS;
|
|
2958
2958
|
function validateAssessmentFilters(options) {
|
|
2959
2959
|
if (!isAssessmentPurpose(options?.purpose)) {
|
|
2960
|
-
throw new Error("purpose must be end_of_course, diagnostic, or
|
|
2960
|
+
throw new Error("purpose must be end_of_course, diagnostic, review, or mastery");
|
|
2961
2961
|
}
|
|
2962
2962
|
if (options.grade !== undefined && !isValidGrade(options.grade)) {
|
|
2963
2963
|
throw new Error(`Invalid grade: ${options.grade}. Valid grades: ${VALID_GRADES.join(", ")}`);
|
|
@@ -2965,6 +2965,17 @@ function validateAssessmentFilters(options) {
|
|
|
2965
2965
|
if (options.subject !== undefined && !isValidSubject(options.subject)) {
|
|
2966
2966
|
throw new Error(`Invalid subject: ${options.subject}. Valid subjects: ${VALID_SUBJECTS.join(", ")}`);
|
|
2967
2967
|
}
|
|
2968
|
+
if (options.purpose === "mastery") {
|
|
2969
|
+
const { standard } = options;
|
|
2970
|
+
const framework = typeof standard?.framework === "string" ? standard.framework.trim() : "";
|
|
2971
|
+
const identifier = typeof standard?.identifier === "string" ? standard.identifier.trim() : "";
|
|
2972
|
+
if (!framework || !identifier) {
|
|
2973
|
+
throw new Error("mastery standard requires a canonical framework and identifier");
|
|
2974
|
+
}
|
|
2975
|
+
if (framework.length > TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength || identifier.length > TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength) {
|
|
2976
|
+
throw new Error(`mastery standard fields must be at most ${TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS.standardFieldLength} characters`);
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2968
2979
|
}
|
|
2969
2980
|
function createTimebackNamespace(client) {
|
|
2970
2981
|
const engine = createTimebackEngine(client);
|
|
@@ -3008,6 +3019,10 @@ function createTimebackNamespace(client) {
|
|
|
3008
3019
|
if (options.grade !== undefined) {
|
|
3009
3020
|
params.set("grade", String(options.grade));
|
|
3010
3021
|
}
|
|
3022
|
+
if (options.purpose === "mastery") {
|
|
3023
|
+
params.set("standardFramework", options.standard.framework);
|
|
3024
|
+
params.set("standardIdentifier", options.standard.identifier);
|
|
3025
|
+
}
|
|
3011
3026
|
return client["requestGameBackend"](`${ASSESSMENTS_ROUTE}/latest?${params.toString()}`, "GET");
|
|
3012
3027
|
},
|
|
3013
3028
|
get: async (attemptId) => {
|
|
@@ -3887,8 +3902,8 @@ function createAssessmentNamespace(client) {
|
|
|
3887
3902
|
}),
|
|
3888
3903
|
remove: (gameId, courseId, testIdentifier) => client["request"](assessmentPath(gameId, courseId, testIdentifier), "DELETE"),
|
|
3889
3904
|
listTestLibrary: (gameId, courseId, options = {}) => client["request"](`${assessmentPath(gameId, courseId, "test-library")}${buildQtiLibraryQueryString(options)}`, "GET"),
|
|
3890
|
-
copy: (gameId, courseId, testIdentifier, purpose) => client["request"](assessmentPath(gameId, courseId, "copies"), "POST", {
|
|
3891
|
-
body: { testIdentifier, purpose }
|
|
3905
|
+
copy: (gameId, courseId, testIdentifier, purpose, standard) => client["request"](assessmentPath(gameId, courseId, "copies"), "POST", {
|
|
3906
|
+
body: { testIdentifier, purpose, standard }
|
|
3892
3907
|
}),
|
|
3893
3908
|
listQuestions: (gameId, courseId, testIdentifier) => client["request"](assessmentPath(gameId, courseId, testIdentifier, "questions"), "GET"),
|
|
3894
3909
|
listQuestionLibrary: (gameId, courseId, options = {}) => client["request"](`${assessmentPath(gameId, courseId, "question-library")}${buildQtiLibraryQueryString(options)}`, "GET"),
|
|
@@ -4320,7 +4335,7 @@ async function request({
|
|
|
4320
4335
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
4321
4336
|
}
|
|
4322
4337
|
// src/version.ts
|
|
4323
|
-
var SDK_VERSION = "0.16.1-beta.
|
|
4338
|
+
var SDK_VERSION = "0.16.1-beta.9";
|
|
4324
4339
|
|
|
4325
4340
|
// src/clients/base.ts
|
|
4326
4341
|
class PlaycademyBaseClient {
|
package/dist/server/edge.js
CHANGED
|
@@ -41,7 +41,7 @@ var TIMEBACK_SUBJECTS = [
|
|
|
41
41
|
"Math",
|
|
42
42
|
"None"
|
|
43
43
|
];
|
|
44
|
-
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review"];
|
|
44
|
+
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review", "mastery"];
|
|
45
45
|
var TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS = {
|
|
46
46
|
standards: 20,
|
|
47
47
|
itemsPerStandard: 5,
|
|
@@ -97,6 +97,10 @@ function createTimebackNamespace(client) {
|
|
|
97
97
|
if (options.grade !== undefined) {
|
|
98
98
|
params.set("grade", String(options.grade));
|
|
99
99
|
}
|
|
100
|
+
if (options.purpose === "mastery") {
|
|
101
|
+
params.set("standardFramework", options.standard.framework);
|
|
102
|
+
params.set("standardIdentifier", options.standard.identifier);
|
|
103
|
+
}
|
|
100
104
|
return client["request"](`/api/timeback/assessments/latest?${params.toString()}`, "GET");
|
|
101
105
|
},
|
|
102
106
|
get: (studentId, attemptId) => {
|
|
@@ -308,7 +312,7 @@ function extractApiErrorInfo(error) {
|
|
|
308
312
|
}
|
|
309
313
|
|
|
310
314
|
// src/version.ts
|
|
311
|
-
var SDK_VERSION = "0.16.1-beta.
|
|
315
|
+
var SDK_VERSION = "0.16.1-beta.9";
|
|
312
316
|
|
|
313
317
|
// src/server/request.ts
|
|
314
318
|
async function makeApiRequest(opts) {
|
package/dist/server.js
CHANGED
|
@@ -230,7 +230,7 @@ var TIMEBACK_SUBJECTS = [
|
|
|
230
230
|
"Math",
|
|
231
231
|
"None"
|
|
232
232
|
];
|
|
233
|
-
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review"];
|
|
233
|
+
var ASSESSMENT_PURPOSES = ["end_of_course", "diagnostic", "review", "mastery"];
|
|
234
234
|
var TIMEBACK_ASSESSMENT_REVIEW_REQUEST_LIMITS = {
|
|
235
235
|
standards: 20,
|
|
236
236
|
itemsPerStandard: 5,
|
|
@@ -286,6 +286,10 @@ function createTimebackNamespace(client) {
|
|
|
286
286
|
if (options.grade !== undefined) {
|
|
287
287
|
params.set("grade", String(options.grade));
|
|
288
288
|
}
|
|
289
|
+
if (options.purpose === "mastery") {
|
|
290
|
+
params.set("standardFramework", options.standard.framework);
|
|
291
|
+
params.set("standardIdentifier", options.standard.identifier);
|
|
292
|
+
}
|
|
289
293
|
return client["request"](`/api/timeback/assessments/latest?${params.toString()}`, "GET");
|
|
290
294
|
},
|
|
291
295
|
get: (studentId, attemptId) => {
|
|
@@ -497,7 +501,7 @@ function extractApiErrorInfo(error) {
|
|
|
497
501
|
}
|
|
498
502
|
|
|
499
503
|
// src/version.ts
|
|
500
|
-
var SDK_VERSION = "0.16.1-beta.
|
|
504
|
+
var SDK_VERSION = "0.16.1-beta.9";
|
|
501
505
|
|
|
502
506
|
// src/server/request.ts
|
|
503
507
|
async function makeApiRequest(opts) {
|