@pie-players/pie-assessment-toolkit 1.0.0-beta.5 → 1.0.0-beta.7

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.
@@ -1,3 +1,4 @@
1
+ import type { ServedContentIdentity } from "@pie-players/pie-players-shared/types";
1
2
  export interface TestAttemptSessionNavigationState {
2
3
  currentItemIndex: number;
3
4
  visitedItemIdentifiers: string[];
@@ -29,6 +30,11 @@ export interface TestAttemptItemSession {
29
30
  updatedAt?: string;
30
31
  completedAt?: string;
31
32
  session?: unknown;
33
+ /**
34
+ * The content version this item was delivered as, and its language. Present
35
+ * when the item declares a language or a backend reported what it served.
36
+ */
37
+ content?: ServedContentIdentity;
32
38
  }
33
39
  export interface TestAttemptSession {
34
40
  version: 1;
@@ -67,5 +73,6 @@ export declare function upsertItemSessionFromPieSessionChange(session: TestAttem
67
73
  pieSessionId: string;
68
74
  isCompleted?: boolean;
69
75
  session?: unknown;
76
+ content?: ServedContentIdentity;
70
77
  }): TestAttemptSession;
71
78
  export declare function toItemSessionsRecord(testAttemptSession: TestAttemptSession): Record<string, unknown>;
@@ -70,6 +70,9 @@ export function upsertItemSessionFromPieSessionChange(session, args) {
70
70
  updatedAt: now,
71
71
  completedAt: completed ? existing?.completedAt || now : undefined,
72
72
  session: args.session ?? existing?.session,
73
+ ...(args.content || existing?.content
74
+ ? { content: args.content ?? existing?.content }
75
+ : {}),
73
76
  };
74
77
  return {
75
78
  ...session,