@burdenoff/microfe-technospam 2026.1102.2 → 2026.1102.4

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.
Files changed (94) hide show
  1. package/dist/generated/global-types.d.ts +307 -41
  2. package/dist/generated/global-types.d.ts.map +1 -1
  3. package/dist/generated/wspace-types.d.ts +1730 -8
  4. package/dist/generated/wspace-types.d.ts.map +1 -1
  5. package/dist/stories/fixtures/technospamFixtures.d.ts.map +1 -1
  6. package/dist/technospam/TechnoSpamRoot.d.ts.map +1 -1
  7. package/dist/technospam/TechnoSpamRoot.js +187 -178
  8. package/dist/technospam/TechnoSpamRoot.js.map +1 -1
  9. package/dist/technospam/TechnoSpamRoutes.d.ts.map +1 -1
  10. package/dist/technospam/TechnoSpamRoutes.js +32 -28
  11. package/dist/technospam/TechnoSpamRoutes.js.map +1 -1
  12. package/dist/technospam/api/assessmentApi.d.ts +183 -0
  13. package/dist/technospam/api/assessmentApi.d.ts.map +1 -0
  14. package/dist/technospam/api/assessmentApi.js +278 -0
  15. package/dist/technospam/api/assessmentApi.js.map +1 -0
  16. package/dist/technospam/api/technospamApi.js +141 -141
  17. package/dist/technospam/api/technospamApi.js.map +1 -1
  18. package/dist/technospam/components/CourseAssessments.d.ts +9 -0
  19. package/dist/technospam/components/CourseAssessments.d.ts.map +1 -0
  20. package/dist/technospam/components/CourseAssessments.js +66 -0
  21. package/dist/technospam/components/CourseAssessments.js.map +1 -0
  22. package/dist/technospam/components/MediaCover.js +2 -2
  23. package/dist/technospam/components/MediaCover.js.map +1 -1
  24. package/dist/technospam/components/MobileSectionTabs.d.ts +9 -0
  25. package/dist/technospam/components/MobileSectionTabs.d.ts.map +1 -0
  26. package/dist/technospam/components/MobileSectionTabs.js +43 -0
  27. package/dist/technospam/components/MobileSectionTabs.js.map +1 -0
  28. package/dist/technospam/components/PageLayout.d.ts +7 -1
  29. package/dist/technospam/components/PageLayout.d.ts.map +1 -1
  30. package/dist/technospam/components/PageLayout.js +40 -28
  31. package/dist/technospam/components/PageLayout.js.map +1 -1
  32. package/dist/technospam/components/StatusBadge.d.ts.map +1 -1
  33. package/dist/technospam/components/StatusBadge.js +8 -1
  34. package/dist/technospam/components/StatusBadge.js.map +1 -1
  35. package/dist/technospam/components/admin/AssessmentsAdminTab.d.ts +7 -0
  36. package/dist/technospam/components/admin/AssessmentsAdminTab.d.ts.map +1 -0
  37. package/dist/technospam/components/admin/AssessmentsAdminTab.js +421 -0
  38. package/dist/technospam/components/admin/AssessmentsAdminTab.js.map +1 -0
  39. package/dist/technospam/components/lesson/LessonKindFields.d.ts +3 -1
  40. package/dist/technospam/components/lesson/LessonKindFields.d.ts.map +1 -1
  41. package/dist/technospam/components/lesson/LessonKindFields.js +2 -2
  42. package/dist/technospam/components/lesson/LessonKindFields.js.map +1 -1
  43. package/dist/technospam/components/lesson/SaveCourseOffline.js +6 -6
  44. package/dist/technospam/hooks/useAssessmentIntegrity.d.ts +29 -0
  45. package/dist/technospam/hooks/useAssessmentIntegrity.d.ts.map +1 -0
  46. package/dist/technospam/hooks/useAssessmentIntegrity.js +57 -0
  47. package/dist/technospam/hooks/useAssessmentIntegrity.js.map +1 -0
  48. package/dist/technospam/hooks/usePhoneLayout.d.ts +18 -0
  49. package/dist/technospam/hooks/usePhoneLayout.d.ts.map +1 -0
  50. package/dist/technospam/hooks/usePhoneLayout.js +14 -0
  51. package/dist/technospam/hooks/usePhoneLayout.js.map +1 -0
  52. package/dist/technospam/pages/AdminAdminDashboardPagePage.d.ts.map +1 -1
  53. package/dist/technospam/pages/AdminAdminDashboardPagePage.js +365 -360
  54. package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
  55. package/dist/technospam/pages/ApplicationsProblemsPagePage.d.ts.map +1 -1
  56. package/dist/technospam/pages/ApplicationsProblemsPagePage.js +89 -87
  57. package/dist/technospam/pages/ApplicationsProblemsPagePage.js.map +1 -1
  58. package/dist/technospam/pages/CoursesAssessmentPagePage.d.ts +9 -0
  59. package/dist/technospam/pages/CoursesAssessmentPagePage.d.ts.map +1 -0
  60. package/dist/technospam/pages/CoursesAssessmentPagePage.js +464 -0
  61. package/dist/technospam/pages/CoursesAssessmentPagePage.js.map +1 -0
  62. package/dist/technospam/pages/CoursesCourseDetailsPagePage.d.ts.map +1 -1
  63. package/dist/technospam/pages/CoursesCourseDetailsPagePage.js +213 -211
  64. package/dist/technospam/pages/CoursesCourseDetailsPagePage.js.map +1 -1
  65. package/dist/technospam/pages/CoursesCoursesPagePage.d.ts.map +1 -1
  66. package/dist/technospam/pages/CoursesCoursesPagePage.js +117 -81
  67. package/dist/technospam/pages/CoursesCoursesPagePage.js.map +1 -1
  68. package/dist/technospam/pages/CoursesMyLearningPagePage.js +1 -1
  69. package/dist/technospam/pages/CoursesMyLearningPagePage.js.map +1 -1
  70. package/dist/technospam/pages/DashboardDashboardPagePage.d.ts.map +1 -1
  71. package/dist/technospam/pages/DashboardDashboardPagePage.js +21 -17
  72. package/dist/technospam/pages/DashboardDashboardPagePage.js.map +1 -1
  73. package/dist/technospam/pages/HackathonsHackathonDetailsPagePage.js +3 -3
  74. package/dist/technospam/pages/HackathonsHackathonDetailsPagePage.js.map +1 -1
  75. package/dist/technospam/pages/MentorshipMentorProfilePagePage.js +4 -4
  76. package/dist/technospam/pages/MentorshipMentorProfilePagePage.js.map +1 -1
  77. package/dist/technospam/pages/MentorshipMentorsPagePage.d.ts.map +1 -1
  78. package/dist/technospam/pages/MentorshipMentorsPagePage.js +6 -4
  79. package/dist/technospam/pages/MentorshipMentorsPagePage.js.map +1 -1
  80. package/dist/technospam/pages/MentorshipSessionsPagePage.js +1 -1
  81. package/dist/technospam/pages/MentorshipSessionsPagePage.js.map +1 -1
  82. package/dist/technospam/types/index.d.ts +7 -0
  83. package/dist/technospam/types/index.d.ts.map +1 -1
  84. package/dist/technospam/utils/assessment.d.ts +64 -0
  85. package/dist/technospam/utils/assessment.d.ts.map +1 -0
  86. package/dist/technospam/utils/assessment.js +122 -0
  87. package/dist/technospam/utils/assessment.js.map +1 -0
  88. package/dist/technospam/utils/mobileTabs.d.ts +45 -0
  89. package/dist/technospam/utils/mobileTabs.d.ts.map +1 -0
  90. package/dist/technospam/utils/mobileTabs.js +70 -0
  91. package/dist/technospam/utils/mobileTabs.js.map +1 -0
  92. package/dist/test/matchMedia.d.ts +6 -0
  93. package/dist/test/matchMedia.d.ts.map +1 -0
  94. package/package.json +3 -3
