@citolab/qti-components 7.0.1 → 7.0.2

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 (42) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/{index.min.js → index.js} +378 -186
  3. package/dist/custom-elements.json +27088 -0
  4. package/dist/{qti-test/index.d.ts → index.d.ts} +163 -2
  5. package/dist/index.js +13601 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/item.css +223 -32
  8. package/dist/{qti-loader → loader}/index.d.ts +1 -1
  9. package/dist/qti-components-jsx.d.ts +29 -25
  10. package/dist/{qti-simple-choice-CynLWb8d.d.cts → qti-simple-choice-DG8ImdPz.d.ts} +2 -2
  11. package/dist/vscode.html-custom-data.json +12 -9
  12. package/package.json +40 -59
  13. package/cdn/index.min.cjs +0 -4489
  14. package/dist/qti-components/index.cjs +0 -6704
  15. package/dist/qti-components/index.cjs.map +0 -1
  16. package/dist/qti-components/index.d.cts +0 -150
  17. package/dist/qti-components/index.d.ts +0 -150
  18. package/dist/qti-components/index.js +0 -6593
  19. package/dist/qti-components/index.js.map +0 -1
  20. package/dist/qti-item/index.cjs +0 -89
  21. package/dist/qti-item/index.cjs.map +0 -1
  22. package/dist/qti-item/index.d.cts +0 -24
  23. package/dist/qti-item/index.d.ts +0 -24
  24. package/dist/qti-item/index.js +0 -65
  25. package/dist/qti-item/index.js.map +0 -1
  26. package/dist/qti-loader/index.cjs +0 -332
  27. package/dist/qti-loader/index.cjs.map +0 -1
  28. package/dist/qti-loader/index.d.cts +0 -20
  29. package/dist/qti-simple-choice-CynLWb8d.d.ts +0 -1185
  30. package/dist/qti-test/index.cjs +0 -4632
  31. package/dist/qti-test/index.cjs.map +0 -1
  32. package/dist/qti-test/index.d.cts +0 -304
  33. package/dist/qti-test/index.js +0 -4599
  34. package/dist/qti-test/index.js.map +0 -1
  35. package/dist/qti-transformers/index.cjs +0 -316
  36. package/dist/qti-transformers/index.cjs.map +0 -1
  37. package/dist/qti-transformers/index.d.cts +0 -75
  38. /package/dist/{qti-loader → loader}/index.js +0 -0
  39. /package/dist/{qti-loader → loader}/index.js.map +0 -0
  40. /package/dist/{qti-transformers → transformers}/index.d.ts +0 -0
  41. /package/dist/{qti-transformers → transformers}/index.js +0 -0
  42. /package/dist/{qti-transformers → transformers}/index.js.map +0 -0
