@examplary/qti 1.0.0 → 1.1.0
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/ims/ims-manifest.js +15 -7
- package/dist/ims/ims-package.js +14 -6
- package/dist/index.js +23 -8
- package/dist/qti/interactions/associate-interaction.js +10 -7
- package/dist/qti/interactions/choice-interaction.js +10 -7
- package/dist/qti/interactions/drawing-interaction.js +8 -5
- package/dist/qti/interactions/end-attempt-interaction.js +8 -5
- package/dist/qti/interactions/extended-text-interaction.js +8 -5
- package/dist/qti/interactions/gap-match-interaction.js +11 -8
- package/dist/qti/interactions/graphic-associate-interaction.js +8 -5
- package/dist/qti/interactions/graphic-gap-match-interaction.js +8 -5
- package/dist/qti/interactions/graphic-order-interaction.js +8 -5
- package/dist/qti/interactions/hotspot-interaction.js +8 -5
- package/dist/qti/interactions/hottext-interaction.js +10 -7
- package/dist/qti/interactions/index.js +79 -63
- package/dist/qti/interactions/inline-choice-interaction.js +10 -7
- package/dist/qti/interactions/interaction.js +12 -5
- package/dist/qti/interactions/match-interaction.js +11 -8
- package/dist/qti/interactions/media-interaction.js +8 -5
- package/dist/qti/interactions/order-interaction.js +10 -7
- package/dist/qti/interactions/position-object-interaction.js +8 -5
- package/dist/qti/interactions/select-point-interaction.js +8 -5
- package/dist/qti/interactions/slider-interaction.js +8 -5
- package/dist/qti/interactions/text-entry-interaction.js +8 -5
- package/dist/qti/interactions/upload-interaction.js +8 -5
- package/dist/qti/qti-element.d.ts +1 -1
- package/dist/qti/qti-element.js +5 -2
- package/dist/qti/qti-item.js +25 -12
- package/dist/qti/qti-test.js +19 -7
- package/dist/qti/types.js +2 -2
- package/dist/utils/html.js +7 -4
- package/package.json +3 -3
- package/dist/ims/ims-manifest.js.map +0 -1
- package/dist/ims/ims-package.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/qti/interactions/associate-interaction.js.map +0 -1
- package/dist/qti/interactions/choice-interaction.js.map +0 -1
- package/dist/qti/interactions/drawing-interaction.js.map +0 -1
- package/dist/qti/interactions/end-attempt-interaction.js.map +0 -1
- package/dist/qti/interactions/extended-text-interaction.js.map +0 -1
- package/dist/qti/interactions/gap-match-interaction.js.map +0 -1
- package/dist/qti/interactions/graphic-associate-interaction.js.map +0 -1
- package/dist/qti/interactions/graphic-gap-match-interaction.js.map +0 -1
- package/dist/qti/interactions/graphic-order-interaction.js.map +0 -1
- package/dist/qti/interactions/hotspot-interaction.js.map +0 -1
- package/dist/qti/interactions/hottext-interaction.js.map +0 -1
- package/dist/qti/interactions/index.js.map +0 -1
- package/dist/qti/interactions/inline-choice-interaction.js.map +0 -1
- package/dist/qti/interactions/interaction.js.map +0 -1
- package/dist/qti/interactions/match-interaction.js.map +0 -1
- package/dist/qti/interactions/media-interaction.js.map +0 -1
- package/dist/qti/interactions/order-interaction.js.map +0 -1
- package/dist/qti/interactions/position-object-interaction.js.map +0 -1
- package/dist/qti/interactions/select-point-interaction.js.map +0 -1
- package/dist/qti/interactions/slider-interaction.js.map +0 -1
- package/dist/qti/interactions/text-entry-interaction.js.map +0 -1
- package/dist/qti/interactions/upload-interaction.js.map +0 -1
- package/dist/qti/qti-element.js.map +0 -1
- package/dist/qti/qti-item.js.map +0 -1
- package/dist/qti/qti-test.js.map +0 -1
- package/dist/qti/types.js.map +0 -1
- package/dist/utils/html.js.map +0 -1
package/dist/ims/ims-manifest.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImsManifest = exports.ImsManifestResourceType = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
var ImsManifestResourceType;
|
|
3
6
|
(function (ImsManifestResourceType) {
|
|
4
7
|
// QTI 3 AssessmentTest
|
|
5
8
|
ImsManifestResourceType["imsqti_test_xmlv3p0"] = "imsqti_test_xmlv3p0";
|
|
@@ -45,10 +48,15 @@ export var ImsManifestResourceType;
|
|
|
45
48
|
ImsManifestResourceType["resourceextmetadata/xml"] = "resourceextmetadata/xml";
|
|
46
49
|
// QTI 3 Usage Data (may need to pass to a CAT engine)
|
|
47
50
|
ImsManifestResourceType["qtiusagedata/xml"] = "qtiusagedata/xml";
|
|
48
|
-
})(ImsManifestResourceType || (ImsManifestResourceType = {}));
|
|
49
|
-
|
|
51
|
+
})(ImsManifestResourceType || (exports.ImsManifestResourceType = ImsManifestResourceType = {}));
|
|
52
|
+
class ImsManifest {
|
|
53
|
+
resources = new Map();
|
|
54
|
+
identifier;
|
|
55
|
+
title;
|
|
56
|
+
language;
|
|
57
|
+
toolName;
|
|
58
|
+
toolVersion;
|
|
50
59
|
constructor(options) {
|
|
51
|
-
this.resources = new Map();
|
|
52
60
|
this.identifier = options?.identifier || "manifest-" + Date.now();
|
|
53
61
|
this.title = options?.title || "QTI 3 Package";
|
|
54
62
|
this.language = options?.language || "en";
|
|
@@ -66,7 +74,7 @@ export class ImsManifest {
|
|
|
66
74
|
return Array.from(this.resources.values());
|
|
67
75
|
}
|
|
68
76
|
buildXml() {
|
|
69
|
-
const manifest = create({ version: "1.0", encoding: "UTF-8" }).ele("manifest", {
|
|
77
|
+
const manifest = (0, xmlbuilder2_1.create)({ version: "1.0", encoding: "UTF-8" }).ele("manifest", {
|
|
70
78
|
xmlns: "http://www.imsglobal.org/xsd/qti/qtiv3p0/imscp_v1p1",
|
|
71
79
|
"xmlns:lom": "http://ltsc.ieee.org/xsd/LOM",
|
|
72
80
|
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
|
|
@@ -123,4 +131,4 @@ export class ImsManifest {
|
|
|
123
131
|
return manifest.end({ prettyPrint: true });
|
|
124
132
|
}
|
|
125
133
|
}
|
|
126
|
-
|
|
134
|
+
exports.ImsManifest = ImsManifest;
|
package/dist/ims/ims-package.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ImsPackage = void 0;
|
|
7
|
+
const jszip_1 = __importDefault(require("jszip"));
|
|
8
|
+
const ims_manifest_1 = require("./ims-manifest");
|
|
9
|
+
class ImsPackage {
|
|
10
|
+
manifest;
|
|
11
|
+
zip;
|
|
4
12
|
/**
|
|
5
13
|
* Create a new IMS Package.
|
|
6
14
|
*/
|
|
7
15
|
constructor(manifestOptions) {
|
|
8
|
-
this.manifest = new ImsManifest(manifestOptions);
|
|
9
|
-
this.zip = new
|
|
16
|
+
this.manifest = new ims_manifest_1.ImsManifest(manifestOptions);
|
|
17
|
+
this.zip = new jszip_1.default();
|
|
10
18
|
}
|
|
11
19
|
/**
|
|
12
20
|
* Add a resource to the IMS Package, along with its associated files.
|
|
@@ -45,4 +53,4 @@ export class ImsPackage {
|
|
|
45
53
|
return this.zip.generateAsync({ type: "arraybuffer" });
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
|
-
|
|
56
|
+
exports.ImsPackage = ImsPackage;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ims/ims-manifest"), exports);
|
|
18
|
+
__exportStar(require("./ims/ims-package"), exports);
|
|
19
|
+
__exportStar(require("./qti/qti-element"), exports);
|
|
20
|
+
__exportStar(require("./qti/qti-test"), exports);
|
|
21
|
+
__exportStar(require("./qti/qti-item"), exports);
|
|
22
|
+
__exportStar(require("./qti/interactions"), exports);
|
|
23
|
+
__exportStar(require("./qti/types"), exports);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssociateInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
6
|
+
const html_1 = require("../../utils/html");
|
|
4
7
|
/**
|
|
5
8
|
* Presents a set of choices for candidates to pair or associate with each other.
|
|
6
9
|
* Unlike MatchInteraction, choices come from a single set and can be paired freely.
|
|
@@ -18,10 +21,10 @@ import { appendHtmlFragment } from "../../utils/html";
|
|
|
18
21
|
* ],
|
|
19
22
|
* });
|
|
20
23
|
*/
|
|
21
|
-
|
|
24
|
+
class AssociateInteraction extends interaction_1.QtiPromptInteraction {
|
|
22
25
|
constructor(options) {
|
|
23
26
|
super(options);
|
|
24
|
-
this.item = fragment().ele("qti-associate-interaction", {
|
|
27
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-associate-interaction", {
|
|
25
28
|
"response-identifier": options.responseIdentifier,
|
|
26
29
|
label: options.label,
|
|
27
30
|
shuffle: options.shuffle ? "true" : "false",
|
|
@@ -38,9 +41,9 @@ export class AssociateInteraction extends QtiPromptInteraction {
|
|
|
38
41
|
"template-identifier": choice.templateIdentifier,
|
|
39
42
|
});
|
|
40
43
|
if (choice.content) {
|
|
41
|
-
appendHtmlFragment(choice.content, choiceEl);
|
|
44
|
+
(0, html_1.appendHtmlFragment)(choice.content, choiceEl);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
exports.AssociateInteraction = AssociateInteraction;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChoiceInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
6
|
+
const html_1 = require("../../utils/html");
|
|
4
7
|
/**
|
|
5
8
|
* Presents a set of choices for candidates to select one or more options.
|
|
6
9
|
* Supports single-select (radio) or multi-select (checkbox) modes via maxChoices.
|
|
@@ -17,10 +20,10 @@ import { appendHtmlFragment } from "../../utils/html";
|
|
|
17
20
|
* ],
|
|
18
21
|
* });
|
|
19
22
|
*/
|
|
20
|
-
|
|
23
|
+
class ChoiceInteraction extends interaction_1.QtiPromptInteraction {
|
|
21
24
|
constructor(options) {
|
|
22
25
|
super(options);
|
|
23
|
-
this.item = fragment().ele("qti-choice-interaction", {
|
|
26
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-choice-interaction", {
|
|
24
27
|
"response-identifier": options.responseIdentifier,
|
|
25
28
|
label: options.label,
|
|
26
29
|
shuffle: options.shuffle ? "true" : "false",
|
|
@@ -31,7 +34,7 @@ export class ChoiceInteraction extends QtiPromptInteraction {
|
|
|
31
34
|
"data-max-selections-message": options.maxSelectionsMessage,
|
|
32
35
|
});
|
|
33
36
|
for (const choice of options.choices || []) {
|
|
34
|
-
appendHtmlFragment(choice.content || "", this.item.ele("qti-simple-choice", {
|
|
37
|
+
(0, html_1.appendHtmlFragment)(choice.content || "", this.item.ele("qti-simple-choice", {
|
|
35
38
|
identifier: choice.identifier,
|
|
36
39
|
fixed: choice.fixed ? "true" : "false",
|
|
37
40
|
"template-identifier": choice.templateIdentifier,
|
|
@@ -40,4 +43,4 @@ export class ChoiceInteraction extends QtiPromptInteraction {
|
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
|
-
|
|
46
|
+
exports.ChoiceInteraction = ChoiceInteraction;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DrawingInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
3
6
|
/**
|
|
4
7
|
* Presents a canvas where candidates can draw or annotate over a background image.
|
|
5
8
|
* Used for freeform drawing, labeling, or annotation tasks.
|
|
@@ -12,10 +15,10 @@ import { QtiPromptInteraction, } from "./interaction";
|
|
|
12
15
|
* object: { data: "canvas.png", type: "image/png", width: 400, height: 300 },
|
|
13
16
|
* });
|
|
14
17
|
*/
|
|
15
|
-
|
|
18
|
+
class DrawingInteraction extends interaction_1.QtiPromptInteraction {
|
|
16
19
|
constructor(options) {
|
|
17
20
|
super(options);
|
|
18
|
-
this.item = fragment().ele("qti-drawing-interaction", {
|
|
21
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-drawing-interaction", {
|
|
19
22
|
"response-identifier": options.responseIdentifier,
|
|
20
23
|
label: options.label,
|
|
21
24
|
});
|
|
@@ -27,4 +30,4 @@ export class DrawingInteraction extends QtiPromptInteraction {
|
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
|
-
|
|
33
|
+
exports.DrawingInteraction = DrawingInteraction;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EndAttemptInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
3
6
|
/**
|
|
4
7
|
* Presents a button that allows candidates to voluntarily end their assessment attempt.
|
|
5
8
|
* Used for "give up" or "submit early" functionality in adaptive testing scenarios.
|
|
@@ -13,10 +16,10 @@ import { QtiInteraction } from "./interaction";
|
|
|
13
16
|
* countAttempt: true,
|
|
14
17
|
* });
|
|
15
18
|
*/
|
|
16
|
-
|
|
19
|
+
class EndAttemptInteraction extends interaction_1.QtiInteraction {
|
|
17
20
|
constructor(options) {
|
|
18
21
|
super(options);
|
|
19
|
-
this.item = fragment().ele("qti-end-attempt-interaction", {
|
|
22
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-end-attempt-interaction", {
|
|
20
23
|
"response-identifier": options.responseIdentifier,
|
|
21
24
|
label: options.label,
|
|
22
25
|
title: options.title,
|
|
@@ -24,4 +27,4 @@ export class EndAttemptInteraction extends QtiInteraction {
|
|
|
24
27
|
});
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
|
-
|
|
30
|
+
exports.EndAttemptInteraction = EndAttemptInteraction;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExtendedTextInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
3
6
|
/**
|
|
4
7
|
* Allows candidates to enter extended text responses, such as essays or paragraphs.
|
|
5
8
|
* Supports configurable length constraints, formatting options, and input validation.
|
|
@@ -13,10 +16,10 @@ import { QtiPromptInteraction, } from "./interaction";
|
|
|
13
16
|
* format: "plain",
|
|
14
17
|
* });
|
|
15
18
|
*/
|
|
16
|
-
|
|
19
|
+
class ExtendedTextInteraction extends interaction_1.QtiPromptInteraction {
|
|
17
20
|
constructor(options) {
|
|
18
21
|
super(options);
|
|
19
|
-
this.item = fragment().ele("qti-extended-text-interaction", {
|
|
22
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-extended-text-interaction", {
|
|
20
23
|
"response-identifier": options.responseIdentifier,
|
|
21
24
|
label: options.label,
|
|
22
25
|
base: options.base?.toString(),
|
|
@@ -31,4 +34,4 @@ export class ExtendedTextInteraction extends QtiPromptInteraction {
|
|
|
31
34
|
});
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
exports.ExtendedTextInteraction = ExtendedTextInteraction;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GapMatchInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
6
|
+
const html_1 = require("../../utils/html");
|
|
4
7
|
/**
|
|
5
8
|
* Presents candidates with a set of gaps within content and a set of choices to fill them.
|
|
6
9
|
* Candidates drag or select choices to match them with the appropriate gaps.
|
|
@@ -17,10 +20,10 @@ import { appendHtmlFragment } from "../../utils/html";
|
|
|
17
20
|
* content: "<p>The capital of France is <qti-gap identifier='G1'/>.</p>",
|
|
18
21
|
* });
|
|
19
22
|
*/
|
|
20
|
-
|
|
23
|
+
class GapMatchInteraction extends interaction_1.QtiPromptInteraction {
|
|
21
24
|
constructor(options) {
|
|
22
25
|
super(options);
|
|
23
|
-
this.item = fragment().ele("qti-gap-match-interaction", {
|
|
26
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-gap-match-interaction", {
|
|
24
27
|
"response-identifier": options.responseIdentifier,
|
|
25
28
|
label: options.label,
|
|
26
29
|
shuffle: options.shuffle ? "true" : "false",
|
|
@@ -35,12 +38,12 @@ export class GapMatchInteraction extends QtiPromptInteraction {
|
|
|
35
38
|
"match-group": gapText.matchGroup,
|
|
36
39
|
});
|
|
37
40
|
if (gapText.content) {
|
|
38
|
-
appendHtmlFragment(gapText.content, gapTextEl);
|
|
41
|
+
(0, html_1.appendHtmlFragment)(gapText.content, gapTextEl);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
if (options.content) {
|
|
42
|
-
appendHtmlFragment(options.content, this.item);
|
|
45
|
+
(0, html_1.appendHtmlFragment)(options.content, this.item);
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
exports.GapMatchInteraction = GapMatchInteraction;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphicAssociateInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
3
6
|
/**
|
|
4
7
|
* Presents an image with hotspots for candidates to associate or connect with each other.
|
|
5
8
|
* Used for drawing connections between points on a diagram or map.
|
|
@@ -16,10 +19,10 @@ import { QtiPromptInteraction, } from "./interaction";
|
|
|
16
19
|
* ],
|
|
17
20
|
* });
|
|
18
21
|
*/
|
|
19
|
-
|
|
22
|
+
class GraphicAssociateInteraction extends interaction_1.QtiPromptInteraction {
|
|
20
23
|
constructor(options) {
|
|
21
24
|
super(options);
|
|
22
|
-
this.item = fragment().ele("qti-graphic-associate-interaction", {
|
|
25
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-graphic-associate-interaction", {
|
|
23
26
|
"response-identifier": options.responseIdentifier,
|
|
24
27
|
label: options.label,
|
|
25
28
|
"min-associations": options.minAssociations?.toString(),
|
|
@@ -44,4 +47,4 @@ export class GraphicAssociateInteraction extends QtiPromptInteraction {
|
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
|
-
|
|
50
|
+
exports.GraphicAssociateInteraction = GraphicAssociateInteraction;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphicGapMatchInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
3
6
|
/**
|
|
4
7
|
* Presents an image with gap regions and a set of images/text to drag onto those regions.
|
|
5
8
|
* Used for labeling diagrams or placing items in specific locations on an image.
|
|
@@ -18,10 +21,10 @@ import { QtiPromptInteraction, } from "./interaction";
|
|
|
18
21
|
* ],
|
|
19
22
|
* });
|
|
20
23
|
*/
|
|
21
|
-
|
|
24
|
+
class GraphicGapMatchInteraction extends interaction_1.QtiPromptInteraction {
|
|
22
25
|
constructor(options) {
|
|
23
26
|
super(options);
|
|
24
|
-
this.item = fragment().ele("qti-graphic-gap-match-interaction", {
|
|
27
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-graphic-gap-match-interaction", {
|
|
25
28
|
"response-identifier": options.responseIdentifier,
|
|
26
29
|
label: options.label,
|
|
27
30
|
"min-associations": options.minAssociations?.toString(),
|
|
@@ -61,4 +64,4 @@ export class GraphicGapMatchInteraction extends QtiPromptInteraction {
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
|
|
67
|
+
exports.GraphicGapMatchInteraction = GraphicGapMatchInteraction;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphicOrderInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
3
6
|
/**
|
|
4
7
|
* Presents an image with hotspots for candidates to select in a specific order.
|
|
5
8
|
* Used for sequencing tasks on diagrams, maps, or other visual content.
|
|
@@ -16,10 +19,10 @@ import { QtiPromptInteraction, } from "./interaction";
|
|
|
16
19
|
* ],
|
|
17
20
|
* });
|
|
18
21
|
*/
|
|
19
|
-
|
|
22
|
+
class GraphicOrderInteraction extends interaction_1.QtiPromptInteraction {
|
|
20
23
|
constructor(options) {
|
|
21
24
|
super(options);
|
|
22
|
-
this.item = fragment().ele("qti-graphic-order-interaction", {
|
|
25
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-graphic-order-interaction", {
|
|
23
26
|
"response-identifier": options.responseIdentifier,
|
|
24
27
|
label: options.label,
|
|
25
28
|
"min-choices": options.minChoices?.toString(),
|
|
@@ -43,4 +46,4 @@ export class GraphicOrderInteraction extends QtiPromptInteraction {
|
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
exports.GraphicOrderInteraction = GraphicOrderInteraction;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HotspotInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
3
6
|
/**
|
|
4
7
|
* Presents an image with defined clickable regions (hotspots) for candidates to select.
|
|
5
8
|
* Used for questions where candidates identify specific areas on a diagram or map.
|
|
@@ -16,10 +19,10 @@ import { QtiPromptInteraction, } from "./interaction";
|
|
|
16
19
|
* ],
|
|
17
20
|
* });
|
|
18
21
|
*/
|
|
19
|
-
|
|
22
|
+
class HotspotInteraction extends interaction_1.QtiPromptInteraction {
|
|
20
23
|
constructor(options) {
|
|
21
24
|
super(options);
|
|
22
|
-
this.item = fragment().ele("qti-hotspot-interaction", {
|
|
25
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-hotspot-interaction", {
|
|
23
26
|
"response-identifier": options.responseIdentifier,
|
|
24
27
|
label: options.label,
|
|
25
28
|
"min-choices": options.minChoices?.toString(),
|
|
@@ -43,4 +46,4 @@ export class HotspotInteraction extends QtiPromptInteraction {
|
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
exports.HotspotInteraction = HotspotInteraction;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HottextInteraction = void 0;
|
|
4
|
+
const xmlbuilder2_1 = require("xmlbuilder2");
|
|
5
|
+
const interaction_1 = require("./interaction");
|
|
6
|
+
const html_1 = require("../../utils/html");
|
|
4
7
|
/**
|
|
5
8
|
* Presents text with selectable words or phrases (hottext) for candidates to choose.
|
|
6
9
|
* Used for questions where candidates identify specific parts of a text passage.
|
|
@@ -14,18 +17,18 @@ import { appendHtmlFragment } from "../../utils/html";
|
|
|
14
17
|
* content: "<p>Select the <qti-hottext identifier='A'>noun</qti-hottext> in: The <qti-hottext identifier='B'>cat</qti-hottext> sat.</p>",
|
|
15
18
|
* });
|
|
16
19
|
*/
|
|
17
|
-
|
|
20
|
+
class HottextInteraction extends interaction_1.QtiPromptInteraction {
|
|
18
21
|
constructor(options) {
|
|
19
22
|
super(options);
|
|
20
|
-
this.item = fragment().ele("qti-hottext-interaction", {
|
|
23
|
+
this.item = (0, xmlbuilder2_1.fragment)().ele("qti-hottext-interaction", {
|
|
21
24
|
"response-identifier": options.responseIdentifier,
|
|
22
25
|
label: options.label,
|
|
23
26
|
"min-choices": options.minChoices?.toString(),
|
|
24
27
|
"max-choices": options.maxChoices?.toString(),
|
|
25
28
|
});
|
|
26
29
|
if (options.content) {
|
|
27
|
-
appendHtmlFragment(options.content, this.item);
|
|
30
|
+
(0, html_1.appendHtmlFragment)(options.content, this.item);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
|
-
|
|
34
|
+
exports.HottextInteraction = HottextInteraction;
|
|
@@ -1,64 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.qtiInteractionTypes = void 0;
|
|
18
|
+
const associate_interaction_1 = require("./associate-interaction");
|
|
19
|
+
const choice_interaction_1 = require("./choice-interaction");
|
|
20
|
+
const drawing_interaction_1 = require("./drawing-interaction");
|
|
21
|
+
const end_attempt_interaction_1 = require("./end-attempt-interaction");
|
|
22
|
+
const extended_text_interaction_1 = require("./extended-text-interaction");
|
|
23
|
+
const gap_match_interaction_1 = require("./gap-match-interaction");
|
|
24
|
+
const graphic_associate_interaction_1 = require("./graphic-associate-interaction");
|
|
25
|
+
const graphic_gap_match_interaction_1 = require("./graphic-gap-match-interaction");
|
|
26
|
+
const graphic_order_interaction_1 = require("./graphic-order-interaction");
|
|
27
|
+
const hotspot_interaction_1 = require("./hotspot-interaction");
|
|
28
|
+
const hottext_interaction_1 = require("./hottext-interaction");
|
|
29
|
+
const inline_choice_interaction_1 = require("./inline-choice-interaction");
|
|
30
|
+
const match_interaction_1 = require("./match-interaction");
|
|
31
|
+
const media_interaction_1 = require("./media-interaction");
|
|
32
|
+
const order_interaction_1 = require("./order-interaction");
|
|
33
|
+
const position_object_interaction_1 = require("./position-object-interaction");
|
|
34
|
+
const select_point_interaction_1 = require("./select-point-interaction");
|
|
35
|
+
const slider_interaction_1 = require("./slider-interaction");
|
|
36
|
+
const text_entry_interaction_1 = require("./text-entry-interaction");
|
|
37
|
+
const upload_interaction_1 = require("./upload-interaction");
|
|
38
|
+
__exportStar(require("./associate-interaction"), exports);
|
|
39
|
+
__exportStar(require("./choice-interaction"), exports);
|
|
40
|
+
__exportStar(require("./drawing-interaction"), exports);
|
|
41
|
+
__exportStar(require("./end-attempt-interaction"), exports);
|
|
42
|
+
__exportStar(require("./extended-text-interaction"), exports);
|
|
43
|
+
__exportStar(require("./gap-match-interaction"), exports);
|
|
44
|
+
__exportStar(require("./graphic-associate-interaction"), exports);
|
|
45
|
+
__exportStar(require("./graphic-gap-match-interaction"), exports);
|
|
46
|
+
__exportStar(require("./graphic-order-interaction"), exports);
|
|
47
|
+
__exportStar(require("./hotspot-interaction"), exports);
|
|
48
|
+
__exportStar(require("./hottext-interaction"), exports);
|
|
49
|
+
__exportStar(require("./inline-choice-interaction"), exports);
|
|
50
|
+
__exportStar(require("./interaction"), exports);
|
|
51
|
+
__exportStar(require("./match-interaction"), exports);
|
|
52
|
+
__exportStar(require("./media-interaction"), exports);
|
|
53
|
+
__exportStar(require("./order-interaction"), exports);
|
|
54
|
+
__exportStar(require("./position-object-interaction"), exports);
|
|
55
|
+
__exportStar(require("./select-point-interaction"), exports);
|
|
56
|
+
__exportStar(require("./slider-interaction"), exports);
|
|
57
|
+
__exportStar(require("./text-entry-interaction"), exports);
|
|
58
|
+
__exportStar(require("./upload-interaction"), exports);
|
|
59
|
+
exports.qtiInteractionTypes = {
|
|
60
|
+
AssociateInteraction: associate_interaction_1.AssociateInteraction,
|
|
61
|
+
ChoiceInteraction: choice_interaction_1.ChoiceInteraction,
|
|
62
|
+
DrawingInteraction: drawing_interaction_1.DrawingInteraction,
|
|
63
|
+
EndAttemptInteraction: end_attempt_interaction_1.EndAttemptInteraction,
|
|
64
|
+
ExtendedTextInteraction: extended_text_interaction_1.ExtendedTextInteraction,
|
|
65
|
+
GapMatchInteraction: gap_match_interaction_1.GapMatchInteraction,
|
|
66
|
+
GraphicAssociateInteraction: graphic_associate_interaction_1.GraphicAssociateInteraction,
|
|
67
|
+
GraphicGapMatchInteraction: graphic_gap_match_interaction_1.GraphicGapMatchInteraction,
|
|
68
|
+
GraphicOrderInteraction: graphic_order_interaction_1.GraphicOrderInteraction,
|
|
69
|
+
HotspotInteraction: hotspot_interaction_1.HotspotInteraction,
|
|
70
|
+
HottextInteraction: hottext_interaction_1.HottextInteraction,
|
|
71
|
+
InlineChoiceInteraction: inline_choice_interaction_1.InlineChoiceInteraction,
|
|
72
|
+
MatchInteraction: match_interaction_1.MatchInteraction,
|
|
73
|
+
MediaInteraction: media_interaction_1.MediaInteraction,
|
|
74
|
+
OrderInteraction: order_interaction_1.OrderInteraction,
|
|
75
|
+
PositionObjectInteraction: position_object_interaction_1.PositionObjectInteraction,
|
|
76
|
+
SelectPointInteraction: select_point_interaction_1.SelectPointInteraction,
|
|
77
|
+
SliderInteraction: slider_interaction_1.SliderInteraction,
|
|
78
|
+
TextEntryInteraction: text_entry_interaction_1.TextEntryInteraction,
|
|
79
|
+
UploadInteraction: upload_interaction_1.UploadInteraction,
|
|
63
80
|
};
|
|
64
|
-
//# sourceMappingURL=index.js.map
|