@@ -0,0 +1,278 @@
1
+ import { notify as e } from "../lib/toast.js";
2
+ import { userMessageFromError as t } from "../lib/errorMessage.js";
3
+ import { pageArg as n } from "./technospamApi.js";
4
+ import { useMutation as r, useQuery as i } from "@apollo/client/react";
5
+ import { gql as a } from "@apollo/client";
6
+ //#region src/technospam/api/assessmentApi.ts
7
+ var o = a`
8
+ fragment AssessmentFields on TecAssessment {
9
+ id
10
+ courseId
11
+ title
12
+ description
13
+ status
14
+ timeLimitMinutes
15
+ passingScore
16
+ maxAttempts
17
+ questionCount
18
+ shuffleQuestions
19
+ shuffleOptions
20
+ proctoringMode
21
+ requireFullscreen
22
+ blockClipboard
23
+ maxIntegrityViolations
24
+ issuesCertificate
25
+ publishedAt
26
+ createdAt
27
+ updatedAt
28
+ }
29
+ `, s = a`
30
+ fragment AssessmentAttemptFields on TecAssessmentAttempt {
31
+ id
32
+ assessmentId
33
+ courseId
34
+ learnerId
35
+ attemptNumber
36
+ status
37
+ startedAt
38
+ deadlineAt
39
+ submittedAt
40
+ remainingSeconds
41
+ questions {
42
+ position
43
+ prompt
44
+ options
45
+ }
46
+ savedAnswers
47
+ requireFullscreen
48
+ blockClipboard
49
+ score
50
+ passed
51
+ passingScore
52
+ correctCount
53
+ totalCount
54
+ proctoringMode
55
+ proctoringStatus
56
+ integrityViolations
57
+ maxIntegrityViolations
58
+ consentedAt
59
+ reviewedBy
60
+ reviewedAt
61
+ reviewNotes
62
+ certificateId
63
+ certificate {
64
+ id
65
+ serial
66
+ score
67
+ status
68
+ issuedAt
69
+ }
70
+ }
71
+ `, c = a`
72
+ ${o}
73
+ query TecListAssessments(
74
+ $courseId: ID
75
+ $status: TecAssessmentStatus
76
+ $pagination: PaginationInput
77
+ ) {
78
+ tecListAssessments(courseId: $courseId, status: $status, pagination: $pagination) {
79
+ ...AssessmentFields
80
+ }
81
+ }
82
+ `, l = a`
83
+ ${o}
84
+ query TecAssessment($id: ID!) {
85
+ tecAssessment(id: $id) {
86
+ ...AssessmentFields
87
+ course {
88
+ id
89
+ title
90
+ }
91
+ }
92
+ }
93
+ `, u = a`
94
+ query TecAssessmentQuestionKey($id: ID!) {
95
+ tecAssessmentQuestionKey(id: $id) {
96
+ prompt
97
+ options
98
+ correctOption
99
+ explanation
100
+ }
101
+ }
102
+ `, d = a`
103
+ ${s}
104
+ query TecMyAssessmentAttempts($assessmentId: ID, $pagination: PaginationInput) {
105
+ tecMyAssessmentAttempts(assessmentId: $assessmentId, pagination: $pagination) {
106
+ ...AssessmentAttemptFields
107
+ }
108
+ }
109
+ `, f = a`
110
+ ${s}
111
+ query TecListAssessmentAttempts(
112
+ $assessmentId: ID
113
+ $proctoringStatus: TecProctoringStatus
114
+ $pagination: PaginationInput
115
+ ) {
116
+ tecListAssessmentAttempts(
117
+ assessmentId: $assessmentId
118
+ proctoringStatus: $proctoringStatus
119
+ pagination: $pagination
120
+ ) {
121
+ ...AssessmentAttemptFields
122
+ }
123
+ }
124
+ `, p = a`
125
+ query TecAssessmentAttemptEvents($attemptId: ID!, $pagination: PaginationInput) {
126
+ tecAssessmentAttemptEvents(attemptId: $attemptId, pagination: $pagination) {
127
+ id
128
+ attemptId
129
+ type
130
+ violation
131
+ detail
132
+ occurredAt
133
+ }
134
+ }
135
+ `, m = a`
136
+ ${o}
137
+ mutation TecCreateAssessment($input: TecCreateAssessmentInput!) {
138
+ tecCreateAssessment(input: $input) {
139
+ ...AssessmentFields
140
+ }
141
+ }
142
+ `, h = a`
143
+ ${o}
144
+ mutation TecUpdateAssessment($id: ID!, $input: TecUpdateAssessmentInput!) {
145
+ tecUpdateAssessment(id: $id, input: $input) {
146
+ ...AssessmentFields
147
+ }
148
+ }
149
+ `, g = a`
150
+ ${o}
151
+ mutation TecPublishAssessment($id: ID!) {
152
+ tecPublishAssessment(id: $id) {
153
+ ...AssessmentFields
154
+ }
155
+ }
156
+ `, _ = a`
157
+ ${o}
158
+ mutation TecArchiveAssessment($id: ID!) {
159
+ tecArchiveAssessment(id: $id) {
160
+ ...AssessmentFields
161
+ }
162
+ }
163
+ `, v = a`
164
+ ${s}
165
+ mutation TecStartAssessment($assessmentId: ID!, $acceptMonitoring: Boolean) {
166
+ tecStartAssessment(assessmentId: $assessmentId, acceptMonitoring: $acceptMonitoring) {
167
+ ...AssessmentAttemptFields
168
+ }
169
+ }
170
+ `, y = a`
171
+ mutation TecSaveAssessmentAnswers($attemptId: ID!, $answers: [Int!]!) {
172
+ tecSaveAssessmentAnswers(attemptId: $attemptId, answers: $answers) {
173
+ id
174
+ status
175
+ savedAnswers
176
+ remainingSeconds
177
+ }
178
+ }
179
+ `, b = a`
180
+ mutation TecRecordAssessmentSignal(
181
+ $attemptId: ID!
182
+ $signal: TecAssessmentSignal!
183
+ $detail: JSON
184
+ ) {
185
+ tecRecordAssessmentSignal(attemptId: $attemptId, signal: $signal, detail: $detail) {
186
+ id
187
+ status
188
+ integrityViolations
189
+ remainingSeconds
190
+ }
191
+ }
192
+ `, x = a`
193
+ ${s}
194
+ mutation TecSubmitAssessment($attemptId: ID!, $answers: [Int!]) {
195
+ tecSubmitAssessment(attemptId: $attemptId, answers: $answers) {
196
+ ...AssessmentAttemptFields
197
+ }
198
+ }
199
+ `, S = a`
200
+ ${s}
201
+ mutation TecClaimAssessmentCertificate($attemptId: ID!) {
202
+ tecClaimAssessmentCertificate(attemptId: $attemptId) {
203
+ ...AssessmentAttemptFields
204
+ }
205
+ }
206
+ `, C = a`
207
+ ${s}
208
+ mutation TecReviewAssessmentAttempt(
209
+ $id: ID!
210
+ $decision: TecAssessmentReviewDecision!
211
+ $notes: String
212
+ ) {
213
+ tecReviewAssessmentAttempt(id: $id, decision: $decision, notes: $notes) {
214
+ ...AssessmentAttemptFields
215
+ }
216
+ }
217
+ `, w = (n) => {
218
+ e.error("Something went wrong", t(n));
219
+ }, T = ["TecListAssessments", "TecAssessment"], E = ["TecMyAssessmentAttempts", "TecMyCertificates"], D = (e, t = !1) => i(c, {
220
+ variables: {
221
+ courseId: e.courseId ?? void 0,
222
+ status: e.status ?? void 0,
223
+ pagination: n(100)
224
+ },
225
+ skip: t,
226
+ fetchPolicy: "cache-and-network"
227
+ }), O = (e) => i(l, {
228
+ variables: { id: e },
229
+ skip: !e,
230
+ fetchPolicy: "cache-and-network"
231
+ }), k = (e) => i(u, {
232
+ variables: { id: e ?? "" },
233
+ skip: !e,
234
+ fetchPolicy: "network-only"
235
+ }), A = (e) => i(d, {
236
+ variables: {
237
+ assessmentId: e ?? void 0,
238
+ pagination: n(50)
239
+ },
240
+ skip: !e,
241
+ fetchPolicy: "network-only"
242
+ }), j = (e) => i(f, {
243
+ variables: {
244
+ assessmentId: e.assessmentId ?? void 0,
245
+ proctoringStatus: e.proctoringStatus ?? void 0,
246
+ pagination: n(100)
247
+ },
248
+ fetchPolicy: "cache-and-network"
249
+ }), M = (e) => i(p, {
250
+ variables: {
251
+ attemptId: e ?? "",
252
+ pagination: n(100)
253
+ },
254
+ skip: !e,
255
+ fetchPolicy: "network-only"
256
+ }), N = () => r(m, {
257
+ onError: w,
258
+ refetchQueries: T
259
+ }), P = () => r(h, {
260
+ onError: w,
261
+ refetchQueries: T
262
+ }), F = () => r(g, {
263
+ onError: w,
264
+ refetchQueries: T
265
+ }), I = () => r(_, {
266
+ onError: w,
267
+ refetchQueries: T
268
+ }), L = () => r(v, { refetchQueries: E }), R = () => r(y), z = () => r(b), B = () => r(x, { refetchQueries: E }), V = () => r(S, {
269
+ onError: w,
270
+ refetchQueries: E
271
+ }), H = () => r(C, {
272
+ onError: w,
273
+ refetchQueries: ["TecListAssessmentAttempts", "TecAssessmentAttemptEvents"]
274
+ });
275
+ //#endregion
276
+ export { I as useArchiveAssessment, M as useAssessmentAttemptEventsQuery, j as useAssessmentAttemptsQuery, O as useAssessmentQuery, k as useAssessmentQuestionKeyQuery, D as useAssessmentsQuery, V as useClaimAssessmentCertificate, N as useCreateAssessment, A as useMyAssessmentAttemptsQuery, F as usePublishAssessment, z as useRecordAssessmentSignal, H as useReviewAssessmentAttempt, R as useSaveAssessmentAnswers, L as useStartAssessment, B as useSubmitAssessment, P as useUpdateAssessment };
277
+
278
+ //# sourceMappingURL=assessmentApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assessmentApi.js","names":[],"sources":["../../../src/technospam/api/assessmentApi.ts"],"sourcesContent":["/**\n * Certification assessments (BOFF-4427) — Apollo operations + typed hooks over\n * the wspace-technospam-svc assessment fields.\n *\n * The server owns the clock, the question order and the answer key: the\n * browser only ever sees shuffled questions without the key, posts answers\n * in display order, and reports integrity signals. Grading, expiry and\n * certificate issuance all happen server-side.\n */\nimport { gql, type ErrorLike } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\n\nimport { notify } from '../lib/toast';\nimport { userMessageFromError } from '../lib/errorMessage';\nimport { pageArg, type TecQuizQuestionKey } from './technospamApi';\n\n/* ------------------------------------------------------------------ enums */\n\nexport type TecAssessmentStatus = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED';\nexport type TecProctoringMode = 'NONE' | 'INTEGRITY_MONITORING' | 'REVIEW_REQUIRED';\nexport type TecAssessmentAttemptStatus = 'IN_PROGRESS' | 'SUBMITTED' | 'EXPIRED';\nexport type TecProctoringStatus =\n 'NOT_REQUIRED' | 'MONITORING' | 'PENDING_REVIEW' | 'VERIFIED' | 'FLAGGED' | 'REJECTED';\nexport type TecAssessmentSignal =\n | 'FULLSCREEN_ENTER'\n | 'FULLSCREEN_EXIT'\n | 'VISIBILITY_HIDDEN'\n | 'WINDOW_BLUR'\n | 'COPY_ATTEMPT'\n | 'CUT_ATTEMPT'\n | 'PASTE_ATTEMPT'\n | 'CONTEXT_MENU';\nexport type TecAssessmentEventType =\n TecAssessmentSignal | 'STARTED' | 'SUBMITTED' | 'EXPIRED' | 'REVIEWED' | 'CERTIFICATE_ISSUED';\nexport type TecAssessmentReviewDecision = 'VERIFIED' | 'REJECTED';\n\n/* ------------------------------------------------------------------ types */\n\nexport interface TecAssessment {\n id: string;\n courseId: string;\n title: string;\n description?: string | null;\n status: TecAssessmentStatus;\n timeLimitMinutes: number;\n passingScore: number;\n maxAttempts: number;\n questionCount: number;\n shuffleQuestions: boolean;\n shuffleOptions: boolean;\n proctoringMode: TecProctoringMode;\n requireFullscreen: boolean;\n blockClipboard: boolean;\n maxIntegrityViolations: number;\n issuesCertificate: boolean;\n publishedAt?: string | null;\n createdAt: string;\n updatedAt: string;\n course?: { id: string; title: string } | null;\n}\n\nexport interface TecAssessmentQuestion {\n position: number;\n prompt: string;\n options: string[];\n}\n\nexport interface TecAssessmentAttempt {\n id: string;\n assessmentId: string;\n courseId: string;\n learnerId: string;\n attemptNumber: number;\n status: TecAssessmentAttemptStatus;\n startedAt: string;\n deadlineAt: string;\n submittedAt?: string | null;\n remainingSeconds: number;\n questions: TecAssessmentQuestion[];\n savedAnswers: number[];\n requireFullscreen: boolean;\n blockClipboard: boolean;\n score?: number | null;\n passed?: boolean | null;\n passingScore: number;\n correctCount: number;\n totalCount: number;\n proctoringMode: TecProctoringMode;\n proctoringStatus: TecProctoringStatus;\n integrityViolations: number;\n maxIntegrityViolations: number;\n consentedAt?: string | null;\n reviewedBy?: string | null;\n reviewedAt?: string | null;\n reviewNotes?: string | null;\n certificateId?: string | null;\n certificate?: {\n id: string;\n serial: string;\n score: number;\n status: string;\n issuedAt: string;\n } | null;\n}\n\nexport interface TecAssessmentEvent {\n id: string;\n attemptId: string;\n type: TecAssessmentEventType;\n violation: boolean;\n detail?: Record<string, unknown> | null;\n occurredAt: string;\n}\n\nexport interface TecAssessmentQuestionInput {\n prompt: string;\n options: string[];\n correctOption: number;\n explanation: string | null;\n}\n\nexport interface TecAssessmentInput {\n title?: string;\n description?: string | null;\n timeLimitMinutes?: number;\n passingScore?: number;\n maxAttempts?: number;\n shuffleQuestions?: boolean;\n shuffleOptions?: boolean;\n proctoringMode?: TecProctoringMode;\n requireFullscreen?: boolean;\n blockClipboard?: boolean;\n maxIntegrityViolations?: number;\n issuesCertificate?: boolean;\n questions?: TecAssessmentQuestionInput[];\n}\n\n/* -------------------------------------------------------------- fragments */\n\nconst ASSESSMENT_FIELDS = gql`\n fragment AssessmentFields on TecAssessment {\n id\n courseId\n title\n description\n status\n timeLimitMinutes\n passingScore\n maxAttempts\n questionCount\n shuffleQuestions\n shuffleOptions\n proctoringMode\n requireFullscreen\n blockClipboard\n maxIntegrityViolations\n issuesCertificate\n publishedAt\n createdAt\n updatedAt\n }\n`;\n\nconst ATTEMPT_FIELDS = gql`\n fragment AssessmentAttemptFields on TecAssessmentAttempt {\n id\n assessmentId\n courseId\n learnerId\n attemptNumber\n status\n startedAt\n deadlineAt\n submittedAt\n remainingSeconds\n questions {\n position\n prompt\n options\n }\n savedAnswers\n requireFullscreen\n blockClipboard\n score\n passed\n passingScore\n correctCount\n totalCount\n proctoringMode\n proctoringStatus\n integrityViolations\n maxIntegrityViolations\n consentedAt\n reviewedBy\n reviewedAt\n reviewNotes\n certificateId\n certificate {\n id\n serial\n score\n status\n issuedAt\n }\n }\n`;\n\n/* ----------------------------------------------------------- operations */\n\nconst LIST_ASSESSMENTS = gql`\n ${ASSESSMENT_FIELDS}\n query TecListAssessments(\n $courseId: ID\n $status: TecAssessmentStatus\n $pagination: PaginationInput\n ) {\n tecListAssessments(courseId: $courseId, status: $status, pagination: $pagination) {\n ...AssessmentFields\n }\n }\n`;\n\nconst GET_ASSESSMENT = gql`\n ${ASSESSMENT_FIELDS}\n query TecAssessment($id: ID!) {\n tecAssessment(id: $id) {\n ...AssessmentFields\n course {\n id\n title\n }\n }\n }\n`;\n\nconst ASSESSMENT_QUESTION_KEY = gql`\n query TecAssessmentQuestionKey($id: ID!) {\n tecAssessmentQuestionKey(id: $id) {\n prompt\n options\n correctOption\n explanation\n }\n }\n`;\n\nconst MY_ATTEMPTS = gql`\n ${ATTEMPT_FIELDS}\n query TecMyAssessmentAttempts($assessmentId: ID, $pagination: PaginationInput) {\n tecMyAssessmentAttempts(assessmentId: $assessmentId, pagination: $pagination) {\n ...AssessmentAttemptFields\n }\n }\n`;\n\nconst LIST_ATTEMPTS = gql`\n ${ATTEMPT_FIELDS}\n query TecListAssessmentAttempts(\n $assessmentId: ID\n $proctoringStatus: TecProctoringStatus\n $pagination: PaginationInput\n ) {\n tecListAssessmentAttempts(\n assessmentId: $assessmentId\n proctoringStatus: $proctoringStatus\n pagination: $pagination\n ) {\n ...AssessmentAttemptFields\n }\n }\n`;\n\nconst ATTEMPT_EVENTS = gql`\n query TecAssessmentAttemptEvents($attemptId: ID!, $pagination: PaginationInput) {\n tecAssessmentAttemptEvents(attemptId: $attemptId, pagination: $pagination) {\n id\n attemptId\n type\n violation\n detail\n occurredAt\n }\n }\n`;\n\nconst CREATE_ASSESSMENT = gql`\n ${ASSESSMENT_FIELDS}\n mutation TecCreateAssessment($input: TecCreateAssessmentInput!) {\n tecCreateAssessment(input: $input) {\n ...AssessmentFields\n }\n }\n`;\n\nconst UPDATE_ASSESSMENT = gql`\n ${ASSESSMENT_FIELDS}\n mutation TecUpdateAssessment($id: ID!, $input: TecUpdateAssessmentInput!) {\n tecUpdateAssessment(id: $id, input: $input) {\n ...AssessmentFields\n }\n }\n`;\n\nconst PUBLISH_ASSESSMENT = gql`\n ${ASSESSMENT_FIELDS}\n mutation TecPublishAssessment($id: ID!) {\n tecPublishAssessment(id: $id) {\n ...AssessmentFields\n }\n }\n`;\n\nconst ARCHIVE_ASSESSMENT = gql`\n ${ASSESSMENT_FIELDS}\n mutation TecArchiveAssessment($id: ID!) {\n tecArchiveAssessment(id: $id) {\n ...AssessmentFields\n }\n }\n`;\n\nconst START_ASSESSMENT = gql`\n ${ATTEMPT_FIELDS}\n mutation TecStartAssessment($assessmentId: ID!, $acceptMonitoring: Boolean) {\n tecStartAssessment(assessmentId: $assessmentId, acceptMonitoring: $acceptMonitoring) {\n ...AssessmentAttemptFields\n }\n }\n`;\n\nconst SAVE_ANSWERS = gql`\n mutation TecSaveAssessmentAnswers($attemptId: ID!, $answers: [Int!]!) {\n tecSaveAssessmentAnswers(attemptId: $attemptId, answers: $answers) {\n id\n status\n savedAnswers\n remainingSeconds\n }\n }\n`;\n\nconst RECORD_SIGNAL = gql`\n mutation TecRecordAssessmentSignal(\n $attemptId: ID!\n $signal: TecAssessmentSignal!\n $detail: JSON\n ) {\n tecRecordAssessmentSignal(attemptId: $attemptId, signal: $signal, detail: $detail) {\n id\n status\n integrityViolations\n remainingSeconds\n }\n }\n`;\n\nconst SUBMIT_ASSESSMENT = gql`\n ${ATTEMPT_FIELDS}\n mutation TecSubmitAssessment($attemptId: ID!, $answers: [Int!]) {\n tecSubmitAssessment(attemptId: $attemptId, answers: $answers) {\n ...AssessmentAttemptFields\n }\n }\n`;\n\nconst CLAIM_CERTIFICATE = gql`\n ${ATTEMPT_FIELDS}\n mutation TecClaimAssessmentCertificate($attemptId: ID!) {\n tecClaimAssessmentCertificate(attemptId: $attemptId) {\n ...AssessmentAttemptFields\n }\n }\n`;\n\nconst REVIEW_ATTEMPT = gql`\n ${ATTEMPT_FIELDS}\n mutation TecReviewAssessmentAttempt(\n $id: ID!\n $decision: TecAssessmentReviewDecision!\n $notes: String\n ) {\n tecReviewAssessmentAttempt(id: $id, decision: $decision, notes: $notes) {\n ...AssessmentAttemptFields\n }\n }\n`;\n\n/* ------------------------------------------------------------------ hooks */\n\nconst onMutationError = (error: ErrorLike): void => {\n notify.error('Something went wrong', userMessageFromError(error));\n};\n\nconst AUTHORING_REFETCH = ['TecListAssessments', 'TecAssessment'];\nconst ATTEMPT_REFETCH = ['TecMyAssessmentAttempts', 'TecMyCertificates'];\n\nexport const useAssessmentsQuery = (\n vars: { courseId?: string | null; status?: TecAssessmentStatus | null },\n skip = false\n) =>\n useQuery<{ tecListAssessments: TecAssessment[] }>(LIST_ASSESSMENTS, {\n variables: {\n courseId: vars.courseId ?? undefined,\n status: vars.status ?? undefined,\n pagination: pageArg(100),\n },\n skip,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useAssessmentQuery = (id: string) =>\n useQuery<{ tecAssessment: TecAssessment | null }>(GET_ASSESSMENT, {\n variables: { id },\n skip: !id,\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useAssessmentQuestionKeyQuery = (id: string | null) =>\n useQuery<{ tecAssessmentQuestionKey: TecQuizQuestionKey[] }>(ASSESSMENT_QUESTION_KEY, {\n variables: { id: id ?? '' },\n skip: !id,\n fetchPolicy: 'network-only',\n });\n\nexport const useMyAssessmentAttemptsQuery = (assessmentId: string | null) =>\n useQuery<{ tecMyAssessmentAttempts: TecAssessmentAttempt[] }>(MY_ATTEMPTS, {\n variables: { assessmentId: assessmentId ?? undefined, pagination: pageArg(50) },\n skip: !assessmentId,\n fetchPolicy: 'network-only',\n });\n\nexport const useAssessmentAttemptsQuery = (vars: {\n assessmentId?: string | null;\n proctoringStatus?: TecProctoringStatus | null;\n}) =>\n useQuery<{ tecListAssessmentAttempts: TecAssessmentAttempt[] }>(LIST_ATTEMPTS, {\n variables: {\n assessmentId: vars.assessmentId ?? undefined,\n proctoringStatus: vars.proctoringStatus ?? undefined,\n pagination: pageArg(100),\n },\n fetchPolicy: 'cache-and-network',\n });\n\nexport const useAssessmentAttemptEventsQuery = (attemptId: string | null) =>\n useQuery<{ tecAssessmentAttemptEvents: TecAssessmentEvent[] }>(ATTEMPT_EVENTS, {\n variables: { attemptId: attemptId ?? '', pagination: pageArg(100) },\n skip: !attemptId,\n fetchPolicy: 'network-only',\n });\n\nexport const useCreateAssessment = () =>\n useMutation<{ tecCreateAssessment: TecAssessment }>(CREATE_ASSESSMENT, {\n onError: onMutationError,\n refetchQueries: AUTHORING_REFETCH,\n });\n\nexport const useUpdateAssessment = () =>\n useMutation<{ tecUpdateAssessment: TecAssessment }>(UPDATE_ASSESSMENT, {\n onError: onMutationError,\n refetchQueries: AUTHORING_REFETCH,\n });\n\nexport const usePublishAssessment = () =>\n useMutation<{ tecPublishAssessment: TecAssessment }>(PUBLISH_ASSESSMENT, {\n onError: onMutationError,\n refetchQueries: AUTHORING_REFETCH,\n });\n\nexport const useArchiveAssessment = () =>\n useMutation<{ tecArchiveAssessment: TecAssessment }>(ARCHIVE_ASSESSMENT, {\n onError: onMutationError,\n refetchQueries: AUTHORING_REFETCH,\n });\n\n/** Errors are shown inline on the assessment page, not as toasts. */\nexport const useStartAssessment = () =>\n useMutation<{ tecStartAssessment: TecAssessmentAttempt }>(START_ASSESSMENT, {\n refetchQueries: ATTEMPT_REFETCH,\n });\n\nexport const useSaveAssessmentAnswers = () =>\n useMutation<{\n tecSaveAssessmentAnswers: Pick<\n TecAssessmentAttempt,\n 'id' | 'status' | 'savedAnswers' | 'remainingSeconds'\n >;\n }>(SAVE_ANSWERS);\n\n/** Signals are fire-and-forget: a failed report must never interrupt the exam. */\nexport const useRecordAssessmentSignal = () =>\n useMutation<{\n tecRecordAssessmentSignal: Pick<\n TecAssessmentAttempt,\n 'id' | 'status' | 'integrityViolations' | 'remainingSeconds'\n >;\n }>(RECORD_SIGNAL);\n\nexport const useSubmitAssessment = () =>\n useMutation<{ tecSubmitAssessment: TecAssessmentAttempt }>(SUBMIT_ASSESSMENT, {\n refetchQueries: ATTEMPT_REFETCH,\n });\n\nexport const useClaimAssessmentCertificate = () =>\n useMutation<{ tecClaimAssessmentCertificate: TecAssessmentAttempt }>(CLAIM_CERTIFICATE, {\n onError: onMutationError,\n refetchQueries: ATTEMPT_REFETCH,\n });\n\nexport const useReviewAssessmentAttempt = () =>\n useMutation<{ tecReviewAssessmentAttempt: TecAssessmentAttempt }>(REVIEW_ATTEMPT, {\n onError: onMutationError,\n refetchQueries: ['TecListAssessmentAttempts', 'TecAssessmentA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