@superbuilders/incept-renderer 0.1.2 → 0.1.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/actions/index.d.ts +1 -1
- package/dist/components/index.d.ts +4 -40
- package/dist/index.d.ts +3 -3
- package/dist/{schema-CkAPLwco.d.ts → schema-C3cRJWrK.d.ts} +71 -2
- package/dist/{types-DIDj-78l.d.ts → types-BqqQtPL8.d.ts} +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +5 -1
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as DisplayItem, F as FormShape, V as ValidateResult } from '../types-
|
|
1
|
+
import { c as DisplayItem, F as FormShape, V as ValidateResult } from '../types-BqqQtPL8.js';
|
|
2
2
|
|
|
3
3
|
declare function buildDisplayModelFromXml(qtiXml: string): {
|
|
4
4
|
itemKey: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { f as ChoiceInteraction, A as AssessmentItem } from '../schema-
|
|
2
|
-
export { C as ChoiceCorrectness, c as ContentBlockRenderer, a as ContentBlockRendererProps, d as QTIRenderer, Q as QTIRendererProps, b as QTITheme, R as ResponseFeedback } from '../schema-
|
|
1
|
+
import { f as ChoiceInteraction, A as AssessmentItem } from '../schema-C3cRJWrK.js';
|
|
2
|
+
export { C as ChoiceCorrectness, c as ContentBlockRenderer, a as ContentBlockRendererProps, d as QTIRenderer, Q as QTIRendererProps, b as QTITheme, R as ResponseFeedback } from '../schema-C3cRJWrK.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { EvaluationResult } from '../types.js';
|
|
4
5
|
import * as React from 'react';
|
|
5
|
-
import { d as DisplayInlineEmbed, e as DisplayTextEmbed, f as DisplayGap } from '../types-
|
|
6
|
+
import { d as DisplayInlineEmbed, e as DisplayTextEmbed, f as DisplayGap } from '../types-BqqQtPL8.js';
|
|
6
7
|
import 'zod';
|
|
7
8
|
|
|
8
9
|
interface ChoiceInteractionRendererProps {
|
|
@@ -40,43 +41,6 @@ declare function FeedbackMessage({ responseId, showFeedback, perResponseFeedback
|
|
|
40
41
|
}>;
|
|
41
42
|
}): react_jsx_runtime.JSX.Element | null;
|
|
42
43
|
|
|
43
|
-
/**
|
|
44
|
-
* This file contains application-level types for managing the state of QTI interactions,
|
|
45
|
-
* user responses, and evaluation results.
|
|
46
|
-
*
|
|
47
|
-
* Unlike `schema.ts`, which defines the static data structure of a parsed QTI item,
|
|
48
|
-
* the types in this file represent the dynamic data that changes as a user
|
|
49
|
-
* interacts with an assessment item.
|
|
50
|
-
*/
|
|
51
|
-
/**
|
|
52
|
-
* Represents the evaluation status of a user's response to an interaction.
|
|
53
|
-
* - `unanswered`: No response has been submitted yet.
|
|
54
|
-
* - `correct`: The submitted response is fully correct.
|
|
55
|
-
* - `incorrect`: The submitted response is incorrect.
|
|
56
|
-
* - `partially-correct`: For multi-response questions, the answer is partially correct.
|
|
57
|
-
*/
|
|
58
|
-
type EvaluationStatus = "unanswered" | "correct" | "incorrect" | "partially-correct";
|
|
59
|
-
/**
|
|
60
|
-
* Represents the outcome of evaluating a user's response against the correct answer.
|
|
61
|
-
* This object would be generated by an "evaluation engine" function that you will build later.
|
|
62
|
-
*/
|
|
63
|
-
interface EvaluationResult {
|
|
64
|
-
/**
|
|
65
|
-
* The overall status of the user's answer.
|
|
66
|
-
*/
|
|
67
|
-
status: EvaluationStatus;
|
|
68
|
-
/**
|
|
69
|
-
* The numerical score awarded for the response, derived from the `responseProcessing` rules.
|
|
70
|
-
*/
|
|
71
|
-
score: number;
|
|
72
|
-
/**
|
|
73
|
-
* The identifier of the specific feedback block to display to the user,
|
|
74
|
-
* e.g., "FB__RESPONSE_A". This is determined by the `feedbackMap` in your parsed item.
|
|
75
|
-
* Can be undefined if no specific feedback is applicable.
|
|
76
|
-
*/
|
|
77
|
-
feedbackIdentifier?: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
44
|
interface QtiFeedbackBlockProps {
|
|
81
45
|
/** The evaluation result containing feedback info */
|
|
82
46
|
result: EvaluationResult;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AssessmentItem } from './schema-
|
|
2
|
-
export { e as AnyInteraction, i as AssessmentItemSchema, C as ChoiceCorrectness, f as ChoiceInteraction, c as ContentBlockRenderer, a as ContentBlockRendererProps, F as FeedbackBlock, d as QTIRenderer, Q as QTIRendererProps, b as QTITheme, g as ResponseDeclaration, R as ResponseFeedback, h as ResponseProcessing } from './schema-
|
|
3
|
-
export { D as DisplayBlock, a as DisplayChoice, b as DisplayChoiceInteraction, c as DisplayItem, F as FormShape, V as ValidateResult } from './types-
|
|
1
|
+
import { A as AssessmentItem } from './schema-C3cRJWrK.js';
|
|
2
|
+
export { e as AnyInteraction, i as AssessmentItemSchema, C as ChoiceCorrectness, f as ChoiceInteraction, c as ContentBlockRenderer, a as ContentBlockRendererProps, F as FeedbackBlock, d as QTIRenderer, Q as QTIRendererProps, b as QTITheme, g as ResponseDeclaration, R as ResponseFeedback, h as ResponseProcessing } from './schema-C3cRJWrK.js';
|
|
3
|
+
export { D as DisplayBlock, a as DisplayChoice, b as DisplayChoiceInteraction, c as DisplayItem, F as FormShape, V as ValidateResult } from './types-BqqQtPL8.js';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { D as DisplayBlock, c as DisplayItem } from './types-
|
|
2
|
+
import { D as DisplayBlock, c as DisplayItem } from './types-BqqQtPL8.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/** Theme options for the QTI renderer */
|
|
@@ -148,6 +148,75 @@ declare const ChoiceInteractionSchema: z.ZodObject<{
|
|
|
148
148
|
type: z.ZodLiteral<"choiceInteraction">;
|
|
149
149
|
}, z.core.$strip>;
|
|
150
150
|
type ChoiceInteraction = z.infer<typeof ChoiceInteractionSchema>;
|
|
151
|
+
declare const InlineChoiceInteractionSchema: z.ZodObject<{
|
|
152
|
+
responseIdentifier: z.ZodString;
|
|
153
|
+
shuffle: z.ZodBoolean;
|
|
154
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
155
|
+
identifier: z.ZodString;
|
|
156
|
+
contentHtml: z.ZodString;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
type: z.ZodLiteral<"inlineChoiceInteraction">;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
type InlineChoiceInteraction = z.infer<typeof InlineChoiceInteractionSchema>;
|
|
161
|
+
declare const TextEntryInteractionSchema: z.ZodObject<{
|
|
162
|
+
responseIdentifier: z.ZodString;
|
|
163
|
+
expectedLength: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
placeholderText: z.ZodOptional<z.ZodString>;
|
|
165
|
+
patternMask: z.ZodOptional<z.ZodString>;
|
|
166
|
+
type: z.ZodLiteral<"textEntryInteraction">;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
type TextEntryInteraction = z.infer<typeof TextEntryInteractionSchema>;
|
|
169
|
+
declare const OrderInteractionSchema: z.ZodObject<{
|
|
170
|
+
responseIdentifier: z.ZodString;
|
|
171
|
+
shuffle: z.ZodBoolean;
|
|
172
|
+
minChoices: z.ZodNumber;
|
|
173
|
+
maxChoices: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
orientation: z.ZodEnum<{
|
|
175
|
+
vertical: "vertical";
|
|
176
|
+
horizontal: "horizontal";
|
|
177
|
+
}>;
|
|
178
|
+
promptHtml: z.ZodString;
|
|
179
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
180
|
+
identifier: z.ZodString;
|
|
181
|
+
contentHtml: z.ZodString;
|
|
182
|
+
inlineFeedbackHtml: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
type: z.ZodLiteral<"orderInteraction">;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
type OrderInteraction = z.infer<typeof OrderInteractionSchema>;
|
|
187
|
+
declare const GapMatchInteractionSchema: z.ZodObject<{
|
|
188
|
+
responseIdentifier: z.ZodString;
|
|
189
|
+
shuffle: z.ZodBoolean;
|
|
190
|
+
gapTexts: z.ZodArray<z.ZodObject<{
|
|
191
|
+
identifier: z.ZodString;
|
|
192
|
+
contentHtml: z.ZodString;
|
|
193
|
+
matchMax: z.ZodNumber;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
gaps: z.ZodArray<z.ZodObject<{
|
|
196
|
+
identifier: z.ZodString;
|
|
197
|
+
}, z.core.$strip>>;
|
|
198
|
+
contentHtml: z.ZodString;
|
|
199
|
+
type: z.ZodLiteral<"gapMatchInteraction">;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
type GapMatchInteraction = z.infer<typeof GapMatchInteractionSchema>;
|
|
202
|
+
declare const MatchInteractionSchema: z.ZodObject<{
|
|
203
|
+
responseIdentifier: z.ZodString;
|
|
204
|
+
shuffle: z.ZodBoolean;
|
|
205
|
+
maxAssociations: z.ZodNumber;
|
|
206
|
+
sourceChoices: z.ZodArray<z.ZodObject<{
|
|
207
|
+
identifier: z.ZodString;
|
|
208
|
+
matchMax: z.ZodNumber;
|
|
209
|
+
contentHtml: z.ZodString;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
targetChoices: z.ZodArray<z.ZodObject<{
|
|
212
|
+
identifier: z.ZodString;
|
|
213
|
+
matchMax: z.ZodNumber;
|
|
214
|
+
contentHtml: z.ZodString;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
promptHtml: z.ZodString;
|
|
217
|
+
type: z.ZodLiteral<"matchInteraction">;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
type MatchInteraction = z.infer<typeof MatchInteractionSchema>;
|
|
151
220
|
declare const AnyInteractionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
152
221
|
responseIdentifier: z.ZodString;
|
|
153
222
|
shuffle: z.ZodBoolean;
|
|
@@ -505,4 +574,4 @@ declare const AssessmentItemSchema: z.ZodObject<{
|
|
|
505
574
|
}, z.core.$strip>;
|
|
506
575
|
type AssessmentItem = z.infer<typeof AssessmentItemSchema>;
|
|
507
576
|
|
|
508
|
-
export { type AssessmentItem as A, type ChoiceCorrectness as C, type FeedbackBlock as F, type QTIRendererProps as Q, type ResponseFeedback as R, type ContentBlockRendererProps as a, type QTITheme as b, ContentBlockRenderer as c, QTIRenderer as d, type AnyInteraction as e, type ChoiceInteraction as f, type ResponseDeclaration as g, type ResponseProcessing as h, AssessmentItemSchema as i };
|
|
577
|
+
export { type AssessmentItem as A, type ChoiceCorrectness as C, type FeedbackBlock as F, type GapMatchInteraction as G, type InlineChoiceInteraction as I, type MatchInteraction as M, type OrderInteraction as O, type QTIRendererProps as Q, type ResponseFeedback as R, type TextEntryInteraction as T, type ContentBlockRendererProps as a, type QTITheme as b, ContentBlockRenderer as c, QTIRenderer as d, type AnyInteraction as e, type ChoiceInteraction as f, type ResponseDeclaration as g, type ResponseProcessing as h, AssessmentItemSchema as i, type AnyCondition as j };
|
|
@@ -99,4 +99,4 @@ type ValidateResult = {
|
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
export type { DisplayBlock as D, FormShape as F, ValidateResult as V, DisplayChoice as a, DisplayChoiceInteraction as b, DisplayItem as c, DisplayInlineEmbed as d, DisplayTextEmbed as e, DisplayGap as f };
|
|
102
|
+
export type { DisplayBlock as D, FormShape as F, ValidateResult as V, DisplayChoice as a, DisplayChoiceInteraction as b, DisplayItem as c, DisplayInlineEmbed as d, DisplayTextEmbed as e, DisplayGap as f, DisplayAssociableChoice as g, DisplayGapText as h };
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { g as DisplayAssociableChoice, D as DisplayBlock, a as DisplayChoice, b as DisplayChoiceInteraction, f as DisplayGap, h as DisplayGapText, d as DisplayInlineEmbed, c as DisplayItem, e as DisplayTextEmbed, F as FormShape, V as ValidateResult } from './types-BqqQtPL8.js';
|
|
2
|
+
export { j as AnyCondition, e as AnyInteraction, A as AssessmentItem, C as ChoiceCorrectness, f as ChoiceInteraction, a as ContentBlockRendererProps, F as FeedbackBlock, G as GapMatchInteraction, I as InlineChoiceInteraction, M as MatchInteraction, O as OrderInteraction, Q as QTIRendererProps, b as QTITheme, g as ResponseDeclaration, R as ResponseFeedback, h as ResponseProcessing, T as TextEntryInteraction } from './schema-C3cRJWrK.js';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
type EvaluationResult = {
|
|
7
|
+
status: "correct" | "incorrect" | "unanswered";
|
|
8
|
+
feedbackIdentifier?: string;
|
|
9
|
+
responseResults: Record<string, {
|
|
10
|
+
isCorrect: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type { EvaluationResult };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superbuilders/incept-renderer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "QTI 3.0 Assessment Renderer - Parse, validate, and render QTI XML with customizable themes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"./components": {
|
|
19
19
|
"types": "./dist/components/index.d.ts",
|
|
20
20
|
"import": "./dist/components/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./types": {
|
|
23
|
+
"types": "./dist/types.d.ts",
|
|
24
|
+
"import": "./dist/types.js"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"files": [
|