@timeback/qti 0.1.3 → 0.1.5
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/errors.d.ts +1 -9
- package/dist/index.d.ts +1461 -21
- package/dist/index.js +24 -8
- package/dist/public-types.d.ts +570 -0
- package/dist/public-types.d.ts.map +1 -0
- package/dist/resources/assessment-items.d.ts +21 -2
- package/dist/resources/assessment-items.d.ts.map +1 -1
- package/package.json +3 -3
- /package/dist/{types.js → public-types.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -16667,7 +16667,7 @@ var QtiItemMetadata = exports_external.object({
|
|
|
16667
16667
|
grade: TimebackGrade.optional(),
|
|
16668
16668
|
difficulty: QtiDifficulty.optional(),
|
|
16669
16669
|
learningObjectiveSet: exports_external.array(QtiLearningObjectiveSet).optional()
|
|
16670
|
-
}).
|
|
16670
|
+
}).loose();
|
|
16671
16671
|
var QtiModalFeedback = exports_external.object({
|
|
16672
16672
|
outcomeIdentifier: exports_external.string().min(1),
|
|
16673
16673
|
identifier: exports_external.string().min(1),
|
|
@@ -16704,7 +16704,12 @@ var QtiPaginationParams = exports_external.object({
|
|
|
16704
16704
|
sort: exports_external.string().optional(),
|
|
16705
16705
|
order: exports_external.enum(["asc", "desc"]).optional()
|
|
16706
16706
|
}).strict();
|
|
16707
|
-
var
|
|
16707
|
+
var QtiAssessmentItemXmlCreateInput = exports_external.object({
|
|
16708
|
+
format: exports_external.string().pipe(exports_external.literal("xml")),
|
|
16709
|
+
xml: exports_external.string().min(1),
|
|
16710
|
+
metadata: QtiItemMetadata.optional()
|
|
16711
|
+
}).strict();
|
|
16712
|
+
var QtiAssessmentItemJsonCreateInput = exports_external.object({
|
|
16708
16713
|
identifier: exports_external.string().min(1),
|
|
16709
16714
|
title: exports_external.string().min(1),
|
|
16710
16715
|
type: QtiAssessmentItemType,
|
|
@@ -16719,6 +16724,10 @@ var QtiAssessmentItemCreateInput = exports_external.object({
|
|
|
16719
16724
|
feedbackInline: exports_external.array(QtiFeedbackInline).optional(),
|
|
16720
16725
|
feedbackBlock: exports_external.array(QtiFeedbackBlock).optional()
|
|
16721
16726
|
}).strict();
|
|
16727
|
+
var QtiAssessmentItemCreateInput = exports_external.union([
|
|
16728
|
+
QtiAssessmentItemXmlCreateInput,
|
|
16729
|
+
QtiAssessmentItemJsonCreateInput
|
|
16730
|
+
]);
|
|
16722
16731
|
var QtiAssessmentItemUpdateInput = exports_external.object({
|
|
16723
16732
|
identifier: exports_external.string().min(1).optional(),
|
|
16724
16733
|
title: exports_external.string().min(1),
|
|
@@ -16755,9 +16764,9 @@ var QtiAssessmentSection = exports_external.object({
|
|
|
16755
16764
|
}).strict();
|
|
16756
16765
|
var QtiTestPart = exports_external.object({
|
|
16757
16766
|
identifier: exports_external.string().min(1),
|
|
16758
|
-
navigationMode: QtiNavigationMode,
|
|
16759
|
-
submissionMode: QtiSubmissionMode,
|
|
16760
|
-
"qti-assessment-section": exports_external.
|
|
16767
|
+
navigationMode: exports_external.string().pipe(QtiNavigationMode),
|
|
16768
|
+
submissionMode: exports_external.string().pipe(QtiSubmissionMode),
|
|
16769
|
+
"qti-assessment-section": exports_external.array(QtiAssessmentSection)
|
|
16761
16770
|
}).strict();
|
|
16762
16771
|
var QtiReorderItemsInput = exports_external.object({
|
|
16763
16772
|
items: exports_external.array(QtiAssessmentItemRef).min(1)
|
|
@@ -16775,7 +16784,7 @@ var QtiAssessmentTestCreateInput = exports_external.object({
|
|
|
16775
16784
|
maxAttempts: exports_external.number().optional(),
|
|
16776
16785
|
toolsEnabled: exports_external.record(exports_external.string(), exports_external.boolean()).optional(),
|
|
16777
16786
|
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
16778
|
-
"qti-test-part": QtiTestPart,
|
|
16787
|
+
"qti-test-part": exports_external.array(QtiTestPart),
|
|
16779
16788
|
"qti-outcome-declaration": exports_external.array(QtiTestOutcomeDeclaration).optional()
|
|
16780
16789
|
}).strict();
|
|
16781
16790
|
var QtiAssessmentTestUpdateInput = exports_external.object({
|
|
@@ -16788,7 +16797,7 @@ var QtiAssessmentTestUpdateInput = exports_external.object({
|
|
|
16788
16797
|
maxAttempts: exports_external.number().optional(),
|
|
16789
16798
|
toolsEnabled: exports_external.record(exports_external.string(), exports_external.boolean()).optional(),
|
|
16790
16799
|
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
16791
|
-
"qti-test-part": QtiTestPart,
|
|
16800
|
+
"qti-test-part": exports_external.array(QtiTestPart),
|
|
16792
16801
|
"qti-outcome-declaration": exports_external.array(QtiTestOutcomeDeclaration).optional()
|
|
16793
16802
|
}).strict();
|
|
16794
16803
|
var QtiStimulusCreateInput = exports_external.object({
|
|
@@ -16921,8 +16930,15 @@ class AssessmentItemsResource {
|
|
|
16921
16930
|
body: { identifier, ...body }
|
|
16922
16931
|
});
|
|
16923
16932
|
}
|
|
16933
|
+
createFromXml(body) {
|
|
16934
|
+
validateWithSchema(QtiAssessmentItemXmlCreateInput, body, "assessment item XML");
|
|
16935
|
+
return this.transport.request("/assessment-items", {
|
|
16936
|
+
method: "POST",
|
|
16937
|
+
body
|
|
16938
|
+
});
|
|
16939
|
+
}
|
|
16924
16940
|
createFromMetadata(body) {
|
|
16925
|
-
validateWithSchema(
|
|
16941
|
+
validateWithSchema(QtiAssessmentItemJsonCreateInput, body, "assessment item metadata");
|
|
16926
16942
|
return this.transport.request("/assessment-items/metadata", {
|
|
16927
16943
|
method: "POST",
|
|
16928
16944
|
body
|
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QTI Primitives
|
|
3
|
+
*
|
|
4
|
+
* Enums and literal types specific to the QTI protocol.
|
|
5
|
+
* For shared Timeback primitives (TimebackGrade, TimebackSubject), see `@timeback/types`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Lesson types for PowerPath integration.
|
|
10
|
+
* Used to categorize assessment content by delivery mode.
|
|
11
|
+
*/
|
|
12
|
+
type LessonType =
|
|
13
|
+
| 'powerpath-100'
|
|
14
|
+
| 'quiz'
|
|
15
|
+
| 'test-out'
|
|
16
|
+
| 'placement'
|
|
17
|
+
| 'unit-test'
|
|
18
|
+
| 'alpha-read-article'
|
|
19
|
+
| null
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* API Response Types
|
|
23
|
+
*
|
|
24
|
+
* Types for QTI API responses.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
28
|
+
// LIST RESPONSE
|
|
29
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Paginated list response from QTI API.
|
|
33
|
+
*
|
|
34
|
+
* QTI returns pagination metadata directly in the response body alongside items.
|
|
35
|
+
*/
|
|
36
|
+
interface ListResponse<T> {
|
|
37
|
+
/** Array of items in this page */
|
|
38
|
+
items: T[]
|
|
39
|
+
/** Total items across all pages */
|
|
40
|
+
total: number
|
|
41
|
+
/** Current page number (1-indexed) */
|
|
42
|
+
page: number
|
|
43
|
+
/** Total number of pages */
|
|
44
|
+
pages: number
|
|
45
|
+
/** Items per page */
|
|
46
|
+
limit: number
|
|
47
|
+
/** Sort field */
|
|
48
|
+
sort: string
|
|
49
|
+
/** Sort order */
|
|
50
|
+
order: 'asc' | 'desc'
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Raw paginated response shape from QTI API (alias for internal use).
|
|
55
|
+
*/
|
|
56
|
+
type RawPaginatedResponse<T> = ListResponse<T>
|
|
57
|
+
|
|
58
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
59
|
+
// DELETE RESPONSE
|
|
60
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Response from DELETE operations.
|
|
64
|
+
*/
|
|
65
|
+
interface DeleteResponse {
|
|
66
|
+
message: string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Base Types
|
|
71
|
+
*
|
|
72
|
+
* Common types shared across QTI resources.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
76
|
+
// ENUMS
|
|
77
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Assessment item interaction types.
|
|
81
|
+
*/
|
|
82
|
+
type AssessmentItemType =
|
|
83
|
+
| 'choice'
|
|
84
|
+
| 'text-entry'
|
|
85
|
+
| 'extended-text'
|
|
86
|
+
| 'inline-choice'
|
|
87
|
+
| 'match'
|
|
88
|
+
| 'order'
|
|
89
|
+
| 'associate'
|
|
90
|
+
| 'select-point'
|
|
91
|
+
| 'graphic-order'
|
|
92
|
+
| 'graphic-associate'
|
|
93
|
+
| 'graphic-gap-match'
|
|
94
|
+
| 'hotspot'
|
|
95
|
+
| 'hottext'
|
|
96
|
+
| 'slider'
|
|
97
|
+
| 'drawing'
|
|
98
|
+
| 'media'
|
|
99
|
+
| 'upload'
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Cardinality of a response or outcome variable.
|
|
103
|
+
*/
|
|
104
|
+
type Cardinality = 'single' | 'multiple' | 'ordered' | 'record'
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Base type of a response or outcome variable.
|
|
108
|
+
*/
|
|
109
|
+
type BaseType =
|
|
110
|
+
| 'identifier'
|
|
111
|
+
| 'boolean'
|
|
112
|
+
| 'integer'
|
|
113
|
+
| 'float'
|
|
114
|
+
| 'string'
|
|
115
|
+
| 'point'
|
|
116
|
+
| 'pair'
|
|
117
|
+
| 'directedPair'
|
|
118
|
+
| 'duration'
|
|
119
|
+
| 'file'
|
|
120
|
+
| 'uri'
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Difficulty level for assessment items.
|
|
124
|
+
*/
|
|
125
|
+
type Difficulty = 'easy' | 'medium' | 'hard'
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Grade level (K-12 + pre-K as -1).
|
|
129
|
+
*/
|
|
130
|
+
type Grade = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Navigation mode for test parts.
|
|
134
|
+
*/
|
|
135
|
+
type NavigationMode = 'linear' | 'nonlinear'
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Submission mode for test parts.
|
|
139
|
+
*/
|
|
140
|
+
type SubmissionMode = 'individual' | 'simultaneous'
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Show/hide indicator for feedback.
|
|
144
|
+
*/
|
|
145
|
+
type ShowHide = 'show' | 'hide'
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Schema type for validation.
|
|
149
|
+
*/
|
|
150
|
+
type ValidationSchema = 'test' | 'item' | 'stimulus'
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Sort order for list responses.
|
|
154
|
+
*/
|
|
155
|
+
type SortOrder = 'asc' | 'desc'
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Feedback type.
|
|
159
|
+
*/
|
|
160
|
+
type FeedbackType = 'QUESTION' | 'LESSON'
|
|
161
|
+
|
|
162
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
163
|
+
// COMMON STRUCTURES
|
|
164
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Correct response value.
|
|
168
|
+
*/
|
|
169
|
+
interface CorrectResponse {
|
|
170
|
+
value: string[]
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Response declaration for assessment items.
|
|
175
|
+
*/
|
|
176
|
+
interface ResponseDeclaration {
|
|
177
|
+
identifier: string
|
|
178
|
+
cardinality: Cardinality
|
|
179
|
+
baseType?: BaseType
|
|
180
|
+
correctResponse: CorrectResponse
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Outcome declaration for items and tests.
|
|
185
|
+
*/
|
|
186
|
+
interface OutcomeDeclaration {
|
|
187
|
+
identifier: string
|
|
188
|
+
cardinality: Cardinality
|
|
189
|
+
baseType?: BaseType
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Test outcome declaration with additional properties.
|
|
194
|
+
*/
|
|
195
|
+
interface TestOutcomeDeclaration {
|
|
196
|
+
identifier: string
|
|
197
|
+
cardinality?: Cardinality
|
|
198
|
+
baseType: BaseType
|
|
199
|
+
normalMaximum?: number
|
|
200
|
+
normalMinimum?: number
|
|
201
|
+
defaultValue?: {
|
|
202
|
+
value?: unknown
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Inline feedback configuration.
|
|
208
|
+
*/
|
|
209
|
+
interface InlineFeedback {
|
|
210
|
+
outcomeIdentifier: string
|
|
211
|
+
variableIdentifier: string
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Response processing configuration.
|
|
216
|
+
*/
|
|
217
|
+
interface ResponseProcessing {
|
|
218
|
+
templateType: 'match_correct' | 'map_response'
|
|
219
|
+
responseDeclarationIdentifier: string
|
|
220
|
+
outcomeIdentifier: string
|
|
221
|
+
correctResponseIdentifier: string
|
|
222
|
+
incorrectResponseIdentifier: string
|
|
223
|
+
inlineFeedback?: InlineFeedback
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Learning objective set for metadata.
|
|
228
|
+
*/
|
|
229
|
+
interface LearningObjectiveSet {
|
|
230
|
+
source: string
|
|
231
|
+
learningObjectiveIds: string[]
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Item metadata.
|
|
236
|
+
*/
|
|
237
|
+
interface ItemMetadata {
|
|
238
|
+
subject?: string
|
|
239
|
+
grade?: Grade
|
|
240
|
+
difficulty?: Difficulty
|
|
241
|
+
learningObjectiveSet?: LearningObjectiveSet[]
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Modal feedback element.
|
|
246
|
+
*/
|
|
247
|
+
interface ModalFeedback {
|
|
248
|
+
outcomeIdentifier: string
|
|
249
|
+
identifier: string
|
|
250
|
+
showHide: ShowHide
|
|
251
|
+
content: string
|
|
252
|
+
title: string
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Inline feedback element.
|
|
257
|
+
*/
|
|
258
|
+
interface FeedbackInline {
|
|
259
|
+
outcomeIdentifier: string
|
|
260
|
+
identifier: string
|
|
261
|
+
showHide: ShowHide
|
|
262
|
+
content: string
|
|
263
|
+
class: string[]
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Block feedback element.
|
|
268
|
+
*/
|
|
269
|
+
interface FeedbackBlock {
|
|
270
|
+
outcomeIdentifier: string
|
|
271
|
+
identifier: string
|
|
272
|
+
showHide: ShowHide
|
|
273
|
+
content: string
|
|
274
|
+
class: string[]
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Stylesheet reference.
|
|
279
|
+
*/
|
|
280
|
+
interface Stylesheet {
|
|
281
|
+
href: string
|
|
282
|
+
type: string
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Catalog info entry.
|
|
287
|
+
*/
|
|
288
|
+
interface CatalogInfo {
|
|
289
|
+
id: string
|
|
290
|
+
support: string
|
|
291
|
+
content: string
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
295
|
+
// PAGINATION
|
|
296
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Pagination metadata from QTI list responses.
|
|
300
|
+
*/
|
|
301
|
+
interface PaginationMeta {
|
|
302
|
+
/** Total items across all pages */
|
|
303
|
+
total: number
|
|
304
|
+
/** Current page number (1-indexed) */
|
|
305
|
+
page: number
|
|
306
|
+
/** Total number of pages */
|
|
307
|
+
pages: number
|
|
308
|
+
/** Items per page */
|
|
309
|
+
limit: number
|
|
310
|
+
/** Sort field */
|
|
311
|
+
sort: string
|
|
312
|
+
/** Sort order */
|
|
313
|
+
order: SortOrder
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Assessment Items Types
|
|
318
|
+
*
|
|
319
|
+
* Types for QTI assessment item resources.
|
|
320
|
+
*/
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
325
|
+
// ASSESSMENT ITEM
|
|
326
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Assessment item entity.
|
|
330
|
+
*/
|
|
331
|
+
interface AssessmentItem {
|
|
332
|
+
identifier: string
|
|
333
|
+
title: string
|
|
334
|
+
type: AssessmentItemType
|
|
335
|
+
qtiVersion: string
|
|
336
|
+
timeDependent: boolean
|
|
337
|
+
adaptive: boolean
|
|
338
|
+
responseDeclarations?: ResponseDeclaration[]
|
|
339
|
+
outcomeDeclarations?: OutcomeDeclaration[]
|
|
340
|
+
responseProcessing?: ResponseProcessing
|
|
341
|
+
metadata?: ItemMetadata
|
|
342
|
+
/** Raw QTI XML string */
|
|
343
|
+
rawXml: string
|
|
344
|
+
/**
|
|
345
|
+
* Parsed XML→JSON content.
|
|
346
|
+
* Structure varies by item type.
|
|
347
|
+
*/
|
|
348
|
+
content: Record<string, unknown>
|
|
349
|
+
modalFeedback?: ModalFeedback[]
|
|
350
|
+
feedbackInline?: FeedbackInline[]
|
|
351
|
+
feedbackBlock?: FeedbackBlock[]
|
|
352
|
+
createdAt: string
|
|
353
|
+
updatedAt: string
|
|
354
|
+
__v?: number
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Result of processing a response.
|
|
359
|
+
*/
|
|
360
|
+
interface ProcessResponseResult {
|
|
361
|
+
score: number
|
|
362
|
+
feedback: {
|
|
363
|
+
identifier: string
|
|
364
|
+
value: string
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
369
|
+
// SECTION ITEM REFERENCE
|
|
370
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Reference to an assessment item within a section.
|
|
374
|
+
*/
|
|
375
|
+
interface AssessmentItemRef {
|
|
376
|
+
identifier: string
|
|
377
|
+
/**
|
|
378
|
+
* Item reference href.
|
|
379
|
+
*
|
|
380
|
+
* The QTI docs show this field as `string` in most responses, but it can also
|
|
381
|
+
* appear as an array (and in one place, a nested array) in request/response
|
|
382
|
+
* examples for test-part payloads.
|
|
383
|
+
*/
|
|
384
|
+
href?: string | string[] | string[][]
|
|
385
|
+
sequence?: number
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
389
|
+
// SECTION
|
|
390
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Assessment section within a test part.
|
|
394
|
+
*/
|
|
395
|
+
interface AssessmentSection {
|
|
396
|
+
identifier: string
|
|
397
|
+
title: string
|
|
398
|
+
visible: boolean
|
|
399
|
+
required?: boolean
|
|
400
|
+
fixed?: boolean
|
|
401
|
+
sequence?: number
|
|
402
|
+
'qti-assessment-item-ref'?: AssessmentItemRef[]
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
406
|
+
// TEST PART
|
|
407
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Test part within an assessment test.
|
|
411
|
+
*/
|
|
412
|
+
interface TestPart {
|
|
413
|
+
identifier: string
|
|
414
|
+
navigationMode: NavigationMode
|
|
415
|
+
submissionMode: SubmissionMode
|
|
416
|
+
'qti-assessment-section': AssessmentSection | AssessmentSection[]
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
420
|
+
// ASSESSMENT TEST
|
|
421
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Assessment test entity.
|
|
425
|
+
*/
|
|
426
|
+
interface AssessmentTest {
|
|
427
|
+
identifier: string
|
|
428
|
+
title: string
|
|
429
|
+
qtiVersion: string
|
|
430
|
+
'qti-test-part': TestPart[]
|
|
431
|
+
'qti-outcome-declaration': TestOutcomeDeclaration[]
|
|
432
|
+
timeLimit?: number
|
|
433
|
+
maxAttempts?: number
|
|
434
|
+
toolsEnabled?: Record<string, boolean>
|
|
435
|
+
metadata?: Record<string, unknown>
|
|
436
|
+
/** Raw QTI XML string */
|
|
437
|
+
rawXml: string
|
|
438
|
+
/**
|
|
439
|
+
* Parsed XML→JSON content.
|
|
440
|
+
* Structure varies by test.
|
|
441
|
+
*/
|
|
442
|
+
content: Record<string, unknown>
|
|
443
|
+
createdAt: string
|
|
444
|
+
updatedAt: string
|
|
445
|
+
__v?: number
|
|
446
|
+
isValidXml?: boolean
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
450
|
+
// QUESTIONS RESPONSE
|
|
451
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Question reference within a test.
|
|
455
|
+
*/
|
|
456
|
+
interface QuestionReference {
|
|
457
|
+
identifier: string
|
|
458
|
+
href: string
|
|
459
|
+
testPart: string
|
|
460
|
+
section: string
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Question with full item details.
|
|
465
|
+
*/
|
|
466
|
+
interface QuestionWithItem {
|
|
467
|
+
reference: QuestionReference
|
|
468
|
+
question: AssessmentItem
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Response from GET /assessment-tests/{identifier}/questions.
|
|
473
|
+
*/
|
|
474
|
+
interface QuestionsResponse {
|
|
475
|
+
assessmentTest: string
|
|
476
|
+
title: string
|
|
477
|
+
totalQuestions: number
|
|
478
|
+
questions: QuestionWithItem[]
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Lesson Types
|
|
483
|
+
*
|
|
484
|
+
* Types for QTI lesson and question feedback resources.
|
|
485
|
+
*/
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
490
|
+
// LESSON FEEDBACK
|
|
491
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Lesson feedback entity.
|
|
495
|
+
*/
|
|
496
|
+
interface LessonFeedback {
|
|
497
|
+
questionId?: string
|
|
498
|
+
userId: string
|
|
499
|
+
feedback: string
|
|
500
|
+
type: FeedbackType
|
|
501
|
+
lessonId: string
|
|
502
|
+
humanApproved?: boolean | boolean[]
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Stimuli Types
|
|
507
|
+
*
|
|
508
|
+
* Types for QTI stimulus resources.
|
|
509
|
+
*/
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
514
|
+
// STIMULUS
|
|
515
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Stimulus entity.
|
|
519
|
+
*/
|
|
520
|
+
interface Stimulus {
|
|
521
|
+
identifier: string
|
|
522
|
+
title: string
|
|
523
|
+
label?: string
|
|
524
|
+
language?: string
|
|
525
|
+
stylesheet?: Stylesheet
|
|
526
|
+
catalogInfo: CatalogInfo[]
|
|
527
|
+
toolName?: string
|
|
528
|
+
toolVersion?: string
|
|
529
|
+
metadata?: Record<string, unknown>
|
|
530
|
+
/** Raw QTI XML string */
|
|
531
|
+
rawXml: string
|
|
532
|
+
/**
|
|
533
|
+
* Parsed XML→JSON content.
|
|
534
|
+
* Structure varies.
|
|
535
|
+
*/
|
|
536
|
+
content: Record<string, unknown>
|
|
537
|
+
createdAt: string
|
|
538
|
+
updatedAt: string
|
|
539
|
+
__v?: number
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Validation Types
|
|
544
|
+
*
|
|
545
|
+
* Types for QTI XML validation resources.
|
|
546
|
+
*/
|
|
547
|
+
|
|
548
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
549
|
+
// VALIDATION
|
|
550
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Single validation result.
|
|
554
|
+
*/
|
|
555
|
+
interface ValidationResult {
|
|
556
|
+
success: boolean
|
|
557
|
+
entityId: string
|
|
558
|
+
xmlContent: string
|
|
559
|
+
validationErrors: string[]
|
|
560
|
+
message: string
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Batch validation result.
|
|
565
|
+
*/
|
|
566
|
+
interface BatchValidationResult {
|
|
567
|
+
results: ValidationResult[]
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export type { AssessmentItem, AssessmentItemRef, AssessmentItemType, AssessmentSection, AssessmentTest, BaseType, BatchValidationResult, Cardinality, CatalogInfo, CorrectResponse, DeleteResponse, Difficulty, FeedbackBlock, FeedbackInline, FeedbackType, Grade, InlineFeedback, ItemMetadata, LearningObjectiveSet, LessonFeedback, LessonType, ListResponse, ModalFeedback, NavigationMode, OutcomeDeclaration, PaginationMeta, ProcessResponseResult, QuestionReference, QuestionWithItem, QuestionsResponse, RawPaginatedResponse, ResponseDeclaration, ResponseProcessing, ShowHide, SortOrder, Stimulus, Stylesheet, SubmissionMode, TestOutcomeDeclaration, TestPart, ValidationResult, ValidationSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-types.d.ts","sourceRoot":"","sources":["../src/public-types.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Paginator } from '../lib';
|
|
7
7
|
import type { ListParams } from '@timeback/internal-client-infra';
|
|
8
|
-
import type { CreateAssessmentItemRequest, ListAssessmentItemsParams, ProcessResponseRequest, UpdateAssessmentItemRequest } from '@timeback/types/zod';
|
|
8
|
+
import type { CreateAssessmentItemJsonRequest, CreateAssessmentItemRequest, CreateAssessmentItemXmlRequest, ListAssessmentItemsParams, ProcessResponseRequest, UpdateAssessmentItemRequest } from '@timeback/types/zod';
|
|
9
9
|
import type { Transport } from '../lib/transport';
|
|
10
10
|
import type { AssessmentItem, DeleteResponse, ListResponse, ProcessResponseResult } from '../types';
|
|
11
11
|
/**
|
|
@@ -75,6 +75,25 @@ export declare class AssessmentItemsResource {
|
|
|
75
75
|
* @returns Score and feedback
|
|
76
76
|
*/
|
|
77
77
|
processResponse(identifier: string, body: Omit<ProcessResponseRequest, 'identifier'>): Promise<ProcessResponseResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Create an assessment item from raw QTI 3.0 XML.
|
|
80
|
+
*
|
|
81
|
+
* This is the preferred creation method — the server validates the XML
|
|
82
|
+
* against IMS QTI XSDs. Optionally include metadata (subject, grade, etc.).
|
|
83
|
+
*
|
|
84
|
+
* @param body - XML string and optional metadata
|
|
85
|
+
* @returns The created assessment item
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const item = await client.assessmentItems.createFromXml({
|
|
90
|
+
* format: 'xml',
|
|
91
|
+
* xml: '<qti-assessment-item ...>...</qti-assessment-item>',
|
|
92
|
+
* metadata: { subject: 'Math', difficulty: 'easy' },
|
|
93
|
+
* })
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
createFromXml(body: CreateAssessmentItemXmlRequest): Promise<AssessmentItem>;
|
|
78
97
|
/**
|
|
79
98
|
* Create an assessment item from metadata.
|
|
80
99
|
*
|
|
@@ -83,6 +102,6 @@ export declare class AssessmentItemsResource {
|
|
|
83
102
|
* @param body - Assessment item metadata
|
|
84
103
|
* @returns The created assessment item
|
|
85
104
|
*/
|
|
86
|
-
createFromMetadata(body:
|
|
105
|
+
createFromMetadata(body: CreateAssessmentItemJsonRequest): Promise<AssessmentItem>;
|
|
87
106
|
}
|
|
88
107
|
//# sourceMappingURL=assessment-items.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assessment-items.d.ts","sourceRoot":"","sources":["../../src/resources/assessment-items.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"assessment-items.d.ts","sourceRoot":"","sources":["../../src/resources/assessment-items.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EACX,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAC9B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEnG;;;;;GAKG;AACH,qBAAa,uBAAuB;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAtC,YAA6B,SAAS,EAAE,SAAS,EAAI;IAErD;;;;;OAKG;IACH,IAAI,CAAC,MAAM,GAAE,yBAA8B,GAAG,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAYlF;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,GAAE,UAAU,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,SAAS,CAAC,cAAc,CAAC,CAG5E;IAED;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAK/C;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAMjE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAUrF;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAQlD;IAED;;;;;;;;OAQG;IACH,eAAe,CACd,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,GAC9C,OAAO,CAAC,qBAAqB,CAAC,CAUhC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,cAAc,CAAC,CAM3E;IAED;;;;;;;OAOG;IACH,kBAAkB,CAAC,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,cAAc,CAAC,CAMjF;CACD"}
|