@playcademy/sdk 0.24.1-beta.1 → 0.24.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/index.d.ts +124 -1
- package/dist/index.js +31 -3
- package/dist/internal.d.ts +125 -2
- package/dist/internal.js +31 -3
- package/dist/server/edge.d.ts +24 -1
- package/dist/server/edge.js +1 -1
- package/dist/server.d.ts +24 -1
- package/dist/server.js +1 -1
- package/dist/types.d.ts +125 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -297,8 +297,18 @@ interface ActivityData {
|
|
|
297
297
|
subject: CaliperSubject;
|
|
298
298
|
/** Activity display name (optional) */
|
|
299
299
|
activityName?: string;
|
|
300
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* Optional course to report against. When omitted, the SDK fills it from
|
|
302
|
+
* the student's enrollment for this grade/subject (preferring a
|
|
303
|
+
* hole-filling course). The platform uses it if it's the base course or one
|
|
304
|
+
* of that grade/subject's hole-filling courses, otherwise the base course.
|
|
305
|
+
*/
|
|
301
306
|
courseId?: string;
|
|
307
|
+
/**
|
|
308
|
+
* The student's enrollment in `courseId`. Filled by the SDK alongside an
|
|
309
|
+
* automatic `courseId`; recorded on hole-filling Caliper events.
|
|
310
|
+
*/
|
|
311
|
+
enrollmentId?: string;
|
|
302
312
|
/** Course display name (auto-filled from config if not provided) */
|
|
303
313
|
courseName?: string;
|
|
304
314
|
/** Student email address (optional) */
|
|
@@ -395,6 +405,8 @@ interface HeartbeatRequestBase {
|
|
|
395
405
|
appName?: string;
|
|
396
406
|
sensorUrl?: string;
|
|
397
407
|
courseId?: string;
|
|
408
|
+
/** The student's enrollment in `courseId`, sent by the SDK with the course hint. */
|
|
409
|
+
enrollmentId?: string;
|
|
398
410
|
courseName?: string;
|
|
399
411
|
studentEmail?: string;
|
|
400
412
|
};
|
|
@@ -448,6 +460,8 @@ interface EndActivityRequest {
|
|
|
448
460
|
appName?: string;
|
|
449
461
|
sensorUrl?: string;
|
|
450
462
|
courseId?: string;
|
|
463
|
+
/** The student's enrollment in `courseId`, sent by the SDK with the course hint. */
|
|
464
|
+
enrollmentId?: string;
|
|
451
465
|
courseName?: string;
|
|
452
466
|
studentEmail?: string;
|
|
453
467
|
};
|
|
@@ -477,7 +491,14 @@ interface TimebackPromotionResult {
|
|
|
477
491
|
}
|
|
478
492
|
interface EndActivityResponse {
|
|
479
493
|
status: 'ok';
|
|
494
|
+
/** The course the activity was recorded against. */
|
|
480
495
|
courseId: string;
|
|
496
|
+
/**
|
|
497
|
+
* `'hole_filling'` when the activity was recorded against a hole-filling
|
|
498
|
+
* course (the student is enrolled there, or the game passed its
|
|
499
|
+
* `courseId`); `'base'` otherwise.
|
|
500
|
+
*/
|
|
501
|
+
courseKind?: GameTimebackIntegrationKind;
|
|
481
502
|
xpAwarded: number;
|
|
482
503
|
masteredUnits?: number;
|
|
483
504
|
pctCompleteApp?: number;
|
|
@@ -514,6 +535,71 @@ interface UnenrollCourseResponse {
|
|
|
514
535
|
status: 'ok';
|
|
515
536
|
unenrollment: TimebackUnenrollmentResult;
|
|
516
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* The test result that sent a student into a hole-filling course: the
|
|
540
|
+
* assignment Timeback stamped on the hole-filling enrollment.
|
|
541
|
+
*/
|
|
542
|
+
interface HoleFillingTriggeringResult {
|
|
543
|
+
/** OneRoster assessment result id. */
|
|
544
|
+
resultId: string;
|
|
545
|
+
/** AlphaTest assignment id, always a string. */
|
|
546
|
+
assignmentId: string;
|
|
547
|
+
/** OneRoster assessment line item id of the test. */
|
|
548
|
+
lineItemId: string;
|
|
549
|
+
testName: string;
|
|
550
|
+
testType: 'end of course' | 'test out' | 'placement';
|
|
551
|
+
/** The QTI assessment test, when it could be found. */
|
|
552
|
+
qtiTestId?: string;
|
|
553
|
+
/**
|
|
554
|
+
* The result's score as Timeback recorded it, on the test's own scale
|
|
555
|
+
* (AlphaTest tests score 0-100). Not rescaled.
|
|
556
|
+
*/
|
|
557
|
+
score: number | null;
|
|
558
|
+
scoreDate: string | null;
|
|
559
|
+
totalQuestions: number | null;
|
|
560
|
+
correctQuestions: number | null;
|
|
561
|
+
}
|
|
562
|
+
/** A curriculum standard the student missed questions on. */
|
|
563
|
+
interface HoleFillingMissedStandard {
|
|
564
|
+
/** Standards framework as named by the QTI item's alignment (canonicalized). */
|
|
565
|
+
framework: string;
|
|
566
|
+
/** Standard code, e.g. `K.OA.A.2`. */
|
|
567
|
+
code: string;
|
|
568
|
+
/** 1-based positions of the missed questions in the test. */
|
|
569
|
+
questionNumbers: number[];
|
|
570
|
+
/** QTI items of the missed questions. */
|
|
571
|
+
qtiItemIds: string[];
|
|
572
|
+
}
|
|
573
|
+
/** What a game needs to tailor a student's hole-filling course. */
|
|
574
|
+
interface HoleFillingContext {
|
|
575
|
+
enrollment: {
|
|
576
|
+
/** The hole-filling course. */
|
|
577
|
+
courseId: string;
|
|
578
|
+
/** The base course it belongs to. */
|
|
579
|
+
baseCourseId: string;
|
|
580
|
+
/** The student's hole-filling enrollment. */
|
|
581
|
+
enrollmentId?: string;
|
|
582
|
+
grade: TimebackGrade;
|
|
583
|
+
subject: TimebackSubject;
|
|
584
|
+
beginDate?: string | null;
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* Null when Timeback hasn't stamped an assignment on the enrollment, or the
|
|
588
|
+
* stamped assignment has no fully graded test result yet.
|
|
589
|
+
*/
|
|
590
|
+
triggeringResult: HoleFillingTriggeringResult | null;
|
|
591
|
+
/** Missed questions grouped by standard, most-missed first. */
|
|
592
|
+
missedStandards: HoleFillingMissedStandard[];
|
|
593
|
+
/** Missed questions whose item has no standard tag. */
|
|
594
|
+
untaggedMissedQuestionNumbers: number[];
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Response from the hole-filling context endpoint: one entry per active
|
|
598
|
+
* hole-filling enrollment the student has in this game (usually zero or one).
|
|
599
|
+
*/
|
|
600
|
+
interface HoleFillingContextResponse {
|
|
601
|
+
contexts: HoleFillingContext[];
|
|
602
|
+
}
|
|
517
603
|
|
|
518
604
|
declare const DIAGNOSTIC_TRACK_OUTCOMES: readonly ['provisional', 'unresolved', 'route-to-instruction', 'not-assessed'];
|
|
519
605
|
type DiagnosticTrackOutcome = (typeof DIAGNOSTIC_TRACK_OUTCOMES)[number];
|
|
@@ -2410,6 +2496,41 @@ interface TimebackUser extends TimebackUserContext {
|
|
|
2410
2496
|
* highest mastered grade for a subject.
|
|
2411
2497
|
*/
|
|
2412
2498
|
highestGradeMastered: TimebackUserHighestGradeMastered;
|
|
2499
|
+
/**
|
|
2500
|
+
* Hole-filling context for the current user.
|
|
2501
|
+
* Call `holeFilling.fetch()` to learn why the student is in a
|
|
2502
|
+
* hole-filling course and which standards to target.
|
|
2503
|
+
*/
|
|
2504
|
+
holeFilling: TimebackUserHoleFilling;
|
|
2505
|
+
}
|
|
2506
|
+
/**
|
|
2507
|
+
* Hole-filling context access for the current user.
|
|
2508
|
+
* Results are cached for 5 minutes.
|
|
2509
|
+
*/
|
|
2510
|
+
interface TimebackUserHoleFilling {
|
|
2511
|
+
/**
|
|
2512
|
+
* Fetch the test result that sent the student into each of their
|
|
2513
|
+
* hole-filling courses in this game, and the curriculum standards of the
|
|
2514
|
+
* questions they missed (most-missed first).
|
|
2515
|
+
*
|
|
2516
|
+
* Returns `{ contexts: [] }` when the student has no hole-filling
|
|
2517
|
+
* enrollment. Results are cached for 5 minutes (use `force: true` to
|
|
2518
|
+
* bypass, e.g. after `user.refresh()` picks up a new enrollment).
|
|
2519
|
+
*
|
|
2520
|
+
* @param options - Cache options
|
|
2521
|
+
* @returns Promise resolving to one context per hole-filling enrollment
|
|
2522
|
+
*
|
|
2523
|
+
* @example
|
|
2524
|
+
* ```typescript
|
|
2525
|
+
* const { contexts } = await client.timeback.user.holeFilling.fetch()
|
|
2526
|
+
* const context = contexts.find(c => c.enrollment.subject === 'Math')
|
|
2527
|
+
*
|
|
2528
|
+
* if (context) {
|
|
2529
|
+
* const targetCodes = context.missedStandards.map(s => s.code) // ['K.OA.A.2', ...]
|
|
2530
|
+
* }
|
|
2531
|
+
* ```
|
|
2532
|
+
*/
|
|
2533
|
+
fetch(options?: TTLCacheConfig): Promise<HoleFillingContextResponse>;
|
|
2413
2534
|
}
|
|
2414
2535
|
/**
|
|
2415
2536
|
* Mastery data access for the current user.
|
|
@@ -3040,6 +3161,8 @@ interface EmbedTimebackRecording {
|
|
|
3040
3161
|
subject: TimebackSubject;
|
|
3041
3162
|
/** Course id hint, same semantics as `startActivity()`. */
|
|
3042
3163
|
courseId?: string;
|
|
3164
|
+
/** The student's enrollment in `courseId`; filled with it automatically. */
|
|
3165
|
+
enrollmentId?: string;
|
|
3043
3166
|
}
|
|
3044
3167
|
/**
|
|
3045
3168
|
* Everything a parent needs to resume an interrupted launch later. The
|
package/dist/index.js
CHANGED
|
@@ -2289,6 +2289,23 @@ function createTimebackActivityTracker(client) {
|
|
|
2289
2289
|
};
|
|
2290
2290
|
}
|
|
2291
2291
|
|
|
2292
|
+
// src/core/timeback/course-hint.ts
|
|
2293
|
+
function withEnrollmentCourseHint(metadata, enrollments) {
|
|
2294
|
+
if (metadata.courseId !== undefined) {
|
|
2295
|
+
return metadata;
|
|
2296
|
+
}
|
|
2297
|
+
const matching = enrollments.filter((enrollment) => enrollment.grade === metadata.grade && enrollment.subject === metadata.subject);
|
|
2298
|
+
const enrollment = matching.find((candidate) => candidate.kind === "hole_filling") ?? matching[0];
|
|
2299
|
+
if (!enrollment) {
|
|
2300
|
+
return metadata;
|
|
2301
|
+
}
|
|
2302
|
+
return {
|
|
2303
|
+
...metadata,
|
|
2304
|
+
courseId: enrollment.courseId,
|
|
2305
|
+
...enrollment.id && { enrollmentId: enrollment.id }
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2292
2309
|
// src/namespaces/game/embed.ts
|
|
2293
2310
|
function createEmbedNamespace(client) {
|
|
2294
2311
|
return {
|
|
@@ -2325,7 +2342,7 @@ function createEmbedNamespace(client) {
|
|
|
2325
2342
|
const session = new ChildSession({
|
|
2326
2343
|
slug: options.slug,
|
|
2327
2344
|
container: options.container,
|
|
2328
|
-
timeback: options.timeback,
|
|
2345
|
+
timeback: options.timeback && withEnrollmentCourseHint(options.timeback, client.timeback.user?.enrollments ?? []),
|
|
2329
2346
|
resume: resume.envelope,
|
|
2330
2347
|
resumeStore: resume.store,
|
|
2331
2348
|
reporter: {
|
|
@@ -2913,6 +2930,10 @@ function createTimebackEngine(client) {
|
|
|
2913
2930
|
ttl: 5000,
|
|
2914
2931
|
keyPrefix: "game.timeback.highestGradeMastered"
|
|
2915
2932
|
});
|
|
2933
|
+
const holeFillingCache = createTTLCache({
|
|
2934
|
+
ttl: 5 * 60 * 1000,
|
|
2935
|
+
keyPrefix: "game.timeback.holeFilling"
|
|
2936
|
+
});
|
|
2916
2937
|
const enrollmentsCache = createTTLCache({
|
|
2917
2938
|
ttl: 5 * 60 * 1000,
|
|
2918
2939
|
keyPrefix: "game.timeback.enrollments"
|
|
@@ -2923,6 +2944,7 @@ function createTimebackEngine(client) {
|
|
|
2923
2944
|
xpCache.clear();
|
|
2924
2945
|
masteryCache.clear();
|
|
2925
2946
|
highestGradeMasteredCache.clear();
|
|
2947
|
+
holeFillingCache.clear();
|
|
2926
2948
|
try {
|
|
2927
2949
|
await userStore.refresh();
|
|
2928
2950
|
} catch {}
|
|
@@ -3018,12 +3040,15 @@ function createTimebackEngine(client) {
|
|
|
3018
3040
|
const endpoint = `${TIMEBACK_ROUTES.GET_HIGHEST_GRADE_MASTERED}?${params.toString()}`;
|
|
3019
3041
|
return client["requestGameBackend"](endpoint, "GET");
|
|
3020
3042
|
}, { force: options.force })
|
|
3043
|
+
},
|
|
3044
|
+
holeFilling: {
|
|
3045
|
+
fetch: (options) => holeFillingCache.get("current", () => client["request"]("/timeback/user/hole-filling-context", "GET"), options)
|
|
3021
3046
|
}
|
|
3022
3047
|
},
|
|
3023
3048
|
activity: {
|
|
3024
3049
|
currentRunId: activityTracker.currentRunId,
|
|
3025
3050
|
isManuallyPaused: activityTracker.isActivityManuallyPaused,
|
|
3026
|
-
start: activityTracker.startActivity,
|
|
3051
|
+
start: (metadata, options) => activityTracker.startActivity(withEnrollmentCourseHint(metadata, userStore.snapshot()?.enrollments ?? []), options),
|
|
3027
3052
|
tryStartAssessment: activityTracker.tryStartAssessmentTracking,
|
|
3028
3053
|
pause: activityTracker.pauseActivity,
|
|
3029
3054
|
resume: activityTracker.resumeActivity,
|
|
@@ -3435,6 +3460,9 @@ function createTimebackNamespace(client) {
|
|
|
3435
3460
|
}
|
|
3436
3461
|
return engine.user.highestGradeMastered.fetch(options);
|
|
3437
3462
|
}
|
|
3463
|
+
},
|
|
3464
|
+
holeFilling: {
|
|
3465
|
+
fetch: (options) => engine.user.holeFilling.fetch(options)
|
|
3438
3466
|
}
|
|
3439
3467
|
};
|
|
3440
3468
|
},
|
|
@@ -3765,7 +3793,7 @@ async function request({
|
|
|
3765
3793
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
3766
3794
|
}
|
|
3767
3795
|
// src/version.ts
|
|
3768
|
-
var SDK_VERSION = "0.24.1-beta.
|
|
3796
|
+
var SDK_VERSION = "0.24.1-beta.3";
|
|
3769
3797
|
|
|
3770
3798
|
// src/clients/base.ts
|
|
3771
3799
|
class PlaycademyBaseClient {
|
package/dist/internal.d.ts
CHANGED
|
@@ -349,8 +349,18 @@ interface ActivityData {
|
|
|
349
349
|
subject: CaliperSubject;
|
|
350
350
|
/** Activity display name (optional) */
|
|
351
351
|
activityName?: string;
|
|
352
|
-
/**
|
|
352
|
+
/**
|
|
353
|
+
* Optional course to report against. When omitted, the SDK fills it from
|
|
354
|
+
* the student's enrollment for this grade/subject (preferring a
|
|
355
|
+
* hole-filling course). The platform uses it if it's the base course or one
|
|
356
|
+
* of that grade/subject's hole-filling courses, otherwise the base course.
|
|
357
|
+
*/
|
|
353
358
|
courseId?: string;
|
|
359
|
+
/**
|
|
360
|
+
* The student's enrollment in `courseId`. Filled by the SDK alongside an
|
|
361
|
+
* automatic `courseId`; recorded on hole-filling Caliper events.
|
|
362
|
+
*/
|
|
363
|
+
enrollmentId?: string;
|
|
354
364
|
/** Course display name (auto-filled from config if not provided) */
|
|
355
365
|
courseName?: string;
|
|
356
366
|
/** Student email address (optional) */
|
|
@@ -909,6 +919,8 @@ interface HeartbeatRequestBase {
|
|
|
909
919
|
appName?: string;
|
|
910
920
|
sensorUrl?: string;
|
|
911
921
|
courseId?: string;
|
|
922
|
+
/** The student's enrollment in `courseId`, sent by the SDK with the course hint. */
|
|
923
|
+
enrollmentId?: string;
|
|
912
924
|
courseName?: string;
|
|
913
925
|
studentEmail?: string;
|
|
914
926
|
};
|
|
@@ -962,6 +974,8 @@ interface EndActivityRequest {
|
|
|
962
974
|
appName?: string;
|
|
963
975
|
sensorUrl?: string;
|
|
964
976
|
courseId?: string;
|
|
977
|
+
/** The student's enrollment in `courseId`, sent by the SDK with the course hint. */
|
|
978
|
+
enrollmentId?: string;
|
|
965
979
|
courseName?: string;
|
|
966
980
|
studentEmail?: string;
|
|
967
981
|
};
|
|
@@ -983,7 +997,14 @@ interface EndActivityRequest {
|
|
|
983
997
|
}
|
|
984
998
|
interface EndActivityResponse {
|
|
985
999
|
status: 'ok';
|
|
1000
|
+
/** The course the activity was recorded against. */
|
|
986
1001
|
courseId: string;
|
|
1002
|
+
/**
|
|
1003
|
+
* `'hole_filling'` when the activity was recorded against a hole-filling
|
|
1004
|
+
* course (the student is enrolled there, or the game passed its
|
|
1005
|
+
* `courseId`); `'base'` otherwise.
|
|
1006
|
+
*/
|
|
1007
|
+
courseKind?: GameTimebackIntegrationKind;
|
|
987
1008
|
xpAwarded: number;
|
|
988
1009
|
masteredUnits?: number;
|
|
989
1010
|
pctCompleteApp?: number;
|
|
@@ -1187,6 +1208,71 @@ interface TimebackGradeLevelTestReviewResponse {
|
|
|
1187
1208
|
questions: TimebackGradeLevelTestQuestionResult[];
|
|
1188
1209
|
standards: TimebackGradeLevelTestStandardSummary[];
|
|
1189
1210
|
}
|
|
1211
|
+
/**
|
|
1212
|
+
* The test result that sent a student into a hole-filling course: the
|
|
1213
|
+
* assignment Timeback stamped on the hole-filling enrollment.
|
|
1214
|
+
*/
|
|
1215
|
+
interface HoleFillingTriggeringResult {
|
|
1216
|
+
/** OneRoster assessment result id. */
|
|
1217
|
+
resultId: string;
|
|
1218
|
+
/** AlphaTest assignment id, always a string. */
|
|
1219
|
+
assignmentId: string;
|
|
1220
|
+
/** OneRoster assessment line item id of the test. */
|
|
1221
|
+
lineItemId: string;
|
|
1222
|
+
testName: string;
|
|
1223
|
+
testType: 'end of course' | 'test out' | 'placement';
|
|
1224
|
+
/** The QTI assessment test, when it could be found. */
|
|
1225
|
+
qtiTestId?: string;
|
|
1226
|
+
/**
|
|
1227
|
+
* The result's score as Timeback recorded it, on the test's own scale
|
|
1228
|
+
* (AlphaTest tests score 0-100). Not rescaled.
|
|
1229
|
+
*/
|
|
1230
|
+
score: number | null;
|
|
1231
|
+
scoreDate: string | null;
|
|
1232
|
+
totalQuestions: number | null;
|
|
1233
|
+
correctQuestions: number | null;
|
|
1234
|
+
}
|
|
1235
|
+
/** A curriculum standard the student missed questions on. */
|
|
1236
|
+
interface HoleFillingMissedStandard {
|
|
1237
|
+
/** Standards framework as named by the QTI item's alignment (canonicalized). */
|
|
1238
|
+
framework: string;
|
|
1239
|
+
/** Standard code, e.g. `K.OA.A.2`. */
|
|
1240
|
+
code: string;
|
|
1241
|
+
/** 1-based positions of the missed questions in the test. */
|
|
1242
|
+
questionNumbers: number[];
|
|
1243
|
+
/** QTI items of the missed questions. */
|
|
1244
|
+
qtiItemIds: string[];
|
|
1245
|
+
}
|
|
1246
|
+
/** What a game needs to tailor a student's hole-filling course. */
|
|
1247
|
+
interface HoleFillingContext {
|
|
1248
|
+
enrollment: {
|
|
1249
|
+
/** The hole-filling course. */
|
|
1250
|
+
courseId: string;
|
|
1251
|
+
/** The base course it belongs to. */
|
|
1252
|
+
baseCourseId: string;
|
|
1253
|
+
/** The student's hole-filling enrollment. */
|
|
1254
|
+
enrollmentId?: string;
|
|
1255
|
+
grade: TimebackGrade;
|
|
1256
|
+
subject: TimebackSubject;
|
|
1257
|
+
beginDate?: string | null;
|
|
1258
|
+
};
|
|
1259
|
+
/**
|
|
1260
|
+
* Null when Timeback hasn't stamped an assignment on the enrollment, or the
|
|
1261
|
+
* stamped assignment has no fully graded test result yet.
|
|
1262
|
+
*/
|
|
1263
|
+
triggeringResult: HoleFillingTriggeringResult | null;
|
|
1264
|
+
/** Missed questions grouped by standard, most-missed first. */
|
|
1265
|
+
missedStandards: HoleFillingMissedStandard[];
|
|
1266
|
+
/** Missed questions whose item has no standard tag. */
|
|
1267
|
+
untaggedMissedQuestionNumbers: number[];
|
|
1268
|
+
}
|
|
1269
|
+
/**
|
|
1270
|
+
* Response from the hole-filling context endpoint: one entry per active
|
|
1271
|
+
* hole-filling enrollment the student has in this game (usually zero or one).
|
|
1272
|
+
*/
|
|
1273
|
+
interface HoleFillingContextResponse {
|
|
1274
|
+
contexts: HoleFillingContext[];
|
|
1275
|
+
}
|
|
1190
1276
|
type TimebackDiscrepancyQueueWindow = 'all' | 'today' | 'yesterday' | 'this-week' | 'last-week' | 'custom';
|
|
1191
1277
|
interface TimebackDiscrepancyQueueDateRange {
|
|
1192
1278
|
startDate?: string;
|
|
@@ -5606,6 +5692,41 @@ interface TimebackUser extends TimebackUserContext {
|
|
|
5606
5692
|
* highest mastered grade for a subject.
|
|
5607
5693
|
*/
|
|
5608
5694
|
highestGradeMastered: TimebackUserHighestGradeMastered;
|
|
5695
|
+
/**
|
|
5696
|
+
* Hole-filling context for the current user.
|
|
5697
|
+
* Call `holeFilling.fetch()` to learn why the student is in a
|
|
5698
|
+
* hole-filling course and which standards to target.
|
|
5699
|
+
*/
|
|
5700
|
+
holeFilling: TimebackUserHoleFilling;
|
|
5701
|
+
}
|
|
5702
|
+
/**
|
|
5703
|
+
* Hole-filling context access for the current user.
|
|
5704
|
+
* Results are cached for 5 minutes.
|
|
5705
|
+
*/
|
|
5706
|
+
interface TimebackUserHoleFilling {
|
|
5707
|
+
/**
|
|
5708
|
+
* Fetch the test result that sent the student into each of their
|
|
5709
|
+
* hole-filling courses in this game, and the curriculum standards of the
|
|
5710
|
+
* questions they missed (most-missed first).
|
|
5711
|
+
*
|
|
5712
|
+
* Returns `{ contexts: [] }` when the student has no hole-filling
|
|
5713
|
+
* enrollment. Results are cached for 5 minutes (use `force: true` to
|
|
5714
|
+
* bypass, e.g. after `user.refresh()` picks up a new enrollment).
|
|
5715
|
+
*
|
|
5716
|
+
* @param options - Cache options
|
|
5717
|
+
* @returns Promise resolving to one context per hole-filling enrollment
|
|
5718
|
+
*
|
|
5719
|
+
* @example
|
|
5720
|
+
* ```typescript
|
|
5721
|
+
* const { contexts } = await client.timeback.user.holeFilling.fetch()
|
|
5722
|
+
* const context = contexts.find(c => c.enrollment.subject === 'Math')
|
|
5723
|
+
*
|
|
5724
|
+
* if (context) {
|
|
5725
|
+
* const targetCodes = context.missedStandards.map(s => s.code) // ['K.OA.A.2', ...]
|
|
5726
|
+
* }
|
|
5727
|
+
* ```
|
|
5728
|
+
*/
|
|
5729
|
+
fetch(options?: TTLCacheConfig): Promise<HoleFillingContextResponse>;
|
|
5609
5730
|
}
|
|
5610
5731
|
/**
|
|
5611
5732
|
* Mastery data access for the current user.
|
|
@@ -6079,6 +6200,8 @@ interface EmbedTimebackRecording {
|
|
|
6079
6200
|
subject: TimebackSubject;
|
|
6080
6201
|
/** Course id hint, same semantics as `startActivity()`. */
|
|
6081
6202
|
courseId?: string;
|
|
6203
|
+
/** The student's enrollment in `courseId`; filled with it automatically. */
|
|
6204
|
+
enrollmentId?: string;
|
|
6082
6205
|
}
|
|
6083
6206
|
/**
|
|
6084
6207
|
* Everything a parent needs to resume an interrupted launch later. The
|
|
@@ -7343,4 +7466,4 @@ interface BeginInitHandshakeOptions {
|
|
|
7343
7466
|
declare function beginInitHandshake({ iframe, origin, payload, onTimeout, onSendError }: BeginInitHandshakeOptions): () => void;
|
|
7344
7467
|
|
|
7345
7468
|
export { ApiError, HANDSHAKE_MAX_DURATION_MS, HANDSHAKE_RESEND_INTERVAL_MS, INIT_WAIT_TIMEOUT_MS, MessageEvents, PlaycademyInternalClient as PlaycademyClient, PlaycademyError, PlaycademyInternalClient, beginInitHandshake, extractApiErrorInfo, isTrustedIframeMessage, messaging };
|
|
7346
|
-
export type { ApiErrorCode, ApiErrorInfo, AssessmentAttemptSnapshot, AssessmentAwardRecord, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemGrading, AssessmentItemOutcome, AssessmentItemSubmission, AssessmentMasteryAward, AssessmentPreparationResult, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentReviewStandard, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, AssessmentTranscript, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, BucketFile, BucketFilePage, BucketListPageOptions, ChildCheckpointRelay, ClientConfig, ClientEvents, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, CourseMastery, CourseXp, DemoEndOptions, DemoEndPayload, DeploySource, DevUploadEvent, DevUploadHooks, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, EmbedActivity, EmbedActivityAbandoned, EmbedActivityCompleted, EmbedActivityFailed, EmbedLaunchOptions, EmbedResumeEnvelope, EmbedResumeStore, EmbedSession, EmbedSessionTiming, EmbedTimebackRecording, ErrorResponseBody, EventListeners, ExternalGame, FetchedGame, FinalizeAssessmentInput, Game, GameContextPayload, GameCourseMetrics, GameCustomHostname, GameInitUser, GameLeaderboardEntry, GameManifest, GameMetricComparisonKind, GameMetricComparisonMetric, GameMetricComparisonRow, GameMetricComparisonRowStatus, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameRow as GameRecord, GameReleaseResponse, GameRunMetrics, GameRunMetricsComparison, GameRunMetricsComparisonStatus, GameRunMetricsComparisonSummary, GameTimebackIntegration, GameTokenResponse, GameType, GameUser, GetHighestGradeMasteredOptions, GetMasteryOptions, GetXpOptions, HighestGradeMasteredResponse, HostedGame, InitErrorPayload, InitPayload, KVKeyEntry, KVKeyMetadata, KVSeedEntry, KVStatsResponse, KeyEventPayload, LaunchIntent, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, LocalDayContext, LocalDaySource, LoginResponse, ManifestV1, ManifestV2, ManifestVersions, MasteryAssessmentSubmitResult, MasteryResponse, MessageEventMap, ParentGameContext, ParentGameHandle, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlatformTimebackUser, PlatformTimebackUserContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableChoiceInteraction, PlayableContentNode, PlayableGapMatchChoice, PlayableGapMatchInteraction, PlayableInlineChoiceInteraction, PlayableMatchChoice, PlayableMatchInteraction, PlayableOrderInteraction, PlaycademyMode, PlaycademyServerClientConfig, PlaycademyServerClientState, PopulateStudentResponse, RecordAssessmentProgressInput, Release, ReleasesResponse, ResumeAssessmentInput, SaveAssessmentInput, ScoreSubmission, SettledAssessmentAttemptSnapshot, SkillMasterySource, SkillStatus, SkillStatusLookupResult, SkillStatusRequest, SkillStatusRequestingGame, SkillStatusResponse, SkillStatusResult, SkillStatusUnsupportedReason, StandardsReviewSelectionContext, StartActivityOptions, StartActivityResult, StartAssessmentInput, StartAssessmentOptions, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult, TelemetryPayload, TimebackActivityEndRelay, TimebackActivityStartRelay, TimebackEnrollment, TimebackHeartbeatRelayRequest, TimebackInitContext, TimebackOrganization, TimebackUser, TimebackUserContext, TimebackUserHighestGradeMastered, TimebackUserMastery, TimebackUserRefreshField, TimebackUserRefreshOptions, TimebackUserXp, TokenRefreshPayload, TokenType, UpsertGameMetadataInput, UserRow as User, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData, UserTimebackProfile, XpResponse };
|
|
7469
|
+
export type { ApiErrorCode, ApiErrorInfo, AssessmentAttemptSnapshot, AssessmentAwardRecord, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemGrading, AssessmentItemOutcome, AssessmentItemSubmission, AssessmentMasteryAward, AssessmentPreparationResult, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentReviewStandard, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, AssessmentTranscript, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, BucketFile, BucketFilePage, BucketListPageOptions, ChildCheckpointRelay, ClientConfig, ClientEvents, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, CourseMastery, CourseXp, DemoEndOptions, DemoEndPayload, DeploySource, DevUploadEvent, DevUploadHooks, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, EmbedActivity, EmbedActivityAbandoned, EmbedActivityCompleted, EmbedActivityFailed, EmbedLaunchOptions, EmbedResumeEnvelope, EmbedResumeStore, EmbedSession, EmbedSessionTiming, EmbedTimebackRecording, ErrorResponseBody, EventListeners, ExternalGame, FetchedGame, FinalizeAssessmentInput, Game, GameContextPayload, GameCourseMetrics, GameCustomHostname, GameInitUser, GameLeaderboardEntry, GameManifest, GameMetricComparisonKind, GameMetricComparisonMetric, GameMetricComparisonRow, GameMetricComparisonRowStatus, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameRow as GameRecord, GameReleaseResponse, GameRunMetrics, GameRunMetricsComparison, GameRunMetricsComparisonStatus, GameRunMetricsComparisonSummary, GameTimebackIntegration, GameTokenResponse, GameType, GameUser, GetHighestGradeMasteredOptions, GetMasteryOptions, GetXpOptions, HighestGradeMasteredResponse, HoleFillingContext, HoleFillingContextResponse, HoleFillingMissedStandard, HoleFillingTriggeringResult, HostedGame, InitErrorPayload, InitPayload, KVKeyEntry, KVKeyMetadata, KVSeedEntry, KVStatsResponse, KeyEventPayload, LaunchIntent, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, LocalDayContext, LocalDaySource, LoginResponse, ManifestV1, ManifestV2, ManifestVersions, MasteryAssessmentSubmitResult, MasteryResponse, MessageEventMap, ParentGameContext, ParentGameHandle, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlatformTimebackUser, PlatformTimebackUserContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableChoiceInteraction, PlayableContentNode, PlayableGapMatchChoice, PlayableGapMatchInteraction, PlayableInlineChoiceInteraction, PlayableMatchChoice, PlayableMatchInteraction, PlayableOrderInteraction, PlaycademyMode, PlaycademyServerClientConfig, PlaycademyServerClientState, PopulateStudentResponse, RecordAssessmentProgressInput, Release, ReleasesResponse, ResumeAssessmentInput, SaveAssessmentInput, ScoreSubmission, SettledAssessmentAttemptSnapshot, SkillMasterySource, SkillStatus, SkillStatusLookupResult, SkillStatusRequest, SkillStatusRequestingGame, SkillStatusResponse, SkillStatusResult, SkillStatusUnsupportedReason, StandardsReviewSelectionContext, StartActivityOptions, StartActivityResult, StartAssessmentInput, StartAssessmentOptions, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult, TelemetryPayload, TimebackActivityEndRelay, TimebackActivityStartRelay, TimebackEnrollment, TimebackHeartbeatRelayRequest, TimebackInitContext, TimebackOrganization, TimebackUser, TimebackUserContext, TimebackUserHighestGradeMastered, TimebackUserHoleFilling, TimebackUserMastery, TimebackUserRefreshField, TimebackUserRefreshOptions, TimebackUserXp, TokenRefreshPayload, TokenType, UpsertGameMetadataInput, UserRow as User, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData, UserTimebackProfile, XpResponse };
|
package/dist/internal.js
CHANGED
|
@@ -2289,6 +2289,23 @@ function createTimebackActivityTracker(client) {
|
|
|
2289
2289
|
};
|
|
2290
2290
|
}
|
|
2291
2291
|
|
|
2292
|
+
// src/core/timeback/course-hint.ts
|
|
2293
|
+
function withEnrollmentCourseHint(metadata, enrollments) {
|
|
2294
|
+
if (metadata.courseId !== undefined) {
|
|
2295
|
+
return metadata;
|
|
2296
|
+
}
|
|
2297
|
+
const matching = enrollments.filter((enrollment) => enrollment.grade === metadata.grade && enrollment.subject === metadata.subject);
|
|
2298
|
+
const enrollment = matching.find((candidate) => candidate.kind === "hole_filling") ?? matching[0];
|
|
2299
|
+
if (!enrollment) {
|
|
2300
|
+
return metadata;
|
|
2301
|
+
}
|
|
2302
|
+
return {
|
|
2303
|
+
...metadata,
|
|
2304
|
+
courseId: enrollment.courseId,
|
|
2305
|
+
...enrollment.id && { enrollmentId: enrollment.id }
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2292
2309
|
// src/namespaces/game/embed.ts
|
|
2293
2310
|
function createEmbedNamespace(client) {
|
|
2294
2311
|
return {
|
|
@@ -2325,7 +2342,7 @@ function createEmbedNamespace(client) {
|
|
|
2325
2342
|
const session = new ChildSession({
|
|
2326
2343
|
slug: options.slug,
|
|
2327
2344
|
container: options.container,
|
|
2328
|
-
timeback: options.timeback,
|
|
2345
|
+
timeback: options.timeback && withEnrollmentCourseHint(options.timeback, client.timeback.user?.enrollments ?? []),
|
|
2329
2346
|
resume: resume.envelope,
|
|
2330
2347
|
resumeStore: resume.store,
|
|
2331
2348
|
reporter: {
|
|
@@ -2913,6 +2930,10 @@ function createTimebackEngine(client) {
|
|
|
2913
2930
|
ttl: 5000,
|
|
2914
2931
|
keyPrefix: "game.timeback.highestGradeMastered"
|
|
2915
2932
|
});
|
|
2933
|
+
const holeFillingCache = createTTLCache({
|
|
2934
|
+
ttl: 5 * 60 * 1000,
|
|
2935
|
+
keyPrefix: "game.timeback.holeFilling"
|
|
2936
|
+
});
|
|
2916
2937
|
const enrollmentsCache = createTTLCache({
|
|
2917
2938
|
ttl: 5 * 60 * 1000,
|
|
2918
2939
|
keyPrefix: "game.timeback.enrollments"
|
|
@@ -2923,6 +2944,7 @@ function createTimebackEngine(client) {
|
|
|
2923
2944
|
xpCache.clear();
|
|
2924
2945
|
masteryCache.clear();
|
|
2925
2946
|
highestGradeMasteredCache.clear();
|
|
2947
|
+
holeFillingCache.clear();
|
|
2926
2948
|
try {
|
|
2927
2949
|
await userStore.refresh();
|
|
2928
2950
|
} catch {}
|
|
@@ -3018,12 +3040,15 @@ function createTimebackEngine(client) {
|
|
|
3018
3040
|
const endpoint = `${TIMEBACK_ROUTES.GET_HIGHEST_GRADE_MASTERED}?${params.toString()}`;
|
|
3019
3041
|
return client["requestGameBackend"](endpoint, "GET");
|
|
3020
3042
|
}, { force: options.force })
|
|
3043
|
+
},
|
|
3044
|
+
holeFilling: {
|
|
3045
|
+
fetch: (options) => holeFillingCache.get("current", () => client["request"]("/timeback/user/hole-filling-context", "GET"), options)
|
|
3021
3046
|
}
|
|
3022
3047
|
},
|
|
3023
3048
|
activity: {
|
|
3024
3049
|
currentRunId: activityTracker.currentRunId,
|
|
3025
3050
|
isManuallyPaused: activityTracker.isActivityManuallyPaused,
|
|
3026
|
-
start: activityTracker.startActivity,
|
|
3051
|
+
start: (metadata, options) => activityTracker.startActivity(withEnrollmentCourseHint(metadata, userStore.snapshot()?.enrollments ?? []), options),
|
|
3027
3052
|
tryStartAssessment: activityTracker.tryStartAssessmentTracking,
|
|
3028
3053
|
pause: activityTracker.pauseActivity,
|
|
3029
3054
|
resume: activityTracker.resumeActivity,
|
|
@@ -3435,6 +3460,9 @@ function createTimebackNamespace(client) {
|
|
|
3435
3460
|
}
|
|
3436
3461
|
return engine.user.highestGradeMastered.fetch(options);
|
|
3437
3462
|
}
|
|
3463
|
+
},
|
|
3464
|
+
holeFilling: {
|
|
3465
|
+
fetch: (options) => engine.user.holeFilling.fetch(options)
|
|
3438
3466
|
}
|
|
3439
3467
|
};
|
|
3440
3468
|
},
|
|
@@ -4685,7 +4713,7 @@ async function request({
|
|
|
4685
4713
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
4686
4714
|
}
|
|
4687
4715
|
// src/version.ts
|
|
4688
|
-
var SDK_VERSION = "0.24.1-beta.
|
|
4716
|
+
var SDK_VERSION = "0.24.1-beta.3";
|
|
4689
4717
|
|
|
4690
4718
|
// src/clients/base.ts
|
|
4691
4719
|
class PlaycademyBaseClient {
|
package/dist/server/edge.d.ts
CHANGED
|
@@ -319,8 +319,18 @@ interface ActivityData {
|
|
|
319
319
|
subject: CaliperSubject;
|
|
320
320
|
/** Activity display name (optional) */
|
|
321
321
|
activityName?: string;
|
|
322
|
-
/**
|
|
322
|
+
/**
|
|
323
|
+
* Optional course to report against. When omitted, the SDK fills it from
|
|
324
|
+
* the student's enrollment for this grade/subject (preferring a
|
|
325
|
+
* hole-filling course). The platform uses it if it's the base course or one
|
|
326
|
+
* of that grade/subject's hole-filling courses, otherwise the base course.
|
|
327
|
+
*/
|
|
323
328
|
courseId?: string;
|
|
329
|
+
/**
|
|
330
|
+
* The student's enrollment in `courseId`. Filled by the SDK alongside an
|
|
331
|
+
* automatic `courseId`; recorded on hole-filling Caliper events.
|
|
332
|
+
*/
|
|
333
|
+
enrollmentId?: string;
|
|
324
334
|
/** Course display name (auto-filled from config if not provided) */
|
|
325
335
|
courseName?: string;
|
|
326
336
|
/** Student email address (optional) */
|
|
@@ -382,9 +392,22 @@ interface EndActivityPayload {
|
|
|
382
392
|
* @module types/timeback/api
|
|
383
393
|
*/
|
|
384
394
|
|
|
395
|
+
/**
|
|
396
|
+
* `base` courses form a game's grade ladder (one active per grade and subject).
|
|
397
|
+
* `hole_filling` courses are remediation courses Timeback enrolls students into
|
|
398
|
+
* after a failed test; each sits beside a base course.
|
|
399
|
+
*/
|
|
400
|
+
type GameTimebackIntegrationKind = 'base' | 'hole_filling';
|
|
385
401
|
interface EndActivityResponse {
|
|
386
402
|
status: 'ok';
|
|
403
|
+
/** The course the activity was recorded against. */
|
|
387
404
|
courseId: string;
|
|
405
|
+
/**
|
|
406
|
+
* `'hole_filling'` when the activity was recorded against a hole-filling
|
|
407
|
+
* course (the student is enrolled there, or the game passed its
|
|
408
|
+
* `courseId`); `'base'` otherwise.
|
|
409
|
+
*/
|
|
410
|
+
courseKind?: GameTimebackIntegrationKind;
|
|
388
411
|
xpAwarded: number;
|
|
389
412
|
masteredUnits?: number;
|
|
390
413
|
pctCompleteApp?: number;
|
package/dist/server/edge.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -319,8 +319,18 @@ interface ActivityData {
|
|
|
319
319
|
subject: CaliperSubject;
|
|
320
320
|
/** Activity display name (optional) */
|
|
321
321
|
activityName?: string;
|
|
322
|
-
/**
|
|
322
|
+
/**
|
|
323
|
+
* Optional course to report against. When omitted, the SDK fills it from
|
|
324
|
+
* the student's enrollment for this grade/subject (preferring a
|
|
325
|
+
* hole-filling course). The platform uses it if it's the base course or one
|
|
326
|
+
* of that grade/subject's hole-filling courses, otherwise the base course.
|
|
327
|
+
*/
|
|
323
328
|
courseId?: string;
|
|
329
|
+
/**
|
|
330
|
+
* The student's enrollment in `courseId`. Filled by the SDK alongside an
|
|
331
|
+
* automatic `courseId`; recorded on hole-filling Caliper events.
|
|
332
|
+
*/
|
|
333
|
+
enrollmentId?: string;
|
|
324
334
|
/** Course display name (auto-filled from config if not provided) */
|
|
325
335
|
courseName?: string;
|
|
326
336
|
/** Student email address (optional) */
|
|
@@ -382,9 +392,22 @@ interface EndActivityPayload {
|
|
|
382
392
|
* @module types/timeback/api
|
|
383
393
|
*/
|
|
384
394
|
|
|
395
|
+
/**
|
|
396
|
+
* `base` courses form a game's grade ladder (one active per grade and subject).
|
|
397
|
+
* `hole_filling` courses are remediation courses Timeback enrolls students into
|
|
398
|
+
* after a failed test; each sits beside a base course.
|
|
399
|
+
*/
|
|
400
|
+
type GameTimebackIntegrationKind = 'base' | 'hole_filling';
|
|
385
401
|
interface EndActivityResponse {
|
|
386
402
|
status: 'ok';
|
|
403
|
+
/** The course the activity was recorded against. */
|
|
387
404
|
courseId: string;
|
|
405
|
+
/**
|
|
406
|
+
* `'hole_filling'` when the activity was recorded against a hole-filling
|
|
407
|
+
* course (the student is enrolled there, or the game passed its
|
|
408
|
+
* `courseId`); `'base'` otherwise.
|
|
409
|
+
*/
|
|
410
|
+
courseKind?: GameTimebackIntegrationKind;
|
|
388
411
|
xpAwarded: number;
|
|
389
412
|
masteredUnits?: number;
|
|
390
413
|
pctCompleteApp?: number;
|
package/dist/server.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -356,8 +356,18 @@ interface ActivityData {
|
|
|
356
356
|
subject: CaliperSubject;
|
|
357
357
|
/** Activity display name (optional) */
|
|
358
358
|
activityName?: string;
|
|
359
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* Optional course to report against. When omitted, the SDK fills it from
|
|
361
|
+
* the student's enrollment for this grade/subject (preferring a
|
|
362
|
+
* hole-filling course). The platform uses it if it's the base course or one
|
|
363
|
+
* of that grade/subject's hole-filling courses, otherwise the base course.
|
|
364
|
+
*/
|
|
360
365
|
courseId?: string;
|
|
366
|
+
/**
|
|
367
|
+
* The student's enrollment in `courseId`. Filled by the SDK alongside an
|
|
368
|
+
* automatic `courseId`; recorded on hole-filling Caliper events.
|
|
369
|
+
*/
|
|
370
|
+
enrollmentId?: string;
|
|
361
371
|
/** Course display name (auto-filled from config if not provided) */
|
|
362
372
|
courseName?: string;
|
|
363
373
|
/** Student email address (optional) */
|
|
@@ -533,6 +543,8 @@ interface HeartbeatRequestBase {
|
|
|
533
543
|
appName?: string;
|
|
534
544
|
sensorUrl?: string;
|
|
535
545
|
courseId?: string;
|
|
546
|
+
/** The student's enrollment in `courseId`, sent by the SDK with the course hint. */
|
|
547
|
+
enrollmentId?: string;
|
|
536
548
|
courseName?: string;
|
|
537
549
|
studentEmail?: string;
|
|
538
550
|
};
|
|
@@ -586,6 +598,8 @@ interface EndActivityRequest {
|
|
|
586
598
|
appName?: string;
|
|
587
599
|
sensorUrl?: string;
|
|
588
600
|
courseId?: string;
|
|
601
|
+
/** The student's enrollment in `courseId`, sent by the SDK with the course hint. */
|
|
602
|
+
enrollmentId?: string;
|
|
589
603
|
courseName?: string;
|
|
590
604
|
studentEmail?: string;
|
|
591
605
|
};
|
|
@@ -615,7 +629,14 @@ interface TimebackPromotionResult {
|
|
|
615
629
|
}
|
|
616
630
|
interface EndActivityResponse {
|
|
617
631
|
status: 'ok';
|
|
632
|
+
/** The course the activity was recorded against. */
|
|
618
633
|
courseId: string;
|
|
634
|
+
/**
|
|
635
|
+
* `'hole_filling'` when the activity was recorded against a hole-filling
|
|
636
|
+
* course (the student is enrolled there, or the game passed its
|
|
637
|
+
* `courseId`); `'base'` otherwise.
|
|
638
|
+
*/
|
|
639
|
+
courseKind?: GameTimebackIntegrationKind;
|
|
619
640
|
xpAwarded: number;
|
|
620
641
|
masteredUnits?: number;
|
|
621
642
|
pctCompleteApp?: number;
|
|
@@ -652,6 +673,71 @@ interface UnenrollCourseResponse {
|
|
|
652
673
|
status: 'ok';
|
|
653
674
|
unenrollment: TimebackUnenrollmentResult;
|
|
654
675
|
}
|
|
676
|
+
/**
|
|
677
|
+
* The test result that sent a student into a hole-filling course: the
|
|
678
|
+
* assignment Timeback stamped on the hole-filling enrollment.
|
|
679
|
+
*/
|
|
680
|
+
interface HoleFillingTriggeringResult {
|
|
681
|
+
/** OneRoster assessment result id. */
|
|
682
|
+
resultId: string;
|
|
683
|
+
/** AlphaTest assignment id, always a string. */
|
|
684
|
+
assignmentId: string;
|
|
685
|
+
/** OneRoster assessment line item id of the test. */
|
|
686
|
+
lineItemId: string;
|
|
687
|
+
testName: string;
|
|
688
|
+
testType: 'end of course' | 'test out' | 'placement';
|
|
689
|
+
/** The QTI assessment test, when it could be found. */
|
|
690
|
+
qtiTestId?: string;
|
|
691
|
+
/**
|
|
692
|
+
* The result's score as Timeback recorded it, on the test's own scale
|
|
693
|
+
* (AlphaTest tests score 0-100). Not rescaled.
|
|
694
|
+
*/
|
|
695
|
+
score: number | null;
|
|
696
|
+
scoreDate: string | null;
|
|
697
|
+
totalQuestions: number | null;
|
|
698
|
+
correctQuestions: number | null;
|
|
699
|
+
}
|
|
700
|
+
/** A curriculum standard the student missed questions on. */
|
|
701
|
+
interface HoleFillingMissedStandard {
|
|
702
|
+
/** Standards framework as named by the QTI item's alignment (canonicalized). */
|
|
703
|
+
framework: string;
|
|
704
|
+
/** Standard code, e.g. `K.OA.A.2`. */
|
|
705
|
+
code: string;
|
|
706
|
+
/** 1-based positions of the missed questions in the test. */
|
|
707
|
+
questionNumbers: number[];
|
|
708
|
+
/** QTI items of the missed questions. */
|
|
709
|
+
qtiItemIds: string[];
|
|
710
|
+
}
|
|
711
|
+
/** What a game needs to tailor a student's hole-filling course. */
|
|
712
|
+
interface HoleFillingContext {
|
|
713
|
+
enrollment: {
|
|
714
|
+
/** The hole-filling course. */
|
|
715
|
+
courseId: string;
|
|
716
|
+
/** The base course it belongs to. */
|
|
717
|
+
baseCourseId: string;
|
|
718
|
+
/** The student's hole-filling enrollment. */
|
|
719
|
+
enrollmentId?: string;
|
|
720
|
+
grade: TimebackGrade;
|
|
721
|
+
subject: TimebackSubject;
|
|
722
|
+
beginDate?: string | null;
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* Null when Timeback hasn't stamped an assignment on the enrollment, or the
|
|
726
|
+
* stamped assignment has no fully graded test result yet.
|
|
727
|
+
*/
|
|
728
|
+
triggeringResult: HoleFillingTriggeringResult | null;
|
|
729
|
+
/** Missed questions grouped by standard, most-missed first. */
|
|
730
|
+
missedStandards: HoleFillingMissedStandard[];
|
|
731
|
+
/** Missed questions whose item has no standard tag. */
|
|
732
|
+
untaggedMissedQuestionNumbers: number[];
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Response from the hole-filling context endpoint: one entry per active
|
|
736
|
+
* hole-filling enrollment the student has in this game (usually zero or one).
|
|
737
|
+
*/
|
|
738
|
+
interface HoleFillingContextResponse {
|
|
739
|
+
contexts: HoleFillingContext[];
|
|
740
|
+
}
|
|
655
741
|
|
|
656
742
|
declare const DIAGNOSTIC_TRACK_OUTCOMES: readonly ['provisional', 'unresolved', 'route-to-instruction', 'not-assessed'];
|
|
657
743
|
type DiagnosticTrackOutcome = (typeof DIAGNOSTIC_TRACK_OUTCOMES)[number];
|
|
@@ -3374,6 +3460,41 @@ interface TimebackUser extends TimebackUserContext {
|
|
|
3374
3460
|
* highest mastered grade for a subject.
|
|
3375
3461
|
*/
|
|
3376
3462
|
highestGradeMastered: TimebackUserHighestGradeMastered;
|
|
3463
|
+
/**
|
|
3464
|
+
* Hole-filling context for the current user.
|
|
3465
|
+
* Call `holeFilling.fetch()` to learn why the student is in a
|
|
3466
|
+
* hole-filling course and which standards to target.
|
|
3467
|
+
*/
|
|
3468
|
+
holeFilling: TimebackUserHoleFilling;
|
|
3469
|
+
}
|
|
3470
|
+
/**
|
|
3471
|
+
* Hole-filling context access for the current user.
|
|
3472
|
+
* Results are cached for 5 minutes.
|
|
3473
|
+
*/
|
|
3474
|
+
interface TimebackUserHoleFilling {
|
|
3475
|
+
/**
|
|
3476
|
+
* Fetch the test result that sent the student into each of their
|
|
3477
|
+
* hole-filling courses in this game, and the curriculum standards of the
|
|
3478
|
+
* questions they missed (most-missed first).
|
|
3479
|
+
*
|
|
3480
|
+
* Returns `{ contexts: [] }` when the student has no hole-filling
|
|
3481
|
+
* enrollment. Results are cached for 5 minutes (use `force: true` to
|
|
3482
|
+
* bypass, e.g. after `user.refresh()` picks up a new enrollment).
|
|
3483
|
+
*
|
|
3484
|
+
* @param options - Cache options
|
|
3485
|
+
* @returns Promise resolving to one context per hole-filling enrollment
|
|
3486
|
+
*
|
|
3487
|
+
* @example
|
|
3488
|
+
* ```typescript
|
|
3489
|
+
* const { contexts } = await client.timeback.user.holeFilling.fetch()
|
|
3490
|
+
* const context = contexts.find(c => c.enrollment.subject === 'Math')
|
|
3491
|
+
*
|
|
3492
|
+
* if (context) {
|
|
3493
|
+
* const targetCodes = context.missedStandards.map(s => s.code) // ['K.OA.A.2', ...]
|
|
3494
|
+
* }
|
|
3495
|
+
* ```
|
|
3496
|
+
*/
|
|
3497
|
+
fetch(options?: TTLCacheConfig): Promise<HoleFillingContextResponse>;
|
|
3377
3498
|
}
|
|
3378
3499
|
/**
|
|
3379
3500
|
* Mastery data access for the current user.
|
|
@@ -4013,6 +4134,8 @@ interface EmbedTimebackRecording {
|
|
|
4013
4134
|
subject: TimebackSubject;
|
|
4014
4135
|
/** Course id hint, same semantics as `startActivity()`. */
|
|
4015
4136
|
courseId?: string;
|
|
4137
|
+
/** The student's enrollment in `courseId`; filled with it automatically. */
|
|
4138
|
+
enrollmentId?: string;
|
|
4016
4139
|
}
|
|
4017
4140
|
/**
|
|
4018
4141
|
* Everything a parent needs to resume an interrupted launch later. The
|
|
@@ -4467,4 +4590,4 @@ interface PlatformTimebackUser extends PlatformTimebackUserContext {
|
|
|
4467
4590
|
}
|
|
4468
4591
|
|
|
4469
4592
|
export { PlaycademyClient };
|
|
4470
|
-
export type { AssessmentAttemptSnapshot, AssessmentAwardRecord, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemGrading, AssessmentItemOutcome, AssessmentItemSubmission, AssessmentMasteryAward, AssessmentPreparationResult, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentReviewStandard, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, AssessmentTranscript, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, BucketFile, BucketFilePage, BucketListPageOptions, ChildCheckpointRelay, ClientConfig, ClientEvents, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, CourseMastery, CourseXp, DemoEndOptions, DemoEndPayload, DeploySource, DevUploadEvent, DevUploadHooks, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, EmbedActivity, EmbedActivityAbandoned, EmbedActivityCompleted, EmbedActivityFailed, EmbedLaunchOptions, EmbedResumeEnvelope, EmbedResumeStore, EmbedSession, EmbedSessionTiming, EmbedTimebackRecording, EventListeners, ExternalGame, FetchedGame, FinalizeAssessmentInput, Game, GameContextPayload, GameCourseMetrics, GameCustomHostname, GameInitUser, GameLeaderboardEntry, GameManifest, GameMetricComparisonKind, GameMetricComparisonMetric, GameMetricComparisonRow, GameMetricComparisonRowStatus, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameRow as GameRecord, GameReleaseResponse, GameRunMetrics, GameRunMetricsComparison, GameRunMetricsComparisonStatus, GameRunMetricsComparisonSummary, GameTimebackIntegration, GameTokenResponse, GameType, GameUser, GetHighestGradeMasteredOptions, GetMasteryOptions, GetXpOptions, HighestGradeMasteredResponse, HostedGame, InitErrorPayload, InitPayload, KVKeyEntry, KVKeyMetadata, KVSeedEntry, KVStatsResponse, KeyEventPayload, LaunchIntent, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, LocalDayContext, LocalDaySource, LoginResponse, ManifestV1, ManifestV2, ManifestVersions, MasteryAssessmentSubmitResult, MasteryResponse, ParentGameContext, ParentGameHandle, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlatformTimebackUser, PlatformTimebackUserContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableChoiceInteraction, PlayableContentNode, PlayableGapMatchChoice, PlayableGapMatchInteraction, PlayableInlineChoiceInteraction, PlayableMatchChoice, PlayableMatchInteraction, PlayableOrderInteraction, PlaycademyMode, PlaycademyServerClientConfig, PlaycademyServerClientState, PopulateStudentResponse, RecordAssessmentProgressInput, Release, ReleasesResponse, ResumeAssessmentInput, SaveAssessmentInput, ScoreSubmission, SettledAssessmentAttemptSnapshot, SkillMasterySource, SkillStatus, SkillStatusLookupResult, SkillStatusRequest, SkillStatusRequestingGame, SkillStatusResponse, SkillStatusResult, SkillStatusUnsupportedReason, StandardsReviewSelectionContext, StartActivityOptions, StartActivityResult, StartAssessmentInput, StartAssessmentOptions, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult, TelemetryPayload, TimebackActivityEndRelay, TimebackActivityStartRelay, TimebackEnrollment, TimebackHeartbeatRelayRequest, TimebackInitContext, TimebackOrganization, TimebackUser, TimebackUserContext, TimebackUserHighestGradeMastered, TimebackUserMastery, TimebackUserRefreshField, TimebackUserRefreshOptions, TimebackUserXp, TokenRefreshPayload, TokenType, UpsertGameMetadataInput, UserRow as User, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData, UserTimebackProfile, XpResponse };
|
|
4593
|
+
export type { AssessmentAttemptSnapshot, AssessmentAwardRecord, AssessmentFinalizeResult, AssessmentFlow, AssessmentItemGrading, AssessmentItemOutcome, AssessmentItemSubmission, AssessmentMasteryAward, AssessmentPreparationResult, AssessmentResponseUpdate, AssessmentResponseValue, AssessmentResponses, AssessmentReviewStandard, AssessmentSaveResult, AssessmentScore, AssessmentStandardRef, AssessmentSubmitResult, AssessmentTranscript, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, BucketFile, BucketFilePage, BucketListPageOptions, ChildCheckpointRelay, ClientConfig, ClientEvents, ConventionalAssessmentAttemptSnapshot, ConventionalAssessmentSubmitResult, CourseMastery, CourseXp, DemoEndOptions, DemoEndPayload, DeploySource, DevUploadEvent, DevUploadHooks, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, DiagnosticAssessmentItemReceipt, DiagnosticAssessmentSubmitResult, DiagnosticRoutingSnapshot, DiagnosticRoutingTrackSnapshot, ELevel, EmbedActivity, EmbedActivityAbandoned, EmbedActivityCompleted, EmbedActivityFailed, EmbedLaunchOptions, EmbedResumeEnvelope, EmbedResumeStore, EmbedSession, EmbedSessionTiming, EmbedTimebackRecording, EventListeners, ExternalGame, FetchedGame, FinalizeAssessmentInput, Game, GameContextPayload, GameCourseMetrics, GameCustomHostname, GameInitUser, GameLeaderboardEntry, GameManifest, GameMetricComparisonKind, GameMetricComparisonMetric, GameMetricComparisonRow, GameMetricComparisonRowStatus, GameMetricsProxyResponse, GameMetricsResponse, GameMetricsUnsupportedReason, GamePlatform, GameRow as GameRecord, GameReleaseResponse, GameRunMetrics, GameRunMetricsComparison, GameRunMetricsComparisonStatus, GameRunMetricsComparisonSummary, GameTimebackIntegration, GameTokenResponse, GameType, GameUser, GetHighestGradeMasteredOptions, GetMasteryOptions, GetXpOptions, HighestGradeMasteredResponse, HoleFillingContext, HoleFillingContextResponse, HoleFillingMissedStandard, HoleFillingTriggeringResult, HostedGame, InitErrorPayload, InitPayload, KVKeyEntry, KVKeyMetadata, KVSeedEntry, KVStatsResponse, KeyEventPayload, LaunchIntent, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, LocalDayContext, LocalDaySource, LoginResponse, ManifestV1, ManifestV2, ManifestVersions, MasteryAssessmentSubmitResult, MasteryResponse, ParentGameContext, ParentGameHandle, PlatformRoutedDiagnosticAttemptSnapshot, PlatformRoutedDiagnosticSelectionContext, PlatformTimebackUser, PlatformTimebackUserContext, PlayableAssessment, PlayableAssessmentAttemptSnapshot, PlayableAssessmentChoice, PlayableAssessmentGraphic, PlayableAssessmentHotspot, PlayableAssessmentInteraction, PlayableAssessmentItem, PlayableChoiceInteraction, PlayableContentNode, PlayableGapMatchChoice, PlayableGapMatchInteraction, PlayableInlineChoiceInteraction, PlayableMatchChoice, PlayableMatchInteraction, PlayableOrderInteraction, PlaycademyMode, PlaycademyServerClientConfig, PlaycademyServerClientState, PopulateStudentResponse, RecordAssessmentProgressInput, Release, ReleasesResponse, ResumeAssessmentInput, SaveAssessmentInput, ScoreSubmission, SettledAssessmentAttemptSnapshot, SkillMasterySource, SkillStatus, SkillStatusLookupResult, SkillStatusRequest, SkillStatusRequestingGame, SkillStatusResponse, SkillStatusResult, SkillStatusUnsupportedReason, StandardsReviewSelectionContext, StartActivityOptions, StartActivityResult, StartAssessmentInput, StartAssessmentOptions, StartDiagnosticAssessmentInput, SubmitAssessmentInput, SubmitAssessmentItemInput, SubmitAssessmentItemResult, SubmitDiagnosticAssessmentItemInput, SubmitDiagnosticAssessmentItemResult, TelemetryPayload, TimebackActivityEndRelay, TimebackActivityStartRelay, TimebackEnrollment, TimebackHeartbeatRelayRequest, TimebackInitContext, TimebackOrganization, TimebackUser, TimebackUserContext, TimebackUserHighestGradeMastered, TimebackUserHoleFilling, TimebackUserMastery, TimebackUserRefreshField, TimebackUserRefreshOptions, TimebackUserXp, TokenRefreshPayload, TokenType, UpsertGameMetadataInput, UserRow as User, UserEnrollment, UserInfo, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData, UserTimebackProfile, XpResponse };
|