@@ -1,4599 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
9
- return result;
10
- };
11
-
12
- // src/lib/qti-test/qti-assessment-test/qti-assessment-item-ref.ts
13
- import { consume } from "@lit/context";
14
- import { html, LitElement } from "lit";
15
- import { property } from "lit/decorators.js";
16
-
17
- // src/lib/qti-test/context/test.context.ts
18
- import { createContext } from "@lit/context";
19
- var testContext = createContext(Symbol("test"));
20
- var testElement = createContext(Symbol("testElement"));
21
-
22
- // src/lib/qti-test/qti-assessment-test/qti-assessment-item-ref.ts
23
- var stringToBooleanConverter = {
24
- fromAttribute(value) {
25
- return value === "true";
26
- },
27
- toAttribute(value) {
28
- return value ? "true" : "false";
29
- }
30
- };
31
- var QtiAssessmentItemRef = class extends LitElement {
32
- constructor() {
33
- super(...arguments);
34
- this.weigths = /* @__PURE__ */ new Map();
35
- }
36
- // the XMLDocument
37
- createRenderRoot() {
38
- return this;
39
- }
40
- get assessmentItem() {
41
- return this.renderRoot?.querySelector("qti-assessment-item");
42
- }
43
- async connectedCallback() {
44
- super.connectedCallback();
45
- await this.updateComplete;
46
- this.dispatchEvent(
47
- new CustomEvent("qti-assessment-item-ref-connected", {
48
- bubbles: true,
49
- composed: true,
50
- detail: { identifier: this.identifier, href: this.href, category: this.category }
51
- })
52
- );
53
- }
54
- render() {
55
- return html`${this.xmlDoc}`;
56
- }
57
- };
58
- __decorateClass([
59
- property({ type: String })
60
- ], QtiAssessmentItemRef.prototype, "category", 2);
61
- __decorateClass([
62
- property({ type: String })
63
- ], QtiAssessmentItemRef.prototype, "identifier", 2);
64
- __decorateClass([
65
- property({ type: Boolean, converter: stringToBooleanConverter })
66
- ], QtiAssessmentItemRef.prototype, "required", 2);
67
- __decorateClass([
68
- property({ type: Boolean, converter: stringToBooleanConverter })
69
- ], QtiAssessmentItemRef.prototype, "fixed", 2);
70
- __decorateClass([
71
- property({ type: String })
72
- ], QtiAssessmentItemRef.prototype, "href", 2);
73
- __decorateClass([
74
- consume({ context: testContext, subscribe: true })
75
- ], QtiAssessmentItemRef.prototype, "_testContext", 2);
76
- __decorateClass([
77
- property({ type: Object, attribute: false })
78
- ], QtiAssessmentItemRef.prototype, "xmlDoc", 2);
79
- if (!customElements.get("qti-assessment-item-ref")) {
80
- customElements.define("qti-assessment-item-ref", QtiAssessmentItemRef);
81
- }
82
-
83
- // src/lib/qti-test/qti-assessment-test/qti-assessment-section.ts
84
- import { consume as consume2 } from "@lit/context";
85
- import { html as html2, LitElement as LitElement2 } from "lit";
86
- import { property as property2 } from "lit/decorators.js";
87
- var stringToBooleanConverter2 = {
88
- fromAttribute(value) {
89
- return value === "true";
90
- },
91
- toAttribute(value) {
92
- return value ? "true" : "false";
93
- }
94
- };
95
- var QtiAssessmentSection = class extends LitElement2 {
96
- async connectedCallback() {
97
- super.connectedCallback();
98
- await this.updateComplete;
99
- this.dispatchEvent(
100
- new Event("qti-assessment-section-connected", {
101
- bubbles: true,
102
- composed: true
103
- })
104
- );
105
- }
106
- render() {
107
- return html2`<slot name="qti-rubric-block"></slot><slot></slot>`;
108
- }
109
- };
110
- __decorateClass([
111
- property2({ type: String })
112
- ], QtiAssessmentSection.prototype, "identifier", 2);
113
- __decorateClass([
114
- property2({ type: String })
115
- ], QtiAssessmentSection.prototype, "required", 2);
116
- __decorateClass([
117
- property2({ type: Boolean, converter: stringToBooleanConverter2 })
118
- ], QtiAssessmentSection.prototype, "fixed", 2);
119
- __decorateClass([
120
- property2({ type: String })
121
- ], QtiAssessmentSection.prototype, "title", 2);
122
- __decorateClass([
123
- property2({ type: Boolean, converter: stringToBooleanConverter2 })
124
- ], QtiAssessmentSection.prototype, "visible", 2);
125
- __decorateClass([
126
- property2({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
127
- ], QtiAssessmentSection.prototype, "keepTogether", 2);
128
- __decorateClass([
129
- consume2({ context: testContext, subscribe: true })
130
- ], QtiAssessmentSection.prototype, "_testContext", 2);
131
- if (!customElements.get("qti-assessment-section")) {
132
- customElements.define("qti-assessment-section", QtiAssessmentSection);
133
- }
134
-
135
- // src/lib/qti-test/qti-assessment-test/qti-assessment-test.ts
136
- import { consume as consume3 } from "@lit/context";
137
- import { html as html3, LitElement as LitElement3 } from "lit";
138
- import { customElement, property as property3 } from "lit/decorators.js";
139
- var QtiAssessmentTest = class extends LitElement3 {
140
- async connectedCallback() {
141
- super.connectedCallback();
142
- await this.updateComplete;
143
- this.dispatchEvent(
144
- new CustomEvent("qti-assessment-test-connected", {
145
- detail: this,
146
- bubbles: true,
147
- composed: true
148
- })
149
- );
150
- }
151
- render() {
152
- return html3` <slot></slot>`;
153
- }
154
- };
155
- __decorateClass([
156
- property3({ type: String })
157
- ], QtiAssessmentTest.prototype, "identifier", 2);
158
- __decorateClass([
159
- property3({ type: String })
160
- ], QtiAssessmentTest.prototype, "title", 2);
161
- __decorateClass([
162
- consume3({ context: testContext, subscribe: true })
163
- ], QtiAssessmentTest.prototype, "_testContext", 2);
164
- QtiAssessmentTest = __decorateClass([
165
- customElement("qti-assessment-test")
166
- ], QtiAssessmentTest);
167
-
168
- // src/lib/qti-test/qti-assessment-test/qti-test-part.ts
169
- import { html as html4, LitElement as LitElement4 } from "lit";
170
- import { customElement as customElement2, property as property4 } from "lit/decorators.js";
171
- var QtiTestPart = class extends LitElement4 {
172
- constructor() {
173
- super(...arguments);
174
- this.identifier = "";
175
- this.title = "";
176
- this.class = "";
177
- this.NavigationMode = "nonlinear";
178
- this.submissionMode = "individual";
179
- }
180
- async connectedCallback() {
181
- super.connectedCallback();
182
- await this.updateComplete;
183
- this.dispatchEvent(
184
- new Event("qti-test-part-connected", {
185
- bubbles: true,
186
- composed: true
187
- })
188
- );
189
- }
190
- render() {
191
- return html4` <slot></slot>`;
192
- }
193
- };
194
- __decorateClass([
195
- property4({ type: String })
196
- ], QtiTestPart.prototype, "identifier", 2);
197
- __decorateClass([
198
- property4({ type: String })
199
- ], QtiTestPart.prototype, "title", 2);
200
- __decorateClass([
201
- property4({ type: String })
202
- ], QtiTestPart.prototype, "class", 2);
203
- __decorateClass([
204
- property4({ type: String, attribute: "navigation-mode" })
205
- ], QtiTestPart.prototype, "NavigationMode", 2);
206
- __decorateClass([
207
- property4({ type: String, attribute: "submission-mode" })
208
- ], QtiTestPart.prototype, "submissionMode", 2);
209
- QtiTestPart = __decorateClass([
210
- customElement2("qti-test-part")
211
- ], QtiTestPart);
212
- if (!customElements.get("qti-test-part")) {
213
- customElements.define("qti-test-part", QtiTestPart);
214
- }
215
-
216
- // src/lib/qti-test/qti-test.ts
217
- import { html as html5 } from "lit";
218
- import { customElement as customElement3 } from "lit/decorators.js";
219
-
220
- // src/lib/qti-transformers/qti-transformers.ts
221
- var xml = String.raw;
222
- var xmlToHTML = xml`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
223
- <xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
224
- <xsl:template match="@*|node()">
225
- <xsl:copy>
226
- <xsl:apply-templates select="@*|node()"/>
227
- </xsl:copy>
228
- </xsl:template>
229
-
230
- <!-- remove existing namespaces -->
231
- <xsl:template match="*">
232
- <!-- remove element prefix -->
233
- <xsl:element name="{local-name()}">
234
- <!-- process attributes -->
235
- <xsl:for-each select="@*">
236
- <!-- remove attribute prefix -->
237
- <xsl:attribute name="{local-name()}">
238
- <xsl:value-of select="."/>
239
- </xsl:attribute>
240
- </xsl:for-each>
241
- <xsl:apply-templates/>
242
- </xsl:element>
243
- </xsl:template>
244
- </xsl:stylesheet>`;
245
- function extendElementName(xmlFragment, tagName, extension) {
246
- xmlFragment.querySelectorAll(tagName).forEach((element) => {
247
- const newTagName = `${tagName}-${extension}`;
248
- const newElement = createElementWithNewTagName(element, newTagName);
249
- element.replaceWith(newElement);
250
- });
251
- }
252
- function extendElementsWithClass(xmlFragment, classNamePattern) {
253
- xmlFragment.querySelectorAll("*").forEach((element) => {
254
- const classList = element.classList;
255
- if (classList) {
256
- classList.forEach((className) => {
257
- if (className.startsWith(`${classNamePattern}:`)) {
258
- const suffix = className.slice(`${classNamePattern}:`.length);
259
- const newTagName = `${element.nodeName}-${suffix}`;
260
- const newElement = createElementWithNewTagName(element, newTagName);
261
- element.replaceWith(newElement);
262
- }
263
- });
264
- }
265
- });
266
- }
267
- function createElementWithNewTagName(element, newTagName) {
268
- const newElement = document.createElement(newTagName);
269
- for (const attr of element.attributes) {
270
- newElement.setAttribute(attr.name, attr.value);
271
- }
272
- while (element.firstChild) {
273
- newElement.appendChild(element.firstChild);
274
- }
275
- return newElement;
276
- }
277
- function itemsFromTest(xmlFragment) {
278
- const items = [];
279
- xmlFragment.querySelectorAll("qti-assessment-item-ref").forEach((el) => {
280
- const identifier = el.getAttribute("identifier");
281
- const href = el.getAttribute("href");
282
- const category = el.getAttribute("category");
283
- items.push({ identifier, href, category });
284
- });
285
- return items;
286
- }
287
- var currentRequest = null;
288
- function loadXML(url, cancelPreviousRequest = false) {
289
- if (cancelPreviousRequest && currentRequest !== null) {
290
- currentRequest.abort();
291
- }
292
- return new Promise((resolve, reject) => {
293
- const xhr = new XMLHttpRequest();
294
- currentRequest = xhr;
295
- xhr.open("GET", url, true);
296
- xhr.responseType = "document";
297
- xhr.onload = () => {
298
- if (xhr.status >= 200 && xhr.status < 300) {
299
- resolve(xhr.responseXML);
300
- } else {
301
- reject(xhr.statusText);
302
- }
303
- };
304
- xhr.onerror = () => {
305
- reject(xhr.statusText);
306
- };
307
- xhr.send();
308
- });
309
- }
310
- function parseXML(xmlDocument) {
311
- const parser = new DOMParser();
312
- const xmlFragment = parser.parseFromString(xmlDocument, "text/xml");
313
- return xmlFragment;
314
- }
315
- function toHTML(xmlFragment) {
316
- const processor = new XSLTProcessor();
317
- const xsltDocument = new DOMParser().parseFromString(xmlToHTML, "text/xml");
318
- processor.importStylesheet(xsltDocument);
319
- const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);
320
- return itemHTMLFragment;
321
- }
322
- function setLocation(xmlFragment, location) {
323
- if (!location.endsWith("/")) {
324
- location += "/";
325
- }
326
- xmlFragment.querySelectorAll("[src],[href],[primary-path]").forEach((elWithSrc) => {
327
- let attr = "";
328
- if (elWithSrc.getAttribute("src")) {
329
- attr = "src";
330
- }
331
- if (elWithSrc.getAttribute("href")) {
332
- attr = "href";
333
- }
334
- if (elWithSrc.getAttribute("primary-path")) {
335
- attr = "primary-path";
336
- }
337
- const attrValue = elWithSrc.getAttribute(attr)?.trim();
338
- if (!attrValue.startsWith("data:") && !attrValue.startsWith("http")) {
339
- const newSrcValue = location + encodeURI(attrValue);
340
- elWithSrc.setAttribute(attr, newSrcValue);
341
- }
342
- });
343
- }
344
- function convertCDATAtoComment(xmlFragment) {
345
- const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value');
346
- cdataElements.forEach((element) => {
347
- const commentText = document.createComment(element.textContent);
348
- element.replaceChild(commentText, element.firstChild);
349
- });
350
- }
351
- function stripStyleSheets(xmlFragment) {
352
- xmlFragment.querySelectorAll("qti-stylesheet").forEach((stylesheet) => stylesheet.remove());
353
- }
354
-
355
- // src/lib/qti-transformers/qti-transform-item.ts
356
- var qtiTransformItem = () => {
357
- let xmlFragment;
358
- const api = {
359
- async load(uri, cancelPreviousRequest = false) {
360
- return new Promise((resolve) => {
361
- loadXML(uri, cancelPreviousRequest).then((xml2) => {
362
- xmlFragment = xml2;
363
- api.path(uri.substring(0, uri.lastIndexOf("/")));
364
- return resolve(api);
365
- });
366
- });
367
- },
368
- parse(xmlString) {
369
- xmlFragment = parseXML(xmlString);
370
- return api;
371
- },
372
- path: (location) => {
373
- setLocation(xmlFragment, location);
374
- return api;
375
- },
376
- fn(fn) {
377
- fn(xmlFragment);
378
- return api;
379
- },
380
- pciHooks(uri) {
381
- const attributes = ["hook", "module"];
382
- const documentPath = uri.substring(0, uri.lastIndexOf("/"));
383
- for (const attribute of attributes) {
384
- const srcAttributes = xmlFragment.querySelectorAll("[" + attribute + "]");
385
- srcAttributes.forEach((node) => {
386
- const srcValue = node.getAttribute(attribute);
387
- if (!srcValue.startsWith("data:") && !srcValue.startsWith("http")) {
388
- node.setAttribute("base-url", uri);
389
- node.setAttribute(
390
- "module",
391
- documentPath + "/" + encodeURI(srcValue + (srcValue.endsWith(".js") ? "" : ".js"))
392
- );
393
- }
394
- });
395
- }
396
- return api;
397
- },
398
- extendElementName: (tagName, extension) => {
399
- extendElementName(xmlFragment, tagName, extension);
400
- return api;
401
- },
402
- extendElementsWithClass: (param = "extend") => {
403
- extendElementsWithClass(xmlFragment, param);
404
- return api;
405
- },
406
- customInteraction(baseRef, baseItem) {
407
- const qtiCustomInteraction = xmlFragment.querySelector("qti-custom-interaction");
408
- const qtiCustomInteractionObject = qtiCustomInteraction.querySelector("object");
409
- qtiCustomInteraction.setAttribute("data-base-ref", baseRef);
410
- qtiCustomInteraction.setAttribute("data-base-item", baseRef + baseItem);
411
- qtiCustomInteraction.setAttribute("data", qtiCustomInteractionObject.getAttribute("data"));
412
- qtiCustomInteraction.setAttribute("width", qtiCustomInteractionObject.getAttribute("width"));
413
- qtiCustomInteraction.setAttribute("height", qtiCustomInteractionObject.getAttribute("height"));
414
- qtiCustomInteraction.removeChild(qtiCustomInteractionObject);
415
- return api;
416
- },
417
- convertCDATAtoComment() {
418
- convertCDATAtoComment(xmlFragment);
419
- return api;
420
- },
421
- stripStyleSheets() {
422
- stripStyleSheets(xmlFragment);
423
- return api;
424
- },
425
- html() {
426
- return new XMLSerializer().serializeToString(toHTML(xmlFragment));
427
- },
428
- xml() {
429
- return new XMLSerializer().serializeToString(xmlFragment);
430
- },
431
- htmlDoc() {
432
- return toHTML(xmlFragment);
433
- },
434
- xmlDoc() {
435
- return xmlFragment;
436
- }
437
- };
438
- return api;
439
- };
440
-
441
- // src/lib/qti-transformers/qti-transform-test.ts
442
- var qtiTransformTest = () => {
443
- let xmlFragment;
444
- const api = {
445
- async load(uri) {
446
- return new Promise((resolve, _) => {
447
- loadXML(uri).then((xml2) => {
448
- xmlFragment = xml2;
449
- return resolve(api);
450
- });
451
- });
452
- },
453
- parse(xmlString) {
454
- xmlFragment = parseXML(xmlString);
455
- return api;
456
- },
457
- fn(fn) {
458
- fn(xmlFragment);
459
- return api;
460
- },
461
- items() {
462
- return itemsFromTest(xmlFragment);
463
- },
464
- html() {
465
- return new XMLSerializer().serializeToString(toHTML(xmlFragment));
466
- },
467
- xml() {
468
- return new XMLSerializer().serializeToString(xmlFragment);
469
- },
470
- htmlDoc() {
471
- return toHTML(xmlFragment);
472
- },
473
- xmlDoc() {
474
- return xmlFragment;
475
- }
476
- };
477
- return api;
478
- };
479
-
480
- // src/lib/qti-test/mixins/test-loader.mixin.ts
481
- var TestLoaderMixin = (superClass) => {
482
- class TestLoaderClass extends superClass {
483
- constructor(...args) {
484
- super(...args);
485
- this.testURL = "";
486
- this.addEventListener("qti-load-test-request", (e) => {
487
- const { testURL } = e.detail;
488
- if (!testURL) {
489
- console.warn(
490
- "No test found, there should be an aattribute test-url with the path to the test on the test-container"
491
- );
492
- } else {
493
- this.testURL = testURL;
494
- }
495
- e.detail.promise = (async () => {
496
- e.preventDefault();
497
- const api = await qtiTransformTest().load(`${this.testURL}`);
498
- return api.htmlDoc();
499
- })();
500
- });
501
- this.addEventListener("qti-assessment-test-connected", () => {
502
- });
503
- this.addEventListener("qti-load-item-request", ({ detail }) => {
504
- if (!this.testURL) return;
505
- detail.promise = (async () => {
506
- const api = await qtiTransformItem().load(
507
- `${this.testURL.slice(0, this.testURL.lastIndexOf("/"))}/${detail.href}`,
508
- detail.cancelPreviousRequest
509
- );
510
- return api.htmlDoc();
511
- })();
512
- });
513
- this.addEventListener("qti-interaction-changed", (e) => {
514
- });
515
- this.addEventListener("qti-outcome-changed", () => {
516
- });
517
- }
518
- }
519
- return TestLoaderClass;
520
- };
521
-
522
- // src/lib/qti-test/mixins/test-navigation.mixin.ts
523
- var TestNavigationMixin = (superClass) => {
524
- class TestNavigationClass extends superClass {
525
- constructor(...args) {
526
- super(...args);
527
- this.addEventListener("qti-request-test-item", ({ detail: navItemId }) => {
528
- if (!navItemId) return;
529
- this._clearLoadedItems();
530
- const itemRefEl = this.testElement.el.querySelector(`qti-assessment-item-ref[identifier="${navItemId}"]`);
531
- const promise = this._loadItemRequest(itemRefEl.href, true);
532
- const navPartId = itemRefEl.closest("qti-test-part").identifier;
533
- const navSectionId = itemRefEl.closest("qti-assessment-section").identifier;
534
- this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId, navItemLoading: true };
535
- if (promise) {
536
- promise.then((doc) => {
537
- itemRefEl.xmlDoc = doc;
538
- requestAnimationFrame(() => this.dispatchEvent(new CustomEvent("qti-item-connected", { bubbles: true, composed: true })));
539
- this._testContext = { ...this._testContext, navItemLoading: false };
540
- }).catch((error) => console.error("Failed to load item:", error));
541
- } else {
542
- console.info("Load item request was not handled:", itemRefEl.href);
543
- }
544
- });
545
- this.addEventListener("qti-assessment-test-connected", () => {
546
- let navItemId = this._testContext.navItemId;
547
- if (!navItemId) {
548
- const itemRefEl = this.testElement.el.querySelector("qti-assessment-item-ref");
549
- navItemId = itemRefEl.identifier;
550
- }
551
- this.dispatchEvent(new CustomEvent("qti-request-test-item", { detail: navItemId, bubbles: true, composed: true }));
552
- });
553
- }
554
- _clearLoadedItems() {
555
- const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);
556
- Array.from(itemRefEls).forEach((itemElement) => {
557
- itemElement.xmlDoc = null;
558
- });
559
- }
560
- _loadItemRequest(href, cancelPreviousRequest = true) {
561
- const event = new CustomEvent("qti-load-item-request", {
562
- bubbles: true,
563
- composed: true,
564
- detail: {
565
- href,
566
- promise: null,
567
- cancelPreviousRequest
568
- }
569
- });
570
- this.dispatchEvent(event);
571
- return event.detail.promise;
572
- }
573
- }
574
- return TestNavigationClass;
575
- };
576
-
577
- // src/lib/qti-test/mixins/test-view.mixin.ts
578
- var TestViewMixin = (superClass) => {
579
- class TestViewClass extends superClass {
580
- constructor(...args) {
581
- super(...args);
582
- this._testContext = { ...this._testContext, view: "candidate" };
583
- this.addEventListener("on-test-switch-view", (e) => {
584
- this._testContext = { ...this._testContext, view: e.detail };
585
- this._updateElementView();
586
- });
587
- this.addEventListener("qti-assessment-test-connected", () => {
588
- this._updateElementView();
589
- });
590
- this.addEventListener("qti-assessment-item-connected", (e) => {
591
- this._updateElementView();
592
- this._setCorrectResponseVisibility(e.detail);
593
- });
594
- }
595
- willUpdate(changedProperties) {
596
- super.willUpdate(changedProperties);
597
- if (changedProperties.has("_testContext")) {
598
- this._updateElementView();
599
- }
600
- }
601
- // Method to handle view updates for elements based on the current context view
602
- _updateElementView() {
603
- if (this.testElement && this.testElement.el) {
604
- const viewElements = Array.from(this.testElement.el.querySelectorAll("[view]"));
605
- viewElements.forEach((element) => {
606
- element.classList.toggle("show", element.getAttribute("view") === this._testContext.view);
607
- });
608
- const assessmentItem = this.testElement.el.querySelector(
609
- `qti-assessment-item[identifier="${this._testContext.navItemId}"]`
610
- );
611
- if (assessmentItem) {
612
- assessmentItem.showCorrectResponse(this._testContext.view === "scorer");
613
- }
614
- }
615
- }
616
- // Event handler for connected QTI assessment items
617
- _setCorrectResponseVisibility(assessmentItem) {
618
- assessmentItem.showCorrectResponse(this._testContext.view === "scorer");
619
- }
620
- }
621
- return TestViewClass;
622
- };
623
-
624
- // src/lib/qti-test/test-base.ts
625
- import { provide } from "@lit/context";
626
- import { LitElement as LitElement5 } from "lit";
627
- import { state } from "lit/decorators.js";
628
- var TestBase = class extends LitElement5 {
629
- constructor() {
630
- super();
631
- this._testContext = { items: [], testOutcomeVariables: [] };
632
- this.testElement = { el: null };
633
- /**
634
- * Updates the variables of an assessment item in the test context.
635
- * - Matches the assessment item with the corresponding test context item.
636
- * - If the item is not found, logs a warning.
637
- * - Updates variables in the test context if exactly one variable exists.
638
- * - Otherwise, syncs the assessment item's variables with the test context.
639
- *
640
- * @param assessmentItem - The assessment item to update.
641
- */
642
- this._updateItemInTestContext = (assessmentItem) => {
643
- const { identifier, variables } = assessmentItem;
644
- const itemContext = this._testContext.items.find((i) => i?.identifier === identifier);
645
- if (!itemContext) {
646
- console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);
647
- return;
648
- }
649
- if (itemContext.variables?.length === 1) {
650
- this._updateItemVariablesInTestContext(identifier, variables);
651
- } else {
652
- assessmentItem.variables = [...itemContext.variables || []];
653
- }
654
- };
655
- this.addEventListener("qti-assessment-test-connected", (e) => {
656
- const qtiAssessmentTest = e.detail;
657
- const items = Array.from(qtiAssessmentTest.querySelectorAll("qti-assessment-item-ref")).map(
658
- (itemRef) => ({
659
- href: itemRef.href,
660
- identifier: itemRef.identifier,
661
- category: itemRef.category,
662
- variables: [{ identifier: "completionStatus", value: "not_attempted", type: "outcome" }]
663
- })
664
- );
665
- this.testElement = { el: qtiAssessmentTest };
666
- this._testContext = { ...this._testContext, items };
667
- });
668
- this.addEventListener("qti-assessment-item-connected", (e) => {
669
- this._updateItemInTestContext(e.detail);
670
- });
671
- this.addEventListener("qti-outcome-changed", (e) => {
672
- const assessmentitem = e.composedPath()[0];
673
- this._updateItemVariablesInTestContext(assessmentitem.identifier, assessmentitem.variables);
674
- });
675
- }
676
- get context() {
677
- return this._testContext;
678
- }
679
- // /* restores the context by updating existing items and adding new items from the "contextToRestore" parameter into the "this._context.items" array. */
680
- set context(testContext2) {
681
- if (testContext2 === null || testContext2 === void 0) return;
682
- this._testContext = { ...testContext2 };
683
- testContext2.items?.forEach((itemContext) => {
684
- const existingItemContext = this._testContext.items.find((i) => i.identifier === itemContext.identifier);
685
- if (existingItemContext) {
686
- existingItemContext.variables = itemContext.variables;
687
- } else {
688
- this._testContext.items.push(itemContext);
689
- }
690
- });
691
- }
692
- _updateItemVariablesInTestContext(identifier, variables) {
693
- this._testContext = {
694
- ...this._testContext,
695
- // Spread existing test context properties
696
- items: this._testContext.items.map((itemContext) => {
697
- if (itemContext.identifier !== identifier) {
698
- return itemContext;
699
- }
700
- return {
701
- ...itemContext,
702
- // Keep other properties of the item context
703
- variables: variables.map((variable) => {
704
- const matchingVariable = itemContext.variables.find((v) => v.identifier === variable.identifier);
705
- return matchingVariable ? { ...matchingVariable, ...variable } : variable;
706
- })
707
- };
708
- })
709
- };
710
- }
711
- // private _addItemToTestContext(
712
- // e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }
713
- // ): void {
714
- // const { href, identifier, category } = e.detail;
715
- // // Update test context items, adding a new item if the identifier is not already in the list
716
- // if (!this._testContext.items.some(item => item.identifier === identifier)) {
717
- // this._testContext.items.push({
718
- // href,
719
- // identifier,
720
- // category,
721
- // variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]
722
- // // category: e.target.category
723
- // });
724
- // }
725
- // }
726
- connectedCallback() {
727
- super.connectedCallback();
728
- this.setAttribute("qti-test", "");
729
- }
730
- };
731
- __decorateClass([
732
- state(),
733
- provide({ context: testContext })
734
- ], TestBase.prototype, "_testContext", 2);
735
- __decorateClass([
736
- state(),
737
- provide({ context: testElement })
738
- ], TestBase.prototype, "testElement", 2);
739
-
740
- // src/lib/qti-test/qti-test.ts
741
- var QtiTest = class extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {
742
- /**
743
- * Lifecycle callback invoked when the element is added to the DOM.
744
- * Automatically appends the content of a `<template>` element (if present)
745
- * to the shadow DOM.
746
- */
747
- connectedCallback() {
748
- super.connectedCallback();
749
- const template = this.querySelector(":scope > template");
750
- if (template) {
751
- this.shadowRoot?.appendChild(template.content);
752
- }
753
- }
754
- /**
755
- * Renders the component's template.
756
- * Provides a default `<slot>` for content projection.
757
- */
758
- render() {
759
- return html5`<slot></slot>`;
760
- }
761
- };
762
- QtiTest = __decorateClass([
763
- customElement3("qti-test")
764
- ], QtiTest);
765
-
766
- // src/lib/qti-test/components/test-next.ts
767
- import { css as css2, html as html6 } from "lit";
768
- import { customElement as customElement4 } from "lit/decorators.js";
769
-
770
- // src/lib/qti-test/components/styles.ts
771
- import { css } from "lit";
772
- var form = css`
773
- display: inline-flex;
774
- align-items: center;
775
- cursor: pointer;
776
- padding: 0.5rem 1rem;
777
- border-radius: 0.25rem;
778
- user-select: none;
779
- `;
780
- var btn = css`
781
- background-color: lightgray;
782
- ${form};
783
- `;
784
- var dis = css`
785
- cursor: not-allowed;
786
- opacity: 0.5;
787
- `;
788
- var ind = css`
789
- ${form};
790
- border: 1px solid gray;
791
- `;
792
-
793
- // src/lib/qti-test/components/test-component.abstract.ts
794
- import { consume as consume4 } from "@lit/context";
795
- import { LitElement as LitElement6 } from "lit";
796
- import { state as state2 } from "lit/decorators.js";
797
-
798
- // src/lib/decorators/watch.ts
799
- function watch(propertyName, options) {
800
- const resolvedOptions = {
801
- waitUntilFirstUpdate: false,
802
- ...options
803
- };
804
- return (proto, decoratedFnName) => {
805
- const { update } = proto;
806
- const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];
807
- proto.update = function(changedProps) {
808
- watchedProperties.forEach((property10) => {
809
- const key = property10;
810
- if (changedProps.has(key)) {
811
- const oldValue = changedProps.get(key);
812
- const newValue = this[key];
813
- if (oldValue !== newValue) {
814
- if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {
815
- this[decoratedFnName](oldValue, newValue);
816
- }
817
- }
818
- }
819
- });
820
- update.call(this, changedProps);
821
- };
822
- };
823
- }
824
-
825
- // src/lib/decorators/prop-internal-state.ts
826
- import { property as property5 } from "lit/decorators.js";
827
- function propInternalState(options) {
828
- return (protoOrDescriptor, name) => {
829
- property5(options)(protoOrDescriptor, name);
830
- const key = `__${name}`;
831
- Object.defineProperty(protoOrDescriptor, name, {
832
- get() {
833
- return this[key];
834
- },
835
- set(value) {
836
- const oldValue = this[key];
837
- this[key] = value;
838
- if (oldValue !== value) {
839
- if (this._internals?.states) {
840
- const stateName = name.toLowerCase();
841
- if (value) {
842
- this._internals.states.add(`--${stateName}`);
843
- } else {
844
- this._internals.states.delete(`--${stateName}`);
845
- }
846
- }
847
- if (options.aria && this._internals) {
848
- const ariaAttribute = options.aria;
849
- if (value) {
850
- this._internals[ariaAttribute] = "true";
851
- } else {
852
- this._internals[ariaAttribute] = null;
853
- }
854
- }
855
- this.requestUpdate(name, oldValue);
856
- }
857
- },
858
- configurable: true,
859
- enumerable: true
860
- });
861
- };
862
- }
863
-
864
- // src/lib/qti-test/components/test-component.abstract.ts
865
- var TestComponent = class extends LitElement6 {
866
- constructor() {
867
- super();
868
- this.disabled = true;
869
- this._internals = this.attachInternals();
870
- }
871
- _handleTestElementChange(_oldValue, newValue) {
872
- if (newValue.el) {
873
- this.disabled = false;
874
- }
875
- }
876
- willUpdate(changedProperties) {
877
- if (changedProperties.has("_testContext")) {
878
- const { items = [], navItemId } = this._testContext ?? {};
879
- this.itemIndex = items.findIndex((item) => item.identifier === navItemId);
880
- this.items = items;
881
- this.view = this._testContext?.view;
882
- }
883
- }
884
- _switchView(view) {
885
- this.dispatchEvent(
886
- new CustomEvent("on-test-switch-view", {
887
- composed: true,
888
- bubbles: true,
889
- detail: view
890
- })
891
- );
892
- }
893
- _requestItem(identifier) {
894
- this.dispatchEvent(
895
- new CustomEvent("qti-request-test-item", {
896
- composed: true,
897
- bubbles: true,
898
- detail: identifier
899
- })
900
- );
901
- }
902
- };
903
- __decorateClass([
904
- propInternalState({
905
- type: Boolean,
906
- reflect: true,
907
- aria: "ariaDisabled"
908
- // Maps to `aria-disabled` attribute
909
- })
910
- ], TestComponent.prototype, "disabled", 2);
911
- __decorateClass([
912
- state2(),
913
- consume4({ context: testContext, subscribe: true })
914
- ], TestComponent.prototype, "_testContext", 2);
915
- __decorateClass([
916
- state2(),
917
- consume4({ context: testElement, subscribe: true })
918
- ], TestComponent.prototype, "_testElement", 2);
919
- __decorateClass([
920
- watch("_testElement")
921
- ], TestComponent.prototype, "_handleTestElementChange", 1);
922
-
923
- // src/lib/qti-test/components/test-next.ts
924
- var TestNext = class extends TestComponent {
925
- constructor() {
926
- super();
927
- this._internals.role = "button";
928
- this._internals.ariaLabel = "Next item";
929
- this.addEventListener("click", (e) => {
930
- e.preventDefault();
931
- if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);
932
- });
933
- }
934
- willUpdate(changedProperties) {
935
- super.willUpdate(changedProperties);
936
- if (changedProperties.has("_testContext")) {
937
- this.disabled = !this._testElement?.el || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;
938
- }
939
- }
940
- render() {
941
- return html6`<slot></slot>`;
942
- }
943
- };
944
- TestNext.styles = css2`
945
- :host {
946
- ${btn};
947
- }
948
- :host([disabled]) {
949
- ${dis};
950
- }
951
- `;
952
- TestNext = __decorateClass([
953
- customElement4("test-next")
954
- ], TestNext);
955
-
956
- // src/lib/qti-test/components/test-prev.ts
957
- import { css as css3, html as html7 } from "lit";
958
- import { customElement as customElement5 } from "lit/decorators.js";
959
- var TestPrev = class extends TestComponent {
960
- constructor() {
961
- super();
962
- this._internals.role = "button";
963
- this._internals.ariaLabel = "Next item";
964
- this.addEventListener("click", (e) => {
965
- e.preventDefault();
966
- if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);
967
- });
968
- }
969
- willUpdate(changedProperties) {
970
- super.willUpdate(changedProperties);
971
- if (changedProperties.has("_testContext")) {
972
- this.disabled = !this._testElement?.el || this.itemIndex === 0 || this.itemIndex === -1;
973
- }
974
- }
975
- render() {
976
- return html7`<slot></slot>`;
977
- }
978
- };
979
- TestPrev.styles = css3`
980
- :host {
981
- ${btn};
982
- }
983
- :host([disabled]) {
984
- ${dis};
985
- }
986
- `;
987
- TestPrev = __decorateClass([
988
- customElement5("test-prev")
989
- ], TestPrev);
990
-
991
- // src/lib/qti-test/components/test-view.ts
992
- import { html as html8 } from "lit";
993
- import { customElement as customElement6, property as property6 } from "lit/decorators.js";
994
- var TestView = class extends TestComponent {
995
- constructor() {
996
- super(...arguments);
997
- this.label = "view";
998
- this.viewOptions = "";
999
- this._handleViewOptionsChange = (_, viewOptions) => {
1000
- console.log(viewOptions);
1001
- };
1002
- this._viewOptions = TestView.DEFAULT_VIEW_OPTIONS;
1003
- }
1004
- // updated(changedProperties: PropertyValues) {
1005
- // super.updated(changedProperties);
1006
- // if (changedProperties.has('viewOptionsString')) {
1007
- // this._updateViewOptions();
1008
- // }
1009
- // }
1010
- // private _updateViewOptions() {
1011
- // if (this.viewOptionsString) {
1012
- // const options = this.viewOptionsString.split(',').map(opt => opt.trim());
1013
- // this.viewOptions = options.filter(opt => TestView.DEFAULT_VIEW_OPTIONS.includes(opt));
1014
- // } else {
1015
- // this.viewOptions = TestView.DEFAULT_VIEW_OPTIONS;
1016
- // }
1017
- // }
1018
- render() {
1019
- return html8`
1020
- <label part="label" for="viewSelect">${this.label}</label>
1021
- <select
1022
- part="select"
1023
- id="viewSelect"
1024
- .disabled=${this.disabled}
1025
- @change=${(e) => {
1026
- const el = e.target;
1027
- this._switchView(el.value);
1028
- }}
1029
- >
1030
- ${this._viewOptions.map((v) => html8`<option value="${v}" ?selected=${v === this.view}>${v}</option>`)}
1031
- </select>
1032
- `;
1033
- }
1034
- };
1035
- TestView.DEFAULT_VIEW_OPTIONS = ["author", "candidate", "proctor", "scorer", "testConstructor", "tutor"];
1036
- __decorateClass([
1037
- property6({ type: String })
1038
- ], TestView.prototype, "label", 2);
1039
- __decorateClass([
1040
- property6({ type: String, attribute: "view-options" })
1041
- ], TestView.prototype, "viewOptions", 2);
1042
- __decorateClass([
1043
- watch("viewOptions")
1044
- ], TestView.prototype, "_handleViewOptionsChange", 2);
1045
- TestView = __decorateClass([
1046
- customElement6("test-view")
1047
- ], TestView);
1048
-
1049
- // src/lib/qti-test/components/test-item-link.ts
1050
- import { html as html9 } from "lit";
1051
- import { customElement as customElement7, property as property7 } from "lit/decorators.js";
1052
- var TestItemLink = class extends TestComponent {
1053
- constructor() {
1054
- super();
1055
- this.itemId = null;
1056
- this.addEventListener("click", () => this._requestItem(this.itemId));
1057
- }
1058
- render() {
1059
- return html9` <slot></slot> `;
1060
- }
1061
- };
1062
- __decorateClass([
1063
- property7({ type: String, attribute: "item-id" })
1064
- ], TestItemLink.prototype, "itemId", 2);
1065
- TestItemLink = __decorateClass([
1066
- customElement7("test-item-link")
1067
- ], TestItemLink);
1068
-
1069
- // src/lib/qti-test/components/test-container.ts
1070
- import { LitElement as LitElement7, html as html10 } from "lit";
1071
- import { customElement as customElement8, property as property8, state as state3 } from "lit/decorators.js";
1072
- import { until } from "lit/directives/until.js";
1073
-
1074
- // inline:../../../item.css?inline
1075
- var item_default = `@layer qti-base, qti-components, qti-utilities, qti-variants, qti-extended;
1076
-
1077
- :root,
1078
- :host {
1079
- /* Active colors */
1080
- --qti-bg-active: #ffecec;
1081
- --qti-border-active: #f86d70;
1082
-
1083
- /* Gap size */
1084
- --qti-gap-size: 1rem;
1085
-
1086
- /* Background colors */
1087
- --qti-bg: white;
1088
- --qti-hover-bg: #f9fafb;
1089
-
1090
- /* Light theme colors */
1091
- --qti-light-bg-active: #f0f0f0; /* Light gray */
1092
- --qti-light-border-active: #d0d0d0; /* Medium gray */
1093
-
1094
- /* Dark theme colors */
1095
- --qti-dark-bg-active: #1f2937; /* Dark gray */
1096
- --qti-dark-border-active: #64748b; /* Medium gray */
1097
-
1098
- /* Disabled colors */
1099
- --qti-disabled-bg: #f3f4f6;
1100
- --qti-disabled-color: #45484f;
1101
-
1102
- /* Border properties */
1103
- --qti-border-thickness: 2px;
1104
- --qti-border-style: solid;
1105
- --qti-border-color: #c6cad0;
1106
- --qti-border-radius: 0.3rem;
1107
- --qti-drop-border-radius: calc(var(--qti-border-radius) + var(--qti-border-thickness));
1108
-
1109
- /* Focus & active states */
1110
- --qti-focus-border-width: 5px;
1111
- --qti-focus-color: #bddcff7e;
1112
-
1113
- /* Class-specific variables */
1114
-
1115
- /* Form elements */
1116
- --qti-form-size: 1rem;
1117
-
1118
- /* Point elements */
1119
- --qti-point-size: 2rem;
1120
-
1121
- /* Order buttons */
1122
- --qti-order-size: 2rem;
1123
-
1124
- /* Generic padding for all elements */
1125
- --qti-padding-vertical: 0.5rem; /* py-2 */
1126
- --qti-padding-horizontal: 0.5rem; /* px-2 */
1127
- }
1128
-
1129
- /* SVG masks and backgrounds */
1130
-
1131
- .chevron {
1132
- background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
1133
- no-repeat center right 6px;
1134
- }
1135
-
1136
- .handle {
1137
- background-image: radial-gradient(
1138
- circle at center,
1139
- rgb(0 0 0 / 10%) 0,
1140
- rgb(0 0 0 / 20%) 2px,
1141
- rgb(255 255 255 / 0%) 2px,
1142
- rgb(255 255 255 / 0%) 100%
1143
- );
1144
- background-repeat: repeat-y;
1145
- background-position: left center;
1146
- background-size: 14px 8px;
1147
- }
1148
-
1149
- .check-mask {
1150
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1151
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1152
- }
1153
-
1154
- /*
1155
- Following are classes that can be applied to elements and element states, so they are not used directly
1156
- The @apply directive is used to apply these classes to elements
1157
- */
1158
-
1159
- /* Apply .bordered to an element */
1160
-
1161
- .bordered {
1162
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1163
- outline: none;
1164
- }
1165
-
1166
- /* Apply .form rules for checkbox and radiobutton */
1167
-
1168
- .form {
1169
-
1170
- display: grid;
1171
- place-content: center;
1172
- width: var(--qti-form-size);
1173
- height: var(--qti-form-size);
1174
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1175
- outline: none;
1176
- }
1177
-
1178
- /* Apply .button rules for button-like elements, such as drags and buttons */
1179
-
1180
- .button {
1181
-
1182
- border-radius: var(--qti-border-radius);
1183
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
1184
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1185
- outline: none;
1186
- }
1187
-
1188
- /* Apply .select for the select dropdown element */
1189
-
1190
- .select {
1191
-
1192
- border-radius: var(--qti-border-radius);
1193
- position: relative;
1194
- -webkit-appearance: none;
1195
- -moz-appearance: none;
1196
- appearance: none;
1197
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
1198
- padding-right: calc(var(--qti-padding-horizontal) + 1.5rem); /* 1.5rem for the chevron */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
1199
- no-repeat center right 6px;
1200
- }
1201
-
1202
- /* Apply .text for the input text and textarea */
1203
-
1204
- .text {
1205
-
1206
- border-radius: 0;
1207
- cursor: text;
1208
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
1209
- background: unset;
1210
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1211
- outline: none;
1212
- }
1213
-
1214
- /* Apply .spot for hotspot shapes */
1215
-
1216
- .spot {
1217
-
1218
- width: 100%;
1219
- height: 100%;
1220
- background-color: transparent;
1221
- padding: 0;
1222
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1223
- outline: none;
1224
- }
1225
-
1226
- /* Apply .point for circular small hotspots */
1227
-
1228
- .point {
1229
-
1230
- border-radius: 100%;
1231
- width: var(--qti-point-size);
1232
- height: var(--qti-point-size);
1233
- background-color: transparent;
1234
- padding: 0;
1235
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1236
- outline: none;
1237
- }
1238
-
1239
- /* Apply .drag for draggable elements */
1240
-
1241
- .drag {
1242
-
1243
- transition:
1244
- transform 200ms ease-out,
1245
- box-shadow 200ms ease-out,
1246
- rotate 200ms ease-out;
1247
- cursor: grab;
1248
- background-color: var(--qti-bg);
1249
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
1250
- border-radius: var(--qti-border-radius);
1251
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem) !important; /* 1.5rem for the drag */ border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color); outline: none; background-image: radial-gradient(
1252
- circle at center,
1253
- rgb(0 0 0 / 10%) 0,
1254
- rgb(0 0 0 / 20%) 2px,
1255
- rgb(255 255 255 / 0%) 2px,
1256
- rgb(255 255 255 / 0%) 100%
1257
- ); background-repeat: repeat-y; background-position: left center; background-size: 14px 8px;
1258
- }
1259
-
1260
- /* Apply .dragging for the dragging state of a draggable element */
1261
-
1262
- .dragging {
1263
- pointer-events: none;
1264
- rotate: -2deg;
1265
- box-shadow:
1266
- 0 8px 12px rgb(0 0 0 / 20%),
1267
- 0 4px 8px rgb(0 0 0 / 10%);
1268
- }
1269
-
1270
- /* Apply .drop for an element where you can drop the draggable */
1271
-
1272
- .drop {
1273
-
1274
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
1275
- center no-repeat;
1276
- border-radius: var(--qti-border-radius);
1277
- position: relative;
1278
- background-color: var(--qti-bg);
1279
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1280
- outline: none;
1281
- }
1282
-
1283
- /* Apply .dropping for an indicator where you can drop the draggable */
1284
-
1285
- .dropping {
1286
- background-color: var(--qti-bg-active);
1287
- }
1288
-
1289
- /* Apply .order for a small circular button */
1290
-
1291
- .order {
1292
-
1293
- display: grid;
1294
- place-content: center;
1295
-
1296
- /* background-color: var(--qti-bg-active); */
1297
- border-radius: 100%;
1298
- width: var(--qti-order-size);
1299
- height: var(--qti-order-size);
1300
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1301
- outline: none;
1302
- }
1303
-
1304
- /* Apply .check-size for radio and checkbox size */
1305
-
1306
- .check-size {
1307
- width: calc(var(--qti-form-size) - 6px);
1308
- height: calc(var(--qti-form-size) - 6px);
1309
- }
1310
-
1311
- /* Apply .check for checkbox */
1312
-
1313
- .check {
1314
- gap: 0.5rem;
1315
- border-radius: var(--qti-border-radius);
1316
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
1317
- outline: none;
1318
- cursor: pointer;
1319
- }
1320
-
1321
- /* Apply .check-radio for outer circle of the radio buttons */
1322
-
1323
- .check-radio {
1324
-
1325
- border-radius: 100%;
1326
-
1327
- display: grid;
1328
-
1329
- place-content: center;
1330
-
1331
- width: var(--qti-form-size);
1332
-
1333
- height: var(--qti-form-size);
1334
-
1335
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1336
-
1337
- outline: none;
1338
- }
1339
-
1340
- /* Apply .check-radio-checked for the inner checked radio */
1341
-
1342
- .check-radio-checked {
1343
- background-color: var(--qti-border-active);
1344
- border-radius: 100%;
1345
- }
1346
-
1347
- /* Apply .check-checkbox for outer square of the checkbox */
1348
-
1349
- .check-checkbox {
1350
-
1351
- display: flex;
1352
- place-items: center;
1353
- border-radius: var(--qti-border-radius);
1354
- display: grid;
1355
- place-content: center;
1356
- width: var(--qti-form-size);
1357
- height: var(--qti-form-size);
1358
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
1359
- outline: none;
1360
- }
1361
-
1362
- /* Apply .check-checkbox-checked for the inner checkmark */
1363
-
1364
- .check-checkbox-checked {
1365
- background-color: var(--qti-border-active);
1366
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1367
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
1368
- }
1369
-
1370
- /* Apply .hov for hover state */
1371
-
1372
- .hov {
1373
- background-color: var(--qti-hover-bg);
1374
- }
1375
-
1376
- /* Apply .foc for focus state */
1377
-
1378
- .foc {
1379
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
1380
- }
1381
-
1382
- /* Apply .act for active state */
1383
-
1384
- .act {
1385
- border-color: var(--qti-border-active);
1386
- background-color: var(--qti-bg-active);
1387
- }
1388
-
1389
- .act-bg {
1390
- background-color: var(--qti-bg-active);
1391
- }
1392
-
1393
- .act-bor {
1394
- border-color: var(--qti-border-active);
1395
- }
1396
-
1397
- /* Apply .rdo for readonly state */
1398
-
1399
- .rdo {
1400
- cursor: pointer;
1401
- background-color: var(--qti-bg);
1402
- outline: 0;
1403
- border: none;
1404
- }
1405
-
1406
- /* Apply .dis for disabled state */
1407
-
1408
- .dis {
1409
- cursor: not-allowed;
1410
- background-color: var(--qti-disabled-bg);
1411
- color: var(--qti-disabled-color);
1412
- border-color: var(--qti-border-color);
1413
- outline: 4px solid var(--qti-disabled-bg);
1414
- }
1415
-
1416
- /* base */
1417
-
1418
- /* ============================
1419
- QTI 3 shared css
1420
- 1. Display
1421
- 2. Special Flex styles
1422
- 3. Margin
1423
- 4. Padding
1424
- 5. Horizontal Alignment styles
1425
- 6. Vertical Alignment styles
1426
- 7. Height
1427
- 8. Width
1428
- 9. Text-Indent
1429
- 10. List Style
1430
- 11. Layout
1431
- 12. Other QTI 3 presentation utilities
1432
- ============================ */
1433
-
1434
- /* ==========
1435
- Display css
1436
- =========== */
1437
-
1438
- .qti-display-inline {
1439
- display: inline;
1440
- }
1441
-
1442
- .qti-display-inline-block {
1443
- display: inline-block;
1444
- }
1445
-
1446
- .qti-display-block {
1447
- display: block;
1448
- }
1449
-
1450
- .qti-display-flex {
1451
- display: flexbox;
1452
- display: flex;
1453
- }
1454
-
1455
- .qti-display-inline-flex {
1456
- display: inline-flex;
1457
- }
1458
-
1459
- .qti-display-grid {
1460
- display: grid;
1461
- }
1462
-
1463
- .qti-display-inline-grid {
1464
- display: inline-grid;
1465
- }
1466
-
1467
- .qti-display-table {
1468
- display: table;
1469
- }
1470
-
1471
- .qti-display-table-cell {
1472
- display: table-cell;
1473
- }
1474
-
1475
- .qti-display-table-row {
1476
- display: table-row;
1477
- }
1478
-
1479
- .qti-display-list-item {
1480
- display: list-item;
1481
- }
1482
-
1483
- .qti-display-inherit {
1484
- display: inherit;
1485
- }
1486
-
1487
- /*
1488
- * hidden to screen readers and sighted
1489
- */
1490
-
1491
- .qti-hidden {
1492
- display: none;
1493
- }
1494
-
1495
- /*
1496
- * visible to screen readers, hidden to sighted
1497
- */
1498
-
1499
- .qti-visually-hidden {
1500
- position: fixed !important;
1501
- overflow: hidden;
1502
- clip: rect(1px 1px 1px 1px);
1503
- height: 1px;
1504
- width: 1px;
1505
- border: 0;
1506
- margin: -1px;
1507
- }
1508
-
1509
- /* =============================
1510
- Special flex styles
1511
- ============================= */
1512
-
1513
- .qti-flex-direction-column {
1514
- flex-direction: column;
1515
- }
1516
-
1517
- .qti-flex-direction-row {
1518
- flex-direction: row;
1519
- }
1520
-
1521
- .qti-flex-grow-1 {
1522
- flex-grow: 1;
1523
- }
1524
-
1525
- .qti-flex-grow-0 {
1526
- flex-grow: 0;
1527
- }
1528
-
1529
- /* =========
1530
- Margin css
1531
- ========== */
1532
-
1533
- /**
1534
- * For margin Top and Bottom and Left and Right
1535
- */
1536
-
1537
- .qti-margin-0 {
1538
- margin: 0 !important;
1539
- }
1540
-
1541
- .qti-margin-1 {
1542
- margin: 0.25rem !important;
1543
- }
1544
-
1545
- .qti-margin-2 {
1546
- margin: 0.5rem !important;
1547
- }
1548
-
1549
- .qti-margin-3 {
1550
- margin: 1rem !important;
1551
- }
1552
-
1553
- .qti-margin-4 {
1554
- margin: 1.5rem !important;
1555
- }
1556
-
1557
- .qti-margin-5 {
1558
- margin: 3rem !important;
1559
- }
1560
-
1561
- .qti-margin-auto {
1562
- margin: auto !important;
1563
- }
1564
-
1565
- /*
1566
- For margin Left and Right
1567
- */
1568
-
1569
- .qti-margin-x-0 {
1570
- margin-right: 0 !important;
1571
- margin-left: 0 !important;
1572
- }
1573
-
1574
- .qti-margin-x-1 {
1575
- margin-right: 0.25rem !important;
1576
- margin-left: 0.25rem !important;
1577
- }
1578
-
1579
- .qti-margin-x-2 {
1580
- margin-right: 0.5rem !important;
1581
- margin-left: 0.5rem !important;
1582
- }
1583
-
1584
- .qti-margin-x-3 {
1585
- margin-right: 1rem !important;
1586
- margin-left: 1rem !important;
1587
- }
1588
-
1589
- .qti-margin-x-4 {
1590
- margin-right: 1.5rem !important;
1591
- margin-left: 1.5rem !important;
1592
- }
1593
-
1594
- .qti-margin-x-5 {
1595
- margin-right: 3rem !important;
1596
- margin-left: 3rem !important;
1597
- }
1598
-
1599
- .qti-margin-x-auto {
1600
- margin-right: auto !important;
1601
- margin-left: auto !important;
1602
- }
1603
-
1604
- /*
1605
- For margin Top and Bottom
1606
- */
1607
-
1608
- .qti-margin-y-0 {
1609
- margin-top: 0 !important;
1610
- margin-bottom: 0 !important;
1611
- }
1612
-
1613
- .qti-margin-y-1 {
1614
- margin-top: 0.25rem !important;
1615
- margin-bottom: 0.25rem !important;
1616
- }
1617
-
1618
- .qti-margin-y-2 {
1619
- margin-top: 0.5rem !important;
1620
- margin-bottom: 0.5rem !important;
1621
- }
1622
-
1623
- .qti-margin-y-3 {
1624
- margin-top: 1rem !important;
1625
- margin-bottom: 1rem !important;
1626
- }
1627
-
1628
- .qti-margin-y-4 {
1629
- margin-top: 1.5rem !important;
1630
- margin-bottom: 1.5rem !important;
1631
- }
1632
-
1633
- .qti-margin-y-5 {
1634
- margin-top: 3rem !important;
1635
- margin-bottom: 3rem !important;
1636
- }
1637
-
1638
- .qti-margin-y-auto {
1639
- margin-top: auto !important;
1640
- margin-bottom: auto !important;
1641
- }
1642
-
1643
- /*
1644
- For margin Top
1645
- */
1646
-
1647
- .qti-margin-t-0 {
1648
- margin-top: 0 !important;
1649
- }
1650
-
1651
- .qti-margin-t-1 {
1652
- margin-top: 0.25rem !important;
1653
- }
1654
-
1655
- .qti-margin-t-2 {
1656
- margin-top: 0.5rem !important;
1657
- }
1658
-
1659
- .qti-margin-t-3 {
1660
- margin-top: 1rem !important;
1661
- }
1662
-
1663
- .qti-margin-t-4 {
1664
- margin-top: 1.5rem !important;
1665
- }
1666
-
1667
- .qti-margin-t-5 {
1668
- margin-top: 3rem !important;
1669
- }
1670
-
1671
- .qti-margin-t-auto {
1672
- margin-top: auto !important;
1673
- }
1674
-
1675
- /*
1676
- For margin Bottom
1677
- */
1678
-
1679
- .qti-margin-b-0 {
1680
- margin-bottom: 0 !important;
1681
- }
1682
-
1683
- .qti-margin-b-1 {
1684
- margin-bottom: 0.25rem !important;
1685
- }
1686
-
1687
- .qti-margin-b-2 {
1688
- margin-bottom: 0.5rem !important;
1689
- }
1690
-
1691
- .qti-margin-b-3 {
1692
- margin-bottom: 1rem !important;
1693
- }
1694
-
1695
- .qti-margin-b-4 {
1696
- margin-bottom: 1.5rem !important;
1697
- }
1698
-
1699
- .qti-margin-b-5 {
1700
- margin-bottom: 3rem !important;
1701
- }
1702
-
1703
- .qti-margin-b-auto {
1704
- margin-bottom: auto !important;
1705
- }
1706
-
1707
- /*
1708
- For margin Start LTR
1709
- */
1710
-
1711
- .qti-margin-s-0 {
1712
- margin-left: 0 !important;
1713
- }
1714
-
1715
- .qti-margin-s-1 {
1716
- margin-left: 0.25rem !important;
1717
- }
1718
-
1719
- .qti-margin-s-2 {
1720
- margin-left: 0.5rem !important;
1721
- }
1722
-
1723
- .qti-margin-s-3 {
1724
- margin-left: 1rem !important;
1725
- }
1726
-
1727
- .qti-margin-s-4 {
1728
- margin-left: 1.5rem !important;
1729
- }
1730
-
1731
- .qti-margin-s-5 {
1732
- margin-left: 3rem !important;
1733
- }
1734
-
1735
- .qti-margin-s-auto {
1736
- margin-left: auto !important;
1737
- }
1738
-
1739
- /*
1740
- For margin End LTR
1741
- */
1742
-
1743
- .qti-margin-e-0 {
1744
- margin-right: 0 !important;
1745
- }
1746
-
1747
- .qti-margin-e-1 {
1748
- margin-right: 0.25rem !important;
1749
- }
1750
-
1751
- .qti-margin-e-2 {
1752
- margin-right: 0.5rem !important;
1753
- }
1754
-
1755
- .qti-margin-e-3 {
1756
- margin-right: 1rem !important;
1757
- }
1758
-
1759
- .qti-margin-e-4 {
1760
- margin-right: 1.5rem !important;
1761
- }
1762
-
1763
- .qti-margin-e-5 {
1764
- margin-right: 3rem !important;
1765
- }
1766
-
1767
- .qti-margin-e-auto {
1768
- margin-right: auto !important;
1769
- }
1770
-
1771
- /* =========
1772
- Padding css
1773
- ========== */
1774
-
1775
- /*
1776
- For padding Top and Bottom and Left and Right
1777
- */
1778
-
1779
- .qti-padding-0 {
1780
- padding: 0 !important;
1781
- }
1782
-
1783
- .qti-padding-1 {
1784
- padding: 0.25rem !important;
1785
- }
1786
-
1787
- .qti-padding-2 {
1788
- padding: 0.5rem !important;
1789
- }
1790
-
1791
- .qti-padding-3 {
1792
- padding: 1rem !important;
1793
- }
1794
-
1795
- .qti-padding-4 {
1796
- padding: 1.5rem !important;
1797
- }
1798
-
1799
- .qti-padding-5 {
1800
- padding: 3rem !important;
1801
- }
1802
-
1803
- /*
1804
- For padding Left and Right
1805
- */
1806
-
1807
- .qti-padding-x-0 {
1808
- padding-right: 0 !important;
1809
- padding-left: 0 !important;
1810
- }
1811
-
1812
- .qti-padding-x-1 {
1813
- padding-right: 0.25rem !important;
1814
- padding-left: 0.25rem !important;
1815
- }
1816
-
1817
- .qti-padding-x-2 {
1818
- padding-right: 0.5rem !important;
1819
- padding-left: 0.5rem !important;
1820
- }
1821
-
1822
- .qti-padding-x-3 {
1823
- padding-right: 1rem !important;
1824
- padding-left: 1rem !important;
1825
- }
1826
-
1827
- .qti-padding-x-4 {
1828
- padding-right: 1.5rem !important;
1829
- padding-left: 1.5rem !important;
1830
- }
1831
-
1832
- .qti-padding-x-5 {
1833
- padding-right: 3rem !important;
1834
- padding-left: 3rem !important;
1835
- }
1836
-
1837
- /*
1838
- For padding Top and Bottom
1839
- */
1840
-
1841
- .qti-padding-y-0 {
1842
- padding-top: 0 !important;
1843
- padding-bottom: 0 !important;
1844
- }
1845
-
1846
- .qti-padding-y-1 {
1847
- padding-top: 0.25rem !important;
1848
- padding-bottom: 0.25rem !important;
1849
- }
1850
-
1851
- .qti-padding-y-2 {
1852
- padding-top: 0.5rem !important;
1853
- padding-bottom: 0.5rem !important;
1854
- }
1855
-
1856
- .qti-padding-y-3 {
1857
- padding-top: 1rem !important;
1858
- padding-bottom: 1rem !important;
1859
- }
1860
-
1861
- .qti-padding-y-4 {
1862
- padding-top: 1.5rem !important;
1863
- padding-bottom: 1.5rem !important;
1864
- }
1865
-
1866
- .qti-padding-y-5 {
1867
- padding-top: 3rem !important;
1868
- padding-bottom: 3rem !important;
1869
- }
1870
-
1871
- /*
1872
- For padding Top
1873
- */
1874
-
1875
- .qti-padding-t-0 {
1876
- padding-top: 0 !important;
1877
- }
1878
-
1879
- .qti-padding-t-1 {
1880
- padding-top: 0.25rem !important;
1881
- }
1882
-
1883
- .qti-padding-t-2 {
1884
- padding-top: 0.5rem !important;
1885
- }
1886
-
1887
- .qti-padding-t-3 {
1888
- padding-top: 1rem !important;
1889
- }
1890
-
1891
- .qti-padding-t-4 {
1892
- padding-top: 1.5rem !important;
1893
- }
1894
-
1895
- .qti-padding-t-5 {
1896
- padding-top: 3rem !important;
1897
- }
1898
-
1899
- /*
1900
- For padding Bottom
1901
- */
1902
-
1903
- .qti-padding-b-0 {
1904
- padding-bottom: 0 !important;
1905
- }
1906
-
1907
- .qti-padding-b-1 {
1908
- padding-bottom: 0.25rem !important;
1909
- }
1910
-
1911
- .qti-padding-b-2 {
1912
- padding-bottom: 0.5rem !important;
1913
- }
1914
-
1915
- .qti-padding-b-3 {
1916
- padding-bottom: 1rem !important;
1917
- }
1918
-
1919
- .qti-padding-b-4 {
1920
- padding-bottom: 1.5rem !important;
1921
- }
1922
-
1923
- .qti-padding-b-5 {
1924
- padding-bottom: 3rem !important;
1925
- }
1926
-
1927
- /*
1928
- For padding Start LTR
1929
- */
1930
-
1931
- .qti-padding-s-0 {
1932
- padding-left: 0 !important;
1933
- }
1934
-
1935
- .qti-padding-s-1 {
1936
- padding-left: 0.25rem !important;
1937
- }
1938
-
1939
- .qti-padding-s-2 {
1940
- padding-left: 0.5rem !important;
1941
- }
1942
-
1943
- .qti-padding-s-3 {
1944
- padding-left: 1rem !important;
1945
- }
1946
-
1947
- .qti-padding-s-4 {
1948
- padding-left: 1.5rem !important;
1949
- }
1950
-
1951
- .qti-padding-s-5 {
1952
- padding-left: 3rem !important;
1953
- }
1954
-
1955
- /*
1956
- For padding End LTR
1957
- */
1958
-
1959
- .qti-padding-e-0 {
1960
- padding-right: 0 !important;
1961
- }
1962
-
1963
- .qti-padding-e-1 {
1964
- padding-right: 0.25rem !important;
1965
- }
1966
-
1967
- .qti-padding-e-2 {
1968
- padding-right: 0.5rem !important;
1969
- }
1970
-
1971
- .qti-padding-e-3 {
1972
- padding-right: 1rem !important;
1973
- }
1974
-
1975
- .qti-padding-e-4 {
1976
- padding-right: 1.5rem !important;
1977
- }
1978
-
1979
- .qti-padding-e-5 {
1980
- padding-right: 3rem !important;
1981
- }
1982
-
1983
- /* ====================
1984
- Horizontal alignment
1985
- ==================== */
1986
-
1987
- .qti-align-left {
1988
- text-align: left;
1989
- }
1990
-
1991
- .qti-align-center {
1992
- text-align: center;
1993
- }
1994
-
1995
- .qti-align-right {
1996
- text-align: right;
1997
- }
1998
-
1999
- /* ==================
2000
- Vertical alignment
2001
- ================== */
2002
-
2003
- .qti-valign-top {
2004
- vertical-align: top;
2005
- }
2006
-
2007
- .qti-valign-middle {
2008
- vertical-align: middle;
2009
- }
2010
-
2011
- .qti-valign-baseline {
2012
- vertical-align: baseline;
2013
- }
2014
-
2015
- .qti-valign-bottom {
2016
- vertical-align: bottom;
2017
- }
2018
-
2019
- /* =============
2020
- Height styles
2021
- ============= */
2022
-
2023
- .qti-height-0 {
2024
- height: 0;
2025
- }
2026
-
2027
- .qti-height-px {
2028
- height: 1px;
2029
- }
2030
-
2031
- .qti-height-0p5 {
2032
- height: 0.125rem;
2033
- }
2034
-
2035
- .qti-height-1 {
2036
- height: 0.25rem;
2037
- }
2038
-
2039
- .qti-height-1p5 {
2040
- height: 0.375rem;
2041
- }
2042
-
2043
- .qti-height-2 {
2044
- height: 0.5rem;
2045
- }
2046
-
2047
- .qti-height-2p5 {
2048
- height: 0.625rem;
2049
- }
2050
-
2051
- .qti-height-3 {
2052
- height: 0.75rem;
2053
- }
2054
-
2055
- .qti-height-3p5 {
2056
- height: 0.875rem;
2057
- }
2058
-
2059
- .qti-height-4 {
2060
- height: 1rem;
2061
- }
2062
-
2063
- .qti-height-5 {
2064
- height: 1.25rem;
2065
- }
2066
-
2067
- .qti-height-6 {
2068
- height: 1.5rem;
2069
- }
2070
-
2071
- .qti-height-7 {
2072
- height: 1.75rem;
2073
- }
2074
-
2075
- .qti-height-8 {
2076
- height: 2rem;
2077
- }
2078
-
2079
- .qti-height-9 {
2080
- height: 2.25rem;
2081
- }
2082
-
2083
- .qti-height-10 {
2084
- height: 2.5rem;
2085
- }
2086
-
2087
- .qti-height-11 {
2088
- height: 2.75rem;
2089
- }
2090
-
2091
- .qti-height-12 {
2092
- height: 3rem;
2093
- }
2094
-
2095
- .qti-height-14 {
2096
- height: 3.5rem;
2097
- }
2098
-
2099
- .qti-height-16 {
2100
- height: 4rem;
2101
- }
2102
-
2103
- .qti-height-20 {
2104
- height: 5rem;
2105
- }
2106
-
2107
- .qti-height-24 {
2108
- height: 6rem;
2109
- }
2110
-
2111
- .qti-height-28 {
2112
- height: 7rem;
2113
- }
2114
-
2115
- .qti-height-32 {
2116
- height: 8rem;
2117
- }
2118
-
2119
- .qti-height-36 {
2120
- height: 9rem;
2121
- }
2122
-
2123
- .qti-height-40 {
2124
- height: 10rem;
2125
- }
2126
-
2127
- .qti-height-44 {
2128
- height: 11rem;
2129
- }
2130
-
2131
- .qti-height-48 {
2132
- height: 12rem;
2133
- }
2134
-
2135
- .qti-height-52 {
2136
- height: 13rem;
2137
- }
2138
-
2139
- .qti-height-56 {
2140
- height: 14rem;
2141
- }
2142
-
2143
- .qti-height-60 {
2144
- height: 15rem;
2145
- }
2146
-
2147
- .qti-height-64 {
2148
- height: 16rem;
2149
- }
2150
-
2151
- .qti-height-72 {
2152
- height: 18rem;
2153
- }
2154
-
2155
- .qti-height-80 {
2156
- height: 20rem;
2157
- }
2158
-
2159
- .qti-height-96 {
2160
- height: 24rem;
2161
- }
2162
-
2163
- .qti-height-1-2 {
2164
- height: 50%;
2165
- }
2166
-
2167
- .qti-height-1-3 {
2168
- height: 33.3333%;
2169
- }
2170
-
2171
- .qti-height-2-3 {
2172
- height: 66.6667%;
2173
- }
2174
-
2175
- .qti-height-1-4 {
2176
- height: 25%;
2177
- }
2178
-
2179
- .qti-height-2-4 {
2180
- height: 50%;
2181
- }
2182
-
2183
- .qti-height-3-4 {
2184
- height: 75%;
2185
- }
2186
-
2187
- .qti-height-1-5 {
2188
- height: 20%;
2189
- }
2190
-
2191
- .qti-height-2-5 {
2192
- height: 40%;
2193
- }
2194
-
2195
- .qti-height-3-5 {
2196
- height: 60%;
2197
- }
2198
-
2199
- .qti-height-4-5 {
2200
- height: 80%;
2201
- }
2202
-
2203
- .qti-height-1-6 {
2204
- height: 16.6667%;
2205
- }
2206
-
2207
- .qti-height-2-6 {
2208
- height: 33.3333%;
2209
- }
2210
-
2211
- .qti-height-3-6 {
2212
- height: 50%;
2213
- }
2214
-
2215
- .qti-height-4-6 {
2216
- height: 66.6667%;
2217
- }
2218
-
2219
- .qti-height-5-6 {
2220
- height: 83.3333%;
2221
- }
2222
-
2223
- .qti-height-auto {
2224
- height: auto;
2225
- }
2226
-
2227
- .qti-height-full {
2228
- height: 100%;
2229
- }
2230
-
2231
- /* ============
2232
- Width styles
2233
- ============ */
2234
-
2235
- .qti-width-0 {
2236
- width: 0;
2237
- }
2238
-
2239
- .qti-width-px {
2240
- width: 1px;
2241
- }
2242
-
2243
- .qti-width-0p5 {
2244
- width: 0.125rem;
2245
- }
2246
-
2247
- .qti-width-1 {
2248
- width: 0.25rem;
2249
- }
2250
-
2251
- .qti-width-1p5 {
2252
- width: 0.375rem;
2253
- }
2254
-
2255
- .qti-width-2 {
2256
- width: 0.5rem;
2257
- }
2258
-
2259
- .qti-width-2p5 {
2260
- width: 0.625rem;
2261
- }
2262
-
2263
- .qti-width-3 {
2264
- width: 0.75rem;
2265
- }
2266
-
2267
- .qti-width-3p5 {
2268
- width: 0.875rem;
2269
- }
2270
-
2271
- .qti-width-4 {
2272
- width: 1rem;
2273
- }
2274
-
2275
- .qti-width-5 {
2276
- width: 1.25rem;
2277
- }
2278
-
2279
- .qti-width-6 {
2280
- width: 1.5rem;
2281
- }
2282
-
2283
- .qti-width-7 {
2284
- width: 1.75rem;
2285
- }
2286
-
2287
- .qti-width-8 {
2288
- width: 2rem;
2289
- }
2290
-
2291
- .qti-width-9 {
2292
- width: 2.25rem;
2293
- }
2294
-
2295
- .qti-width-10 {
2296
- width: 2.5rem;
2297
- }
2298
-
2299
- .qti-width-11 {
2300
- width: 2.75rem;
2301
- }
2302
-
2303
- .qti-width-12 {
2304
- width: 3rem;
2305
- }
2306
-
2307
- .qti-width-14 {
2308
- width: 3.5rem;
2309
- }
2310
-
2311
- .qti-width-16 {
2312
- width: 4rem;
2313
- }
2314
-
2315
- .qti-width-20 {
2316
- width: 5rem;
2317
- }
2318
-
2319
- .qti-width-24 {
2320
- width: 6rem;
2321
- }
2322
-
2323
- .qti-width-28 {
2324
- width: 7rem;
2325
- }
2326
-
2327
- .qti-width-32 {
2328
- width: 8rem;
2329
- }
2330
-
2331
- .qti-width-36 {
2332
- width: 9rem;
2333
- }
2334
-
2335
- .qti-width-40 {
2336
- width: 10rem;
2337
- }
2338
-
2339
- .qti-width-44 {
2340
- width: 11rem;
2341
- }
2342
-
2343
- .qti-width-48 {
2344
- width: 12rem;
2345
- }
2346
-
2347
- .qti-width-52 {
2348
- width: 13rem;
2349
- }
2350
-
2351
- .qti-width-56 {
2352
- width: 14rem;
2353
- }
2354
-
2355
- .qti-width-60 {
2356
- width: 15rem;
2357
- }
2358
-
2359
- .qti-width-64 {
2360
- width: 16rem;
2361
- }
2362
-
2363
- .qti-width-72 {
2364
- width: 18rem;
2365
- }
2366
-
2367
- .qti-width-80 {
2368
- width: 20rem;
2369
- }
2370
-
2371
- .qti-width-96 {
2372
- width: 24rem;
2373
- }
2374
-
2375
- .qti-width-auto {
2376
- width: auto;
2377
- }
2378
-
2379
- .qti-width-1-2 {
2380
- width: 50%;
2381
- }
2382
-
2383
- .qti-width-1-3 {
2384
- width: 33.3333%;
2385
- }
2386
-
2387
- .qti-width-2-3 {
2388
- width: 66.6667%;
2389
- }
2390
-
2391
- .qti-width-1-4 {
2392
- width: 25%;
2393
- }
2394
-
2395
- .qti-width-2-4 {
2396
- width: 50%;
2397
- }
2398
-
2399
- .qti-width-3-4 {
2400
- width: 75%;
2401
- }
2402
-
2403
- .qti-width-1-5 {
2404
- width: 20%;
2405
- }
2406
-
2407
- .qti-width-2-5 {
2408
- width: 40%;
2409
- }
2410
-
2411
- .qti-width-3-5 {
2412
- width: 60%;
2413
- }
2414
-
2415
- .qti-width-4-5 {
2416
- width: 80%;
2417
- }
2418
-
2419
- .qti-width-1-6 {
2420
- width: 16.6667%;
2421
- }
2422
-
2423
- .qti-width-2-6 {
2424
- width: 33.3333%;
2425
- }
2426
-
2427
- .qti-width-3-6 {
2428
- width: 50%;
2429
- }
2430
-
2431
- .qti-width-4-6 {
2432
- width: 66.6667%;
2433
- }
2434
-
2435
- .qti-width-5-6 {
2436
- width: 83.3333%;
2437
- }
2438
-
2439
- .qti-width-1-12 {
2440
- width: 8.3333%;
2441
- }
2442
-
2443
- .qti-width-2-12 {
2444
- width: 16.6667%;
2445
- }
2446
-
2447
- .qti-width-3-12 {
2448
- width: 25%;
2449
- }
2450
-
2451
- .qti-width-4-12 {
2452
- width: 33.3333%;
2453
- }
2454
-
2455
- .qti-width-5-12 {
2456
- width: 41.6667%;
2457
- }
2458
-
2459
- .qti-width-6-12 {
2460
- width: 50%;
2461
- }
2462
-
2463
- .qti-width-7-12 {
2464
- width: 58.3333%;
2465
- }
2466
-
2467
- .qti-width-8-12 {
2468
- width: 66.6667%;
2469
- }
2470
-
2471
- .qti-width-9-12 {
2472
- width: 75%;
2473
- }
2474
-
2475
- .qti-width-10-12 {
2476
- width: 83.3333%;
2477
- }
2478
-
2479
- .qti-width-11-12 {
2480
- width: 91.6667%;
2481
- }
2482
-
2483
- .qti-width-full,
2484
- .qti-fullwidth {
2485
- width: 100%;
2486
- }
2487
-
2488
- /* ==================
2489
- Text Indent styles
2490
- ================== */
2491
-
2492
- .qti-text-indent-0 {
2493
- text-indent: 0;
2494
- }
2495
-
2496
- .qti-text-indent-px {
2497
- text-indent: 1px;
2498
- }
2499
-
2500
- .qti-text-indent-0p5 {
2501
- text-indent: 0.125rem;
2502
- }
2503
-
2504
- .qti-text-indent-1 {
2505
- text-indent: 0.25rem;
2506
- }
2507
-
2508
- .qti-text-indent-1p5 {
2509
- text-indent: 0.375rem;
2510
- }
2511
-
2512
- .qti-text-indent-2 {
2513
- text-indent: 0.5rem;
2514
- }
2515
-
2516
- .qti-text-indent-2p5 {
2517
- text-indent: 0.625rem;
2518
- }
2519
-
2520
- .qti-text-indent-3 {
2521
- text-indent: 0.75rem;
2522
- }
2523
-
2524
- .qti-text-indent-3p5 {
2525
- text-indent: 0.875rem;
2526
- }
2527
-
2528
- .qti-text-indent-4 {
2529
- text-indent: 1rem;
2530
- }
2531
-
2532
- .qti-text-indent-5 {
2533
- text-indent: 1.25rem;
2534
- }
2535
-
2536
- .qti-text-indent-6 {
2537
- text-indent: 1.5rem;
2538
- }
2539
-
2540
- .qti-text-indent-7 {
2541
- text-indent: 1.75rem;
2542
- }
2543
-
2544
- .qti-text-indent-8 {
2545
- text-indent: 2rem;
2546
- }
2547
-
2548
- .qti-text-indent-12 {
2549
- text-indent: 3rem;
2550
- }
2551
-
2552
- .qti-text-indent-16 {
2553
- text-indent: 4rem;
2554
- }
2555
-
2556
- .qti-text-indent-20 {
2557
- text-indent: 5rem;
2558
- }
2559
-
2560
- .qti-text-indent-24 {
2561
- text-indent: 6rem;
2562
- }
2563
-
2564
- .qti-text-indent-28 {
2565
- text-indent: 7rem;
2566
- }
2567
-
2568
- .qti-text-indent-32 {
2569
- text-indent: 8rem;
2570
- }
2571
-
2572
- /* =================
2573
- List Style styles
2574
- ================= */
2575
-
2576
- .qti-list-style-type-none {
2577
- list-style-type: none;
2578
- }
2579
-
2580
- .qti-list-style-type-disc {
2581
- list-style-type: disc;
2582
- }
2583
-
2584
- .qti-list-style-type-circle {
2585
- list-style-type: circle;
2586
- }
2587
-
2588
- .qti-list-style-type-square {
2589
- list-style-type: square;
2590
- }
2591
-
2592
- .qti-list-style-type-decimal {
2593
- list-style-type: decimal;
2594
- }
2595
-
2596
- .qti-list-style-type-decimal-leading-zero {
2597
- list-style-type: decimal-leading-zero;
2598
- }
2599
-
2600
- .qti-list-style-type-lower-alpha {
2601
- list-style-type: lower-alpha;
2602
- }
2603
-
2604
- .qti-list-style-type-upper-alpha {
2605
- list-style-type: upper-alpha;
2606
- }
2607
-
2608
- .qti-list-style-type-lower-roman {
2609
- list-style-type: lower-roman;
2610
- }
2611
-
2612
- .qti-list-style-type-upper-roman {
2613
- list-style-type: upper-roman;
2614
- }
2615
-
2616
- .qti-list-style-type-lower-latin {
2617
- list-style-type: lower-latin;
2618
- }
2619
-
2620
- .qti-list-style-type-upper-latin {
2621
- list-style-type: upper-latin;
2622
- }
2623
-
2624
- .qti-list-style-type-lower-greek {
2625
- list-style-type: lower-greek;
2626
- }
2627
-
2628
- .qti-list-style-type-arabic-indic {
2629
- list-style-type: arabic-indic;
2630
- }
2631
-
2632
- .qti-list-style-type-armenian {
2633
- list-style-type: armenian;
2634
- }
2635
-
2636
- .qti-list-style-type-lower-armenian {
2637
- list-style-type: lower-armenian;
2638
- }
2639
-
2640
- .qti-list-style-type-upper-armenian {
2641
- list-style-type: upper-armenian;
2642
- }
2643
-
2644
- .qti-list-style-type-bengali {
2645
- list-style-type: bengali;
2646
- }
2647
-
2648
- .qti-list-style-type-cambodian {
2649
- list-style-type: cambodian;
2650
- }
2651
-
2652
- .qti-list-style-type-simp-chinese-formal {
2653
- list-style-type: simp-chinese-formal;
2654
- }
2655
-
2656
- .qti-list-style-type-simp-chinese-informal {
2657
- list-style-type: simp-chinese-informal;
2658
- }
2659
-
2660
- .qti-list-style-type-trad-chinese-formal {
2661
- list-style-type: trad-chinese-formal;
2662
- }
2663
-
2664
- .qti-list-style-type-trad-chinese-informal {
2665
- list-style-type: trad-chinese-informal;
2666
- }
2667
-
2668
- .qti-list-style-type-cjk-ideographic {
2669
- list-style-type: cjk-ideographic;
2670
- }
2671
-
2672
- .qti-list-style-type-cjk-heavenly-stem {
2673
- list-style-type: cjk-heavenly-stem;
2674
- }
2675
-
2676
- .qti-list-style-type-cjk-earthly-branch {
2677
- list-style-type: cjk-earthly-branch;
2678
- }
2679
-
2680
- .qti-list-style-type-devanagari {
2681
- list-style-type: devanagari;
2682
- }
2683
-
2684
- .qti-list-style-type-ethiopic-halehame-ti-er {
2685
- list-style-type: ethiopic-halehame-ti-er;
2686
- }
2687
-
2688
- .qti-list-style-type-ethiopic-halehame-ti-et {
2689
- list-style-type: ethiopic-halehame-ti-et;
2690
- }
2691
-
2692
- .qti-list-style-type-ethiopic-halehame-am {
2693
- list-style-type: ethiopic-halehame-am;
2694
- }
2695
-
2696
- .qti-list-style-type-ethiopic-halehame {
2697
- list-style-type: ethiopic-halehame;
2698
- }
2699
-
2700
- .qti-list-style-type-georgian {
2701
- list-style-type: georgian;
2702
- }
2703
-
2704
- .qti-list-style-type-gujarati {
2705
- list-style-type: gujarati;
2706
- }
2707
-
2708
- .qti-list-style-type-gurmukhi {
2709
- list-style-type: gurmukhi;
2710
- }
2711
-
2712
- .qti-list-style-type-hangul {
2713
- list-style-type: hangul;
2714
- }
2715
-
2716
- .qti-list-style-type-hangul-consonant {
2717
- list-style-type: hangul-consonant;
2718
- }
2719
-
2720
- .qti-list-style-type-hebrew {
2721
- list-style-type: hebrew;
2722
- }
2723
-
2724
- .qti-list-style-type-hiragana {
2725
- list-style-type: hiragana;
2726
- }
2727
-
2728
- .qti-list-style-type-hiragana-iroha {
2729
- list-style-type: hiragana-iroha;
2730
- }
2731
-
2732
- .qti-list-style-type-khmer {
2733
- list-style-type: khmer;
2734
- }
2735
-
2736
- .qti-list-style-type-korean-hangul-formal {
2737
- list-style-type: korean-hangul-formal;
2738
- }
2739
-
2740
- .qti-list-style-type-korean-hanja-formal {
2741
- list-style-type: korean-hanja-formal;
2742
- }
2743
-
2744
- .qti-list-style-type-korean-hanja-informal {
2745
- list-style-type: korean-hanja-informal;
2746
- }
2747
-
2748
- .qti-list-style-type-lao {
2749
- list-style-type: lao;
2750
- }
2751
-
2752
- .qti-list-style-type-malayalam {
2753
- list-style-type: malayalam;
2754
- }
2755
-
2756
- .qti-list-style-type-mongolian {
2757
- list-style-type: mongolian;
2758
- }
2759
-
2760
- .qti-list-style-type-myanmar {
2761
- list-style-type: myanmar;
2762
- }
2763
-
2764
- .qti-list-style-type-oriya {
2765
- list-style-type: oriya;
2766
- }
2767
-
2768
- .qti-list-style-type-persian {
2769
- list-style-type: persian;
2770
- }
2771
-
2772
- .qti-list-style-type-thai {
2773
- list-style-type: thai;
2774
- }
2775
-
2776
- .qti-list-style-type-tibetan {
2777
- list-style-type: tibetan;
2778
- }
2779
-
2780
- .qti-list-style-type-telugu {
2781
- list-style-type: telugu;
2782
- }
2783
-
2784
- .qti-list-style-type-urdu {
2785
- list-style-type: urdu;
2786
- }
2787
-
2788
- /* =========================
2789
- Other QTI 3 Presentation Utilities
2790
- ========================= */
2791
-
2792
- .qti-bordered {
2793
- border: 1px solid var(--table-border-color);
2794
- }
2795
-
2796
- .qti-underline {
2797
- text-decoration: underline;
2798
- text-decoration-color: var(--foreground);
2799
- }
2800
-
2801
- .qti-italic {
2802
- font-style: italic;
2803
- }
2804
-
2805
- .qti-well {
2806
- min-height: 20px;
2807
- padding: 19px;
2808
- margin-bottom: 20px;
2809
- background-color: var(--well-bg);
2810
- border: var(--well-border);
2811
- border-radius: 4px;
2812
- box-shadow: var(--well-box-shadow);
2813
- }
2814
-
2815
- /* Set writing-mode to vertical-rl
2816
- Typical for CJK vertical text */
2817
-
2818
- .qti-writing-mode-vertical-rl {
2819
- writing-mode: vertical-rl;
2820
- }
2821
-
2822
- /* Set writing-mode to vertical-lr
2823
- Typical for Mongolian vertical text */
2824
-
2825
- .qti-writing-mode-vertical-lr {
2826
- writing-mode: vertical-lr;
2827
- }
2828
-
2829
- /* Set writing-mode to horizontal-tb
2830
- Browser default */
2831
-
2832
- .qti-writing-mode-horizontal-tb {
2833
- writing-mode: horizontal-tb;
2834
- }
2835
-
2836
- /* Float an element left */
2837
-
2838
- .qti-float-left {
2839
- float: left;
2840
- }
2841
-
2842
- /* Float an element right */
2843
-
2844
- .qti-float-right {
2845
- float: right;
2846
- }
2847
-
2848
- /* Remove a float */
2849
-
2850
- .qti-float-none {
2851
- float: none;
2852
- }
2853
-
2854
- /* Clearfix Hack to apply to a container of
2855
- floated content that overflows the container. */
2856
-
2857
- .qti-float-clearfix::after {
2858
- content: '';
2859
- clear: both;
2860
- display: table;
2861
- }
2862
-
2863
- .qti-float-clear-left
2864
- .qti-float-clear-right
2865
- .qti-float-clear-both
2866
-
2867
- /* Set text-orientation to upright */
2868
- .qti-text-orientation-upright {
2869
- text-orientation: upright;
2870
- }
2871
-
2872
- /* stylelint-disable number-max-precision */
2873
-
2874
- @layer qti-base {
2875
- .qti-layout-row {
2876
- display: flex;
2877
- flex-wrap: wrap;
2878
- width: 100%;
2879
- gap: 2.1276595745%;
2880
- }
2881
-
2882
- .qti-layout-row [class*='qti-layout-col']:not(:empty) {
2883
- box-sizing: border-box;
2884
- }
2885
-
2886
- .qti-layout-row [class*='qti-layout-col']:empty {
2887
- width: 0;
2888
- overflow: hidden; /* to fully collapse if there\u2019s padding or borders */
2889
- }
2890
-
2891
- .qti-layout-col1 {
2892
- width: 6.3829787234%;
2893
- }
2894
-
2895
- .qti-layout-col2 {
2896
- width: 14.8936170213%;
2897
- }
2898
-
2899
- .qti-layout-col3 {
2900
- width: 23.4042553191%;
2901
- }
2902
-
2903
- .qti-layout-col4 {
2904
- width: 31.914893617%;
2905
- }
2906
-
2907
- .qti-layout-col5 {
2908
- width: 40.4255319149%;
2909
- }
2910
-
2911
- .qti-layout-col6 {
2912
- width: 48.9361702128%;
2913
- }
2914
-
2915
- .qti-layout-col7 {
2916
- width: 57.4468085106%;
2917
- }
2918
-
2919
- .qti-layout-col8 {
2920
- width: 65.9574468085%;
2921
- }
2922
-
2923
- .qti-layout-col9 {
2924
- width: 74.4680851064%;
2925
- }
2926
-
2927
- .qti-layout-col10 {
2928
- width: 82.9787234043%;
2929
- }
2930
-
2931
- .qti-layout-col11 {
2932
- width: 91.4893617021%;
2933
- }
2934
-
2935
- .qti-layout-col12 {
2936
- width: 100%;
2937
- }
2938
-
2939
- .qti-layout-offset1 {
2940
- margin-left: 8.5106382979%;
2941
- }
2942
-
2943
- .qti-layout-offset2 {
2944
- margin-left: 17.0212765957%;
2945
- }
2946
-
2947
- .qti-layout-offset3 {
2948
- margin-left: 25.5319148936%;
2949
- }
2950
-
2951
- .qti-layout-offset4 {
2952
- margin-left: 34.0425531915%;
2953
- }
2954
-
2955
- .qti-layout-offset5 {
2956
- margin-left: 42.5531914894%;
2957
- }
2958
-
2959
- .qti-layout-offset6 {
2960
- margin-left: 51.0638297872%;
2961
- }
2962
-
2963
- .qti-layout-offset7 {
2964
- margin-left: 59.5744680851%;
2965
- }
2966
-
2967
- .qti-layout-offset8 {
2968
- margin-left: 68.085106383%;
2969
- }
2970
-
2971
- .qti-layout-offset9 {
2972
- margin-left: 76.5957446809%;
2973
- }
2974
-
2975
- .qti-layout-offset10 {
2976
- margin-left: 85.1063829787%;
2977
- }
2978
-
2979
- .qti-layout-offset11 {
2980
- margin-left: 93.6170212766%;
2981
- }
2982
-
2983
- .qti-layout-offset12 {
2984
- margin-left: 102.1276595745%;
2985
- }
2986
-
2987
- @media (width <= 767px) {
2988
- [class*='qti-layout-col'] {
2989
- width: 100%;
2990
- }
2991
- }
2992
- }
2993
-
2994
- [view],
2995
- qti-outcome-declaration,
2996
- qti-response-declaration {
2997
- display: none;
2998
- }
2999
-
3000
- [view].show {
3001
- display: block;
3002
- }
3003
-
3004
- :host {
3005
- box-sizing: border-box;
3006
- }
3007
-
3008
- *,
3009
- *::before,
3010
- *::after {
3011
- box-sizing: inherit;
3012
- }
3013
-
3014
- /* components */
3015
-
3016
- @layer qti-components {
3017
- qti-choice-interaction {
3018
- &.qti-input-control-hidden {
3019
- & qti-simple-choice {
3020
-
3021
- &:hover {
3022
- background-color: var(--qti-hover-bg);
3023
- }
3024
-
3025
- &:focus {
3026
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3027
- }
3028
-
3029
- &::part(ch) {
3030
- display: none;
3031
- }
3032
-
3033
- &:state(--checked),
3034
- &[aria-checked='true'] {
3035
- border-color: var(--qti-border-active);
3036
- background-color: var(--qti-bg-active);
3037
- }
3038
-
3039
- &:state(readonly),
3040
- &[aria-readonly='true'] {
3041
- cursor: pointer;
3042
- background-color: var(--qti-bg);
3043
- outline: 0;
3044
- border: none;
3045
- }
3046
-
3047
- &:state(disabled),
3048
- &[aria-disabled='true'] {
3049
- cursor: not-allowed;
3050
- background-color: var(--qti-disabled-bg);
3051
- color: var(--qti-disabled-color);
3052
- border-color: var(--qti-border-color);
3053
- outline: 4px solid var(--qti-disabled-bg);
3054
- }
3055
-
3056
- border-radius: var(--qti-border-radius);
3057
-
3058
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3059
-
3060
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3061
-
3062
- outline: none
3063
- }
3064
- }
3065
-
3066
- &:not(.qti-input-control-hidden) {
3067
- & qti-simple-choice {
3068
-
3069
- &:not([aria-disabled='true'], [aria-readonly='true'], :state(--checked)):hover {
3070
- background-color: var(--qti-hover-bg);
3071
- }
3072
-
3073
- &:focus {
3074
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3075
- }
3076
-
3077
- &:state(--checked),
3078
- &[aria-checked='true'] {
3079
- border-color: var(--qti-border-active);
3080
- background-color: var(--qti-bg-active);
3081
- }
3082
-
3083
- &:state(readonly),
3084
- &[aria-readonly='true'] {
3085
- cursor: pointer;
3086
- background-color: var(--qti-bg);
3087
- outline: 0;
3088
- border: none;
3089
- }
3090
-
3091
- &:state(disabled),
3092
- &[aria-disabled='true'] {
3093
- cursor: not-allowed;
3094
- background-color: var(--qti-disabled-bg);
3095
- color: var(--qti-disabled-color);
3096
- border-color: var(--qti-border-color);
3097
- outline: 4px solid var(--qti-disabled-bg);
3098
- }
3099
-
3100
- &::part(cha) {
3101
- width: calc(var(--qti-form-size) - 6px);
3102
- height: calc(var(--qti-form-size) - 6px);
3103
- }
3104
-
3105
- &:state(radio)::part(ch) {
3106
- border-radius: 100%;
3107
- display: grid;
3108
- place-content: center;
3109
- width: var(--qti-form-size);
3110
- height: var(--qti-form-size);
3111
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3112
- outline: none;
3113
- }
3114
-
3115
- &:state(radio):state(--checked)::part(cha) {
3116
- background-color: var(--qti-border-active);
3117
- border-radius: 100%;
3118
- }
3119
-
3120
- &:state(checkbox)::part(ch) {
3121
- display: flex;
3122
- place-items: center;
3123
- border-radius: var(--qti-border-radius);
3124
- display: grid;
3125
- place-content: center;
3126
- width: var(--qti-form-size);
3127
- height: var(--qti-form-size);
3128
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3129
- outline: none;
3130
- }
3131
-
3132
- &:state(checkbox):state(--checked)::part(cha) {
3133
- background-color: var(--qti-border-active);
3134
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
3135
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
3136
- }
3137
-
3138
- gap: 0.5rem;
3139
-
3140
- border-radius: var(--qti-border-radius);
3141
-
3142
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3143
-
3144
- outline: none;
3145
-
3146
- cursor: pointer
3147
- }
3148
- }
3149
-
3150
- & qti-simple-choice {
3151
- width: -moz-fit-content;
3152
- width: fit-content;
3153
- cursor: pointer;
3154
-
3155
- &:state(correct-response),
3156
- &[data-correct-response='true'] {
3157
- &::after {
3158
- content: '\\02714';
3159
- color: #16a34a; /* text-green-600 */
3160
- }
3161
- }
3162
- }
3163
-
3164
- & qti-simple-choice > p {
3165
- margin: 0 !important;
3166
- padding: 0 !important;
3167
- }
3168
- }
3169
-
3170
- qti-graphic-gap-match-interaction:state(--dragzone-active)::part(drags) {
3171
- border-color: var(--qti-border-active);
3172
- background-color: var(--qti-bg-active);
3173
- }
3174
-
3175
- qti-graphic-gap-match-interaction:state(--dragzone-enabled)::part(drags) {
3176
- background-color: var(--qti-bg-active);
3177
- }
3178
-
3179
- /* Active state */
3180
- qti-graphic-gap-match-interaction.qti-selections-light:state(--dragzone-active)::part(drags) {
3181
- background-color: var(--qti-light-bg-active);
3182
- border-color: var(--qti-light-border-active);
3183
- }
3184
-
3185
- qti-graphic-gap-match-interaction.qti-selections-dark:state(--dragzone-active)::part(drags) {
3186
- background-color: var(--qti-dark-bg-active);
3187
- border-color: var(--qti-dark-border-active);
3188
- }
3189
-
3190
- /* Enabled state */
3191
- qti-graphic-gap-match-interaction.qti-selections-light:state(--dragzone-enabled)::part(drags) {
3192
- background-color: var(--qti-light-bg-active);
3193
- }
3194
-
3195
- qti-graphic-gap-match-interaction.qti-selections-dark:state(--dragzone-enabled)::part(drags) {
3196
- background-color: var(--qti-dark-bg-active);
3197
- }
3198
-
3199
- qti-graphic-gap-match-interaction {
3200
- position: relative;
3201
-
3202
- & qti-gap-img,
3203
- qti-gap-text {
3204
- display: flex;
3205
- justify-content: center;
3206
- align-items: center;
3207
- cursor: grab;
3208
- }
3209
-
3210
- & qti-associable-hotspot {
3211
- display: flex;
3212
- justify-content: center;
3213
- align-items: center;
3214
- border: 2px solid transparent;
3215
-
3216
- &[enabled] {
3217
-
3218
- /* Light theme override */
3219
- .qti-selections-light & {
3220
- background-color: var(--qti-light-bg-active);
3221
- }
3222
-
3223
- /* Dark theme override */
3224
- .qti-selections-dark & {
3225
- background-color: var(--qti-dark-bg-active);
3226
- }
3227
- background-color: var(--qti-bg-active)
3228
- }
3229
-
3230
- &[active] {
3231
-
3232
- /* Light theme override */
3233
- .qti-selections-light & {
3234
- background-color: var(--qti-light-bg-active);
3235
- border-color: var(--qti-light-border-active);
3236
- }
3237
-
3238
- /* Dark theme override */
3239
- .qti-selections-dark & {
3240
- background-color: var(--qti-dark-bg-active);
3241
- border-color: var(--qti-dark-border-active);
3242
- }
3243
- border-color: var(--qti-border-active);
3244
- background-color: var(--qti-bg-active)
3245
- }
3246
-
3247
- &[disabled] {
3248
-
3249
- &:not(:empty) {
3250
- cursor: default !important;
3251
- }
3252
-
3253
- cursor: not-allowed;
3254
-
3255
- background-color: var(--qti-disabled-bg);
3256
-
3257
- color: var(--qti-disabled-color);
3258
-
3259
- border-color: var(--qti-border-color);
3260
-
3261
- outline: 4px solid var(--qti-disabled-bg)
3262
- }
3263
-
3264
- &:empty::after {
3265
- padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */
3266
- content: '\\0000a0'; /* when empty, put a space in it */
3267
- }
3268
-
3269
- &:not(:empty) {
3270
- padding: 0;
3271
- width: auto;
3272
- }
3273
-
3274
- &:not(:empty) > * {
3275
- flex: 1;
3276
- transform: rotate(0); /* rotate-0 */
3277
- box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */
3278
- }
3279
- }
3280
-
3281
- & img {
3282
- margin: 0;
3283
- padding: 0;
3284
- }
3285
- }
3286
-
3287
- qti-text-entry-interaction {
3288
- &::part(input) {
3289
- border-radius: 0;
3290
- cursor: text;
3291
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3292
- background: unset;
3293
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3294
- outline: none;
3295
- }
3296
-
3297
- &:hover {
3298
- background-color: var(--qti-hover-bg);
3299
- }
3300
-
3301
- &:focus-within {
3302
- &::part(input) {
3303
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3304
- border-color: var(--qti-border-active);
3305
- }
3306
- }
3307
- }
3308
-
3309
- qti-extended-text-interaction {
3310
- &::part(textarea) {
3311
- border-radius: 0;
3312
- cursor: text;
3313
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3314
- background: unset;
3315
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3316
- outline: none;
3317
- }
3318
-
3319
- &:hover {
3320
- background-color: var(--qti-hover-bg);
3321
- }
3322
-
3323
- &:focus-within {
3324
- &::part(textarea) {
3325
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3326
- border-color: var(--qti-border-active);
3327
- }
3328
- }
3329
- }
3330
-
3331
- qti-gap-match-interaction:state(--dragzone-active)::part(drags) {
3332
- border-color: var(--qti-border-active);
3333
- background-color: var(--qti-bg-active);
3334
- }
3335
-
3336
- qti-gap-match-interaction:state(--dragzone-enabled)::part(drags) {
3337
- background-color: var(--qti-bg-active);
3338
- }
3339
-
3340
- qti-gap-match-interaction {
3341
- & qti-gap-text {
3342
-
3343
- &[dragging] {
3344
- pointer-events: none;
3345
- rotate: -2deg;
3346
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
3347
- 0 4px 8px rgb(0 0 0 / 10%);
3348
- }
3349
-
3350
- &:hover {
3351
- background-color: var(--qti-hover-bg);
3352
- }
3353
-
3354
- &:focus {
3355
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3356
- }
3357
-
3358
- transition: transform 200ms ease-out,
3359
- box-shadow 200ms ease-out,
3360
- rotate 200ms ease-out;
3361
-
3362
- cursor: grab;
3363
-
3364
- background-color: var(--qti-bg);
3365
-
3366
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3367
-
3368
- border-radius: var(--qti-border-radius);
3369
-
3370
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
3371
-
3372
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3373
-
3374
- outline: none;
3375
-
3376
- background-image: radial-gradient(
3377
- circle at center,
3378
- rgb(0 0 0 / 10%) 0,
3379
- rgb(0 0 0 / 20%) 2px,
3380
- rgb(255 255 255 / 0%) 2px,
3381
- rgb(255 255 255 / 0%) 100%
3382
- );
3383
-
3384
- background-repeat: repeat-y;
3385
-
3386
- background-position: left center;
3387
-
3388
- background-size: 14px 8px
3389
- }
3390
-
3391
- & qti-gap {
3392
-
3393
- &[enabled] {
3394
-
3395
- /* Light theme override */
3396
- .qti-selections-light & {
3397
- border-color: var(--qti-light-border-active);
3398
- }
3399
-
3400
- /* Dark theme override */
3401
- .qti-selections-dark & {
3402
- border-color: var(--qti-dark-border-active);
3403
- }
3404
- background-color: var(--qti-bg-active)
3405
- }
3406
-
3407
- &[disabled] {
3408
-
3409
- &:not(:empty) {
3410
- cursor: default !important;
3411
- }
3412
-
3413
- cursor: not-allowed;
3414
-
3415
- background-color: var(--qti-disabled-bg);
3416
-
3417
- color: var(--qti-disabled-color);
3418
-
3419
- border-color: var(--qti-border-color);
3420
-
3421
- outline: 4px solid var(--qti-disabled-bg)
3422
- }
3423
-
3424
- &[active] {
3425
-
3426
- /* Light theme override */
3427
- .qti-selections-light & {
3428
- background-color: var(--qti-light-bg-active);
3429
- border-color: var(--qti-light-border-active);
3430
- }
3431
-
3432
- /* Dark theme override */
3433
- .qti-selections-dark & {
3434
- background-color: var(--qti-dark-bg-active);
3435
- border-color: var(--qti-dark-border-active);
3436
- }
3437
- border-color: var(--qti-border-active);
3438
- background-color: var(--qti-bg-active)
3439
- }
3440
-
3441
- display: inline-flex;
3442
- align-items: center;
3443
-
3444
- &:empty::after {
3445
- padding: var(--qti-padding-md) var(--qti-padding-lg); /* Padding shorthand */
3446
- content: '\\0000a0'; /* when empty, put a space in it */
3447
- }
3448
-
3449
- &:not(:empty) {
3450
- display: inline-flex;
3451
- padding: 0;
3452
- width: auto;
3453
- }
3454
-
3455
- &:not(:empty) > * {
3456
- flex: 1;
3457
- transform: rotate(0); /* rotate-0 */
3458
- box-shadow: 0 0 0 1px #e5e7eb; /* ring-gray-200 */
3459
- }
3460
-
3461
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
3462
- center no-repeat;
3463
-
3464
- border-radius: var(--qti-border-radius);
3465
-
3466
- position: relative;
3467
-
3468
- background-color: var(--qti-bg);
3469
-
3470
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3471
-
3472
- outline: none
3473
- }
3474
- }
3475
-
3476
- qti-hotspot-interaction {
3477
- & qti-hotspot-choice {
3478
- &[shape='circle'] {
3479
-
3480
- &:hover {
3481
- background-color: var(--qti-hover-bg);
3482
- }
3483
-
3484
- &:focus {
3485
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3486
- }
3487
-
3488
- &:state(--checked),
3489
- &[aria-checked='true'] {
3490
- border-color: var(--qti-border-active);
3491
- }
3492
-
3493
- &:state(--readonly),
3494
- &[aria-readonly='true'] {
3495
- cursor: pointer;
3496
- background-color: var(--qti-bg);
3497
- outline: 0;
3498
- border: none;
3499
- }
3500
-
3501
- &:state(--disabled),
3502
- &[aria-disabled='true'] {
3503
- cursor: not-allowed;
3504
- background-color: var(--qti-disabled-bg);
3505
- color: var(--qti-disabled-color);
3506
- border-color: var(--qti-border-color);
3507
- outline: 4px solid var(--qti-disabled-bg);
3508
- }
3509
-
3510
- width: 100%;
3511
-
3512
- height: 100%;
3513
-
3514
- background-color: transparent;
3515
-
3516
- padding: 0;
3517
-
3518
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3519
-
3520
- outline: none
3521
- }
3522
-
3523
- &[shape='rect'] {
3524
-
3525
- /* &:hover {
3526
- @apply hov;
3527
- } */
3528
-
3529
- &:focus {
3530
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3531
- }
3532
-
3533
- &:state(--checked),
3534
- &[aria-checked='true'] {
3535
- border-color: var(--qti-border-active);
3536
- }
3537
-
3538
- &[aria-readonly='true'] {
3539
- cursor: pointer;
3540
- background-color: var(--qti-bg);
3541
- outline: 0;
3542
- border: none;
3543
- }
3544
-
3545
- &[aria-disabled='true'] {
3546
- cursor: not-allowed;
3547
- background-color: var(--qti-disabled-bg);
3548
- color: var(--qti-disabled-color);
3549
- border-color: var(--qti-border-color);
3550
- outline: 4px solid var(--qti-disabled-bg);
3551
- }
3552
-
3553
- width: 100%;
3554
-
3555
- height: 100%;
3556
-
3557
- background-color: transparent;
3558
-
3559
- padding: 0;
3560
-
3561
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3562
-
3563
- outline: none
3564
- }
3565
-
3566
- &[shape='poly'] {
3567
- &:hover::after {
3568
- content: '';
3569
- width: 100%;
3570
- height: 100%;
3571
- background: repeating-linear-gradient(
3572
- 45deg,
3573
- var(--qti-border-active),
3574
- var(--qti-border-active) 5px,
3575
- transparent 5px,
3576
- transparent 10px
3577
- );
3578
- display: block;
3579
- }
3580
-
3581
- &:state(--checked)::after,
3582
- &[aria-checked='true']::after {
3583
- content: '';
3584
- width: 100%;
3585
- height: 100%;
3586
- background: repeating-linear-gradient(
3587
- 45deg,
3588
- transparent,
3589
- transparent 5px,
3590
- var(--qti-border-active) 5px,
3591
- var(--qti-border-active) 10px
3592
- );
3593
- display: block;
3594
- }
3595
-
3596
- &[aria-readonly='true'] {
3597
- cursor: pointer;
3598
- background-color: var(--qti-bg);
3599
- outline: 0;
3600
- border: none;
3601
- }
3602
-
3603
- &[aria-disabled='true'] {
3604
- cursor: not-allowed;
3605
- background-color: var(--qti-disabled-bg);
3606
- color: var(--qti-disabled-color);
3607
- border-color: var(--qti-border-color);
3608
- outline: 4px solid var(--qti-disabled-bg);
3609
- }
3610
- }
3611
- }
3612
- }
3613
-
3614
- qti-hottext-interaction {
3615
- /* &:not(.qti-input-control-hidden),
3616
- &:not(.qti-unselected-hidden) { */
3617
- qti-hottext {
3618
- display: inline-flex;
3619
- align-items: center;
3620
-
3621
- &:hover {
3622
- background-color: var(--qti-hover-bg);
3623
- }
3624
-
3625
- &:focus {
3626
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3627
- }
3628
-
3629
- &::part(cha) {
3630
- width: calc(var(--qti-form-size) - 6px);
3631
- height: calc(var(--qti-form-size) - 6px);
3632
- }
3633
-
3634
- &:state(radio)::part(ch) {
3635
- border-radius: 100%;
3636
- display: grid;
3637
- place-content: center;
3638
- width: var(--qti-form-size);
3639
- height: var(--qti-form-size);
3640
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3641
- outline: none;
3642
- }
3643
-
3644
- &:state(radio):state(--checked)::part(cha) {
3645
- background-color: var(--qti-border-active);
3646
- border-radius: 100%;
3647
- }
3648
-
3649
- &:state(checkbox)::part(ch) {
3650
- display: flex;
3651
- place-items: center;
3652
- border-radius: var(--qti-border-radius);
3653
- display: grid;
3654
- place-content: center;
3655
- width: var(--qti-form-size);
3656
- height: var(--qti-form-size);
3657
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3658
- outline: none;
3659
- }
3660
-
3661
- &:state(checkbox):state(--checked)::part(cha) {
3662
- background-color: var(--qti-border-active);
3663
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
3664
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
3665
- }
3666
-
3667
- gap: 0.5rem;
3668
-
3669
- border-radius: var(--qti-border-radius);
3670
-
3671
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3672
-
3673
- outline: none;
3674
-
3675
- cursor: pointer
3676
- }
3677
-
3678
- /* } */
3679
-
3680
- &.qti-input-control-hidden {
3681
- qti-hottext {
3682
- /* --qti-padding-md: 0.1rem;
3683
- --qti-padding-lg: 0.2rem;
3684
- --qti-border-radius-md: 0.3rem;
3685
- --qti-border-thickness: 1px;
3686
- --qti-font-weight-semibold: 400; */
3687
-
3688
- &:hover {
3689
- background-color: var(--qti-hover-bg);
3690
- }
3691
-
3692
- &:focus {
3693
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3694
- }
3695
-
3696
- /* @layer qti-variants { */
3697
- &::part(ch) {
3698
- display: none;
3699
- }
3700
-
3701
- &:state(--checked) {
3702
- border-color: var(--qti-border-active);
3703
- background-color: var(--qti-bg-active);
3704
- }
3705
-
3706
- &[aria-readonly='true'] {
3707
- cursor: pointer;
3708
- background-color: var(--qti-bg);
3709
- outline: 0;
3710
- border: none;
3711
- }
3712
-
3713
- &[aria-disabled='true'] {
3714
- cursor: not-allowed;
3715
- background-color: var(--qti-disabled-bg);
3716
- color: var(--qti-disabled-color);
3717
- border-color: var(--qti-border-color);
3718
- outline: 4px solid var(--qti-disabled-bg);
3719
- }
3720
-
3721
- border-radius: var(--qti-border-radius);
3722
-
3723
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3724
-
3725
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3726
-
3727
- outline: none
3728
- }
3729
-
3730
- /* } */
3731
- }
3732
-
3733
- &.qti-unselected-hidden {
3734
- qti-hottext {
3735
- &:hover {
3736
- background-color: var(--qti-hover-bg);
3737
- }
3738
-
3739
- &:focus {
3740
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3741
- }
3742
-
3743
- cursor: pointer;
3744
-
3745
- &::part(ch) {
3746
- display: none;
3747
- }
3748
-
3749
- &:state(--checked) {
3750
- background-color: var(--qti-bg-active);
3751
- }
3752
-
3753
- &[aria-readonly='true'] {
3754
- cursor: pointer;
3755
- background-color: var(--qti-bg);
3756
- outline: 0;
3757
- border: none;
3758
- }
3759
-
3760
- &[aria-disabled='true'] {
3761
- cursor: not-allowed;
3762
- background-color: var(--qti-disabled-bg);
3763
- color: var(--qti-disabled-color);
3764
- border-color: var(--qti-border-color);
3765
- outline: 4px solid var(--qti-disabled-bg);
3766
- }
3767
- }
3768
- }
3769
- }
3770
-
3771
- qti-inline-choice-interaction {
3772
- &::part(select) {
3773
-
3774
- &:hover {
3775
- background-color: var(--qti-hover-bg);
3776
- }
3777
-
3778
- &:focus {
3779
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3780
- }
3781
-
3782
- border-radius: var(--qti-border-radius);
3783
-
3784
- position: relative;
3785
-
3786
- -webkit-appearance: none;
3787
-
3788
- -moz-appearance: none;
3789
-
3790
- appearance: none;
3791
-
3792
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3793
-
3794
- padding-right: calc(var(--qti-padding-horizontal) + 1.5rem);
3795
-
3796
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3797
-
3798
- outline: none;
3799
-
3800
- background: url("data:image/svg+xml,%3Csvg fill='currentColor' width='22' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' aria-hidden='true'%3E%3Cpath clip-rule='evenodd' fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'%3E%3C/path%3E%3C/svg%3E")
3801
- no-repeat center right 6px
3802
- }
3803
- }
3804
-
3805
- qti-match-interaction:not(.qti-match-tabular) {
3806
- /* The draggables */
3807
- & qti-simple-match-set:first-of-type {
3808
- display: flex;
3809
- flex-wrap: wrap;
3810
- align-items: flex-start; /* Prevents children from stretching */
3811
- gap: var(--qti-gap-size);
3812
-
3813
- & qti-simple-associable-choice {
3814
-
3815
- &[dragging] {
3816
- pointer-events: none;
3817
- rotate: -2deg;
3818
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
3819
- 0 4px 8px rgb(0 0 0 / 10%);
3820
- }
3821
-
3822
- &:hover {
3823
- background-color: var(--qti-hover-bg);
3824
- }
3825
-
3826
- &:focus {
3827
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3828
- }
3829
-
3830
- transition: transform 200ms ease-out,
3831
- box-shadow 200ms ease-out,
3832
- rotate 200ms ease-out;
3833
-
3834
- cursor: grab;
3835
-
3836
- background-color: var(--qti-bg);
3837
-
3838
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3839
-
3840
- border-radius: var(--qti-border-radius);
3841
-
3842
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
3843
-
3844
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3845
-
3846
- outline: none;
3847
-
3848
- background-image: radial-gradient(
3849
- circle at center,
3850
- rgb(0 0 0 / 10%) 0,
3851
- rgb(0 0 0 / 20%) 2px,
3852
- rgb(255 255 255 / 0%) 2px,
3853
- rgb(255 255 255 / 0%) 100%
3854
- );
3855
-
3856
- background-repeat: repeat-y;
3857
-
3858
- background-position: left center;
3859
-
3860
- background-size: 14px 8px
3861
- }
3862
- }
3863
-
3864
- /* The droppables */
3865
- & qti-simple-match-set:last-of-type {
3866
- display: grid;
3867
- grid-auto-columns: 1fr; /* auto-cols-fr */
3868
- grid-auto-flow: column; /* grid-flow-col */
3869
- gap: var(--qti-gap-size); /* gap-2 */
3870
- width: 100%; /* w-full */
3871
-
3872
- & qti-simple-associable-choice {
3873
- display: flex;
3874
- flex-direction: column;
3875
- }
3876
-
3877
- & > qti-simple-associable-choice {
3878
- /* a droppable qti-simple-associable-choice */
3879
- box-sizing: border-box;
3880
- display: grid;
3881
- grid-row: 2 / 4;
3882
- grid-template-rows: subgrid;
3883
-
3884
- & img {
3885
- max-width: 100%;
3886
- height: auto;
3887
- }
3888
-
3889
- &[enabled] {
3890
- &::part(dropslot) {
3891
- background-color: var(--qti-bg-active);
3892
- }
3893
- }
3894
-
3895
- &[disabled] {
3896
- &::part(dropslot) {
3897
- cursor: not-allowed;
3898
- background-color: var(--qti-disabled-bg);
3899
- color: var(--qti-disabled-color);
3900
- border-color: var(--qti-border-color);
3901
- outline: 4px solid var(--qti-disabled-bg);
3902
- }
3903
- }
3904
-
3905
- &[active] {
3906
- &::part(dropslot) {
3907
- border-color: var(--qti-border-active);
3908
- background-color: var(--qti-bg-active);
3909
- }
3910
- }
3911
-
3912
- &::part(dropslot) {
3913
-
3914
- &[dragging] {
3915
- pointer-events: none;
3916
- rotate: -2deg;
3917
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
3918
- 0 4px 8px rgb(0 0 0 / 10%);
3919
- }
3920
-
3921
- &:focus {
3922
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3923
- }
3924
-
3925
- min-height: 6rem;
3926
- gap: var(--qti-gap-size);
3927
- box-sizing: border-box;
3928
- display: flex;
3929
- justify-content: center;
3930
- align-items: center;
3931
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
3932
- center no-repeat;
3933
- border-radius: var(--qti-border-radius);
3934
- position: relative;
3935
- background-color: var(--qti-bg);
3936
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3937
- outline: none;
3938
- }
3939
-
3940
- & > *:not(qti-simple-associable-choice) {
3941
- pointer-events: none;
3942
- }
3943
-
3944
- & > qti-simple-associable-choice {
3945
-
3946
- &::part(dropslot) {
3947
- display: none;
3948
- }
3949
-
3950
- &:hover {
3951
- background-color: var(--qti-hover-bg);
3952
- }
3953
-
3954
- &:focus {
3955
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
3956
- }
3957
-
3958
- flex-basis: fit-content;
3959
-
3960
- transition: transform 200ms ease-out,
3961
- box-shadow 200ms ease-out,
3962
- rotate 200ms ease-out;
3963
-
3964
- cursor: grab;
3965
-
3966
- background-color: var(--qti-bg);
3967
-
3968
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
3969
-
3970
- border-radius: var(--qti-border-radius);
3971
-
3972
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
3973
-
3974
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
3975
-
3976
- outline: none;
3977
-
3978
- background-image: radial-gradient(
3979
- circle at center,
3980
- rgb(0 0 0 / 10%) 0,
3981
- rgb(0 0 0 / 20%) 2px,
3982
- rgb(255 255 255 / 0%) 2px,
3983
- rgb(255 255 255 / 0%) 100%
3984
- );
3985
-
3986
- background-repeat: repeat-y;
3987
-
3988
- background-position: left center;
3989
-
3990
- background-size: 14px 8px;
3991
- }
3992
- }
3993
- }
3994
- }
3995
-
3996
- qti-order-interaction {
3997
- &::part(qti-simple-choice),
3998
- & qti-simple-choice {
3999
-
4000
- &[dragging] {
4001
- pointer-events: none;
4002
- rotate: -2deg;
4003
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
4004
- 0 4px 8px rgb(0 0 0 / 10%);
4005
- }
4006
-
4007
- &:hover {
4008
- background-color: var(--qti-hover-bg);
4009
- }
4010
-
4011
- &:focus {
4012
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4013
- }
4014
-
4015
- transition: transform 200ms ease-out,
4016
- box-shadow 200ms ease-out,
4017
- rotate 200ms ease-out;
4018
-
4019
- cursor: grab;
4020
-
4021
- background-color: var(--qti-bg);
4022
-
4023
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
4024
-
4025
- border-radius: var(--qti-border-radius);
4026
-
4027
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
4028
-
4029
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4030
-
4031
- outline: none;
4032
-
4033
- background-image: radial-gradient(
4034
- circle at center,
4035
- rgb(0 0 0 / 10%) 0,
4036
- rgb(0 0 0 / 20%) 2px,
4037
- rgb(255 255 255 / 0%) 2px,
4038
- rgb(255 255 255 / 0%) 100%
4039
- );
4040
-
4041
- background-repeat: repeat-y;
4042
-
4043
- background-position: left center;
4044
-
4045
- background-size: 14px 8px
4046
- }
4047
-
4048
- &::part(qti-simple-choice) {
4049
- display: flex;
4050
- overflow: hidden;
4051
- align-items: center;
4052
- width: 100%;
4053
- text-overflow: ellipsis;
4054
- }
4055
-
4056
- &::part(drops) {
4057
- gap: 0.5rem; /* gap-2 */
4058
- }
4059
-
4060
- &::part(drags) {
4061
- gap: 0.5rem; /* gap-2 */
4062
- }
4063
-
4064
- &::part(drop-list) {
4065
-
4066
- &[enabled] {
4067
-
4068
- /* Light theme override */
4069
- .qti-selections-light & {
4070
- border-color: var(--qti-light-border-active);
4071
- }
4072
-
4073
- /* Dark theme override */
4074
- .qti-selections-dark & {
4075
- border-color: var(--qti-dark-border-active);
4076
- }
4077
- background-color: var(--qti-bg-active)
4078
- }
4079
-
4080
- &:hover {
4081
- background-color: var(--qti-hover-bg);
4082
- }
4083
-
4084
- &:focus {
4085
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4086
- }
4087
-
4088
- display: flex;
4089
- min-height: 4rem;
4090
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
4091
- center no-repeat;
4092
- border-radius: var(--qti-border-radius);
4093
- position: relative;
4094
- background-color: var(--qti-bg);
4095
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4096
- outline: none;
4097
- }
4098
-
4099
- &::part(active) {
4100
- border-color: var(--qti-border-active);
4101
- background-color: var(--qti-bg-active);
4102
- }
4103
- }
4104
-
4105
- qti-associate-interaction {
4106
- & qti-simple-associable-choice, /* drags when in lightdom */
4107
- &::part(qti-simple-associable-choice) /* drags when in shadowdom */ {
4108
-
4109
- &:hover {
4110
- background-color: var(--qti-hover-bg);
4111
- }
4112
-
4113
- &:focus {
4114
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4115
- }
4116
-
4117
- &[dragging] {
4118
- pointer-events: none;
4119
- rotate: -2deg;
4120
- box-shadow: 0 8px 12px rgb(0 0 0 / 20%),
4121
- 0 4px 8px rgb(0 0 0 / 10%);
4122
- }
4123
-
4124
- transition: transform 200ms ease-out,
4125
- box-shadow 200ms ease-out,
4126
- rotate 200ms ease-out;
4127
-
4128
- cursor: grab;
4129
-
4130
- background-color: var(--qti-bg);
4131
-
4132
- padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);
4133
-
4134
- border-radius: var(--qti-border-radius);
4135
-
4136
- padding-left: calc(var(--qti-padding-horizontal) + 0.5rem);
4137
-
4138
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4139
-
4140
- outline: none;
4141
-
4142
- background-image: radial-gradient(
4143
- circle at center,
4144
- rgb(0 0 0 / 10%) 0,
4145
- rgb(0 0 0 / 20%) 2px,
4146
- rgb(255 255 255 / 0%) 2px,
4147
- rgb(255 255 255 / 0%) 100%
4148
- );
4149
-
4150
- background-repeat: repeat-y;
4151
-
4152
- background-position: left center;
4153
-
4154
- background-size: 14px 8px
4155
- }
4156
-
4157
- /* display: flex;
4158
- overflow: hidden;
4159
- align-items: center; */
4160
-
4161
- /* &::part(drop-container) {
4162
- display: flex;
4163
- flex-direction: column;
4164
- gap: var(--qti-gap-size);
4165
- } */
4166
-
4167
- &::part(drop-list) {
4168
-
4169
- display: grid;
4170
- height: 3rem;
4171
- min-width: 10rem;
4172
- background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="7" stroke="%23CCCCCC" stroke-width="1" fill="transparent" /></svg>')
4173
- center no-repeat;
4174
- border-radius: var(--qti-border-radius);
4175
- position: relative;
4176
- background-color: var(--qti-bg);
4177
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4178
- outline: none;
4179
- }
4180
-
4181
- &::part(drop-list):focus {
4182
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4183
- }
4184
-
4185
- &::part(drop-list)[dragging] {
4186
- border-color: var(--qti-border-active);
4187
- background-color: var(--qti-bg-active);
4188
- }
4189
-
4190
- /* &::part(drop-list) {
4191
- @apply act;
4192
- } */
4193
- }
4194
-
4195
- qti-graphic-order-interaction {
4196
- & qti-hotspot-choice {
4197
-
4198
- &:hover {
4199
- background-color: var(--qti-hover-bg);
4200
- }
4201
-
4202
- &:focus {
4203
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4204
- }
4205
-
4206
- &:state(--checked),
4207
- &[aria-checked='true'] {
4208
- border-color: var(--qti-border-active);
4209
- background-color: var(--qti-bg-active);
4210
- }
4211
-
4212
- &[aria-readonly='true'] {
4213
- cursor: pointer;
4214
- background-color: var(--qti-bg);
4215
- outline: 0;
4216
- border: none;
4217
- }
4218
-
4219
- &[aria-disabled='true'] {
4220
- cursor: not-allowed;
4221
- background-color: var(--qti-disabled-bg);
4222
- color: var(--qti-disabled-color);
4223
- border-color: var(--qti-border-color);
4224
- outline: 4px solid var(--qti-disabled-bg);
4225
- }
4226
-
4227
- &[aria-ordervalue] {
4228
- display: grid;
4229
- place-content: center;
4230
- }
4231
-
4232
- &[aria-ordervalue]::after {
4233
- content: attr(aria-ordervalue) !important;
4234
- }
4235
-
4236
- width: 100%;
4237
-
4238
- height: 100%;
4239
-
4240
- background-color: transparent;
4241
-
4242
- padding: 0;
4243
-
4244
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4245
-
4246
- outline: none
4247
- }
4248
- }
4249
-
4250
- qti-graphic-associate-interaction {
4251
- position: relative;
4252
- display: block;
4253
-
4254
- & qti-associable-hotspot {
4255
- &[shape='circle'] {
4256
-
4257
- &:hover {
4258
- background-color: var(--qti-hover-bg);
4259
- }
4260
-
4261
- &:focus {
4262
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4263
- }
4264
-
4265
- &[aria-checked='true'] {
4266
- border-color: var(--qti-border-active);
4267
- background-color: var(--qti-bg-active);
4268
- }
4269
-
4270
- &[aria-readonly='true'] {
4271
- cursor: pointer;
4272
- background-color: var(--qti-bg);
4273
- outline: 0;
4274
- border: none;
4275
- }
4276
-
4277
- &[aria-disabled='true'] {
4278
- cursor: not-allowed;
4279
- background-color: var(--qti-disabled-bg);
4280
- color: var(--qti-disabled-color);
4281
- border-color: var(--qti-border-color);
4282
- outline: 4px solid var(--qti-disabled-bg);
4283
- }
4284
-
4285
- width: 100%;
4286
-
4287
- height: 100%;
4288
-
4289
- background-color: transparent;
4290
-
4291
- padding: 0;
4292
-
4293
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4294
-
4295
- outline: none
4296
- }
4297
-
4298
- &[shape='square'] {
4299
-
4300
- &:hover {
4301
- background-color: var(--qti-hover-bg);
4302
- }
4303
-
4304
- &:focus {
4305
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4306
- }
4307
-
4308
- &[aria-checked='true'] {
4309
- border-color: var(--qti-border-active);
4310
- background-color: var(--qti-bg-active);
4311
- }
4312
-
4313
- &[aria-readonly='true'] {
4314
- cursor: pointer;
4315
- background-color: var(--qti-bg);
4316
- outline: 0;
4317
- border: none;
4318
- }
4319
-
4320
- &[aria-disabled='true'] {
4321
- cursor: not-allowed;
4322
- background-color: var(--qti-disabled-bg);
4323
- color: var(--qti-disabled-color);
4324
- border-color: var(--qti-border-color);
4325
- outline: 4px solid var(--qti-disabled-bg);
4326
- }
4327
-
4328
- width: 100%;
4329
-
4330
- height: 100%;
4331
-
4332
- background-color: transparent;
4333
-
4334
- padding: 0;
4335
-
4336
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4337
-
4338
- outline: none
4339
- }
4340
- }
4341
- }
4342
-
4343
- qti-slider-interaction {
4344
- display: block;
4345
-
4346
- --qti-tick-color: rgb(229 231 235 / 100%);
4347
- --qti-tick-width: 1px;
4348
-
4349
- &::part(slider) {
4350
- margin-left: 2rem; /* mx-8 */
4351
- margin-right: 2rem;
4352
- padding-bottom: 1rem; /* pb-4 */
4353
- padding-top: 1.25rem; /* pt-5 */
4354
- }
4355
-
4356
- --show-bounds: true;
4357
-
4358
- &::part(bounds) {
4359
- display: flex;
4360
- width: 100%;
4361
- justify-content: space-between;
4362
- margin-bottom: 0.5rem; /* mb-2 */
4363
- }
4364
-
4365
- --show-ticks: true;
4366
-
4367
- &::part(ticks) {
4368
- margin-left: 0.125rem; /* mx-0.5 */
4369
- margin-right: 0.125rem;
4370
- margin-bottom: 0.25rem; /* mb-1 */
4371
- height: 0.5rem; /* h-2 */
4372
- background: linear-gradient(to right, var(--qti-tick-color) var(--qti-tick-width), transparent 1px) repeat-x 0
4373
- center / calc(calc(100% - var(--qti-tick-width)) / ((var(--max) - var(--min)) / var(--step))) 100%;
4374
- }
4375
-
4376
- &::part(rail) {
4377
- display: flex;
4378
- align-items: center;
4379
- box-sizing: border-box;
4380
- height: 0.375rem; /* h-1.5 */
4381
- width: 100%;
4382
- cursor: pointer;
4383
- border-radius: 9999px; /* rounded-full */
4384
- border: 1px solid #d1d5db; /* border-gray-300 */
4385
- background-color: #e5e7eb; /* bg-gray-200 */
4386
- }
4387
-
4388
- &::part(knob) {
4389
- background-color: var(--qti-primary);
4390
- position: relative;
4391
- height: 1rem; /* h-4 */
4392
- width: 1rem; /* w-4 */
4393
- transform-origin: center;
4394
- transform: translateX(-50%);
4395
- cursor: pointer;
4396
- border-radius: 9999px; /* rounded-full */
4397
- left: var(--value-percentage);
4398
- }
4399
-
4400
- --show-value: true;
4401
-
4402
- &::part(value) {
4403
- position: absolute;
4404
- bottom: 2rem; /* bottom-8 */
4405
- left: 0.5rem; /* left-2 */
4406
- transform: translateX(-50%);
4407
- cursor: pointer;
4408
- border-radius: 0.25rem; /* rounded */
4409
- background-color: #f3f4f6; /* bg-gray-100 */
4410
- padding: 0.25rem 0.5rem; /* px-2 py-1 */
4411
- text-align: center;
4412
- color: #6b7280; /* text-gray-500 */
4413
- }
4414
- }
4415
-
4416
- qti-select-point-interaction {
4417
- &::part(point) {
4418
- &:hover {
4419
- background-color: var(--qti-hover-bg);
4420
- }
4421
-
4422
- &:focus {
4423
- box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
4424
- }
4425
-
4426
- border-radius: 100%;
4427
-
4428
- width: var(--qti-point-size);
4429
-
4430
- height: var(--qti-point-size);
4431
-
4432
- background-color: transparent;
4433
-
4434
- padding: 0;
4435
-
4436
- border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
4437
-
4438
- outline: none;
4439
- }
4440
- }
4441
-
4442
- qti-position-object-stage {
4443
- & qti-position-object-interaction {
4444
- /* no styles necessary, only layout styles, defined in the component */
4445
- }
4446
- }
4447
-
4448
- qti-prompt {
4449
- margin: 0.5rem 0; /* my-2 */
4450
- display: block;
4451
- width: 100%;
4452
- }
4453
- }
4454
- `;
4455
-
4456
- // src/lib/qti-test/components/test-container.ts
4457
- var TestContainer = class extends LitElement7 {
4458
- constructor() {
4459
- super(...arguments);
4460
- this.testURL = "";
4461
- }
4462
- /**
4463
- * Lifecycle callback invoked when the element is added to the DOM.
4464
- * Handles template preloading and dispatches a `qti-load-test-request` event
4465
- * if no template is found.
4466
- */
4467
- async connectedCallback() {
4468
- super.connectedCallback();
4469
- const template = this.querySelector("template");
4470
- if (template) {
4471
- this.preContent = template.content;
4472
- } else {
4473
- this.preContent = html10``;
4474
- const sheet = new CSSStyleSheet();
4475
- sheet.replaceSync(item_default);
4476
- this.shadowRoot.adoptedStyleSheets = [sheet];
4477
- await this.updateComplete;
4478
- const event = new CustomEvent("qti-load-test-request", {
4479
- bubbles: true,
4480
- composed: true,
4481
- detail: {
4482
- promise: null,
4483
- testURL: this.testURL
4484
- }
4485
- });
4486
- const preventDefault = this.dispatchEvent(event);
4487
- if (!preventDefault) {
4488
- console.warn("No qti-load-test-request listener found");
4489
- this.preContent = html10`<span>qti-load-test-request was not catched</span>`;
4490
- } else {
4491
- this.content = (async () => {
4492
- return await event.detail.promise;
4493
- })();
4494
- }
4495
- }
4496
- }
4497
- /**
4498
- * Renders the component content.
4499
- * Preloaded template content is rendered first, followed by the default slot
4500
- * and dynamically loaded content.
4501
- */
4502
- render() {
4503
- return html10`
4504
- ${this.preContent}
4505
- <slot></slot>
4506
- ${until(this.content, html10`<span>Loading...</span>`)}
4507
- `;
4508
- }
4509
- };
4510
- __decorateClass([
4511
- state3()
4512
- ], TestContainer.prototype, "content", 2);
4513
- __decorateClass([
4514
- property8({ type: String, attribute: "test-url" })
4515
- ], TestContainer.prototype, "testURL", 2);
4516
- TestContainer = __decorateClass([
4517
- customElement8("test-container")
4518
- ], TestContainer);
4519
-
4520
- // src/lib/qti-test/components/test-paging-buttons-stamp.ts
4521
- import { html as html11 } from "lit";
4522
- import { customElement as customElement9, property as property9 } from "lit/decorators.js";
4523
- import { prepareTemplate } from "stampino";
4524
- var TestPagingButtonsStamp = class extends TestComponent {
4525
- constructor() {
4526
- super();
4527
- this.maxDisplayedItems = 2;
4528
- this.skipOnCategory = "dep-informational";
4529
- this._internals.ariaLabel = "pagination";
4530
- }
4531
- createRenderRoot() {
4532
- return this;
4533
- }
4534
- render() {
4535
- const items = this._testContext.items.reduce(
4536
- (acc, item) => {
4537
- const isDepInfoItem = item.category?.split(" ").includes(this.skipOnCategory);
4538
- const newIndex = isDepInfoItem ? "i" : acc.counter++;
4539
- acc.result.push({
4540
- ...item,
4541
- newIndex
4542
- // Assign the new index, which only increments for non-info items
4543
- });
4544
- return acc;
4545
- },
4546
- { counter: 0, result: [] }
4547
- ).result;
4548
- const itemIndex = items.findIndex((item) => item.identifier === this._testContext.navItemId);
4549
- const start = Math.max(0, itemIndex - this.maxDisplayedItems);
4550
- const end = Math.min(items.length, itemIndex + this.maxDisplayedItems + 1);
4551
- const clampedItems = items.slice(start, end);
4552
- return html11`
4553
- ${clampedItems.map((item) => {
4554
- const rawscore = item.variables.find((vr) => vr.identifier == "SCORE");
4555
- const score = parseInt(rawscore?.value?.toString());
4556
- const completionStatus = item.variables.find((v) => v.identifier === "completionStatus")?.value;
4557
- const type = item.category !== this.skipOnCategory ? "regular" : "info";
4558
- const active = this._testContext.navItemId === item.identifier;
4559
- const correct = this._testContext.view === "scorer" && type == "regular" && score !== void 0 && !isNaN(score) && score > 0;
4560
- const incorrect = this._testContext.view === "scorer" && type == "regular" && score !== void 0 && !isNaN(score) && score <= 0;
4561
- const answered = this._testContext.view === "candidate" && completionStatus === "completed" && item.category !== this.skipOnCategory;
4562
- const computedItem = {
4563
- ...item,
4564
- type,
4565
- active,
4566
- correct,
4567
- incorrect,
4568
- answered
4569
- };
4570
- const templateElement = this.firstElementChild;
4571
- const myTemplate = prepareTemplate(templateElement);
4572
- return myTemplate({ item: computedItem });
4573
- })}
4574
- `;
4575
- }
4576
- };
4577
- __decorateClass([
4578
- property9({ type: Number, attribute: "max-displayed-items" })
4579
- ], TestPagingButtonsStamp.prototype, "maxDisplayedItems", 2);
4580
- __decorateClass([
4581
- property9({ type: String, attribute: "skip-on-category" })
4582
- ], TestPagingButtonsStamp.prototype, "skipOnCategory", 2);
4583
- TestPagingButtonsStamp = __decorateClass([
4584
- customElement9("test-paging-buttons-stamp")
4585
- ], TestPagingButtonsStamp);
4586
- export {
4587
- QtiAssessmentItemRef,
4588
- QtiAssessmentSection,
4589
- QtiAssessmentTest,
4590
- QtiTest,
4591
- QtiTestPart,
4592
- TestContainer,
4593
- TestItemLink,
4594
- TestNext,
4595
- TestPagingButtonsStamp,
4596
- TestPrev,
4597
- TestView
4598
- };
4599
- //# sourceMappingURL=index.js.map