@citolab/qti-components 6.9.1-beta.61 → 6.9.1-beta.65

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.
@@ -1,5 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
- import { p as QtiAssessmentItem } from '../qti-simple-choice-CFhbe77e.js';
2
+ import { p as QtiAssessmentItem } from '../qti-simple-choice-C2d4_r3u.js';
3
3
  import 'lit-html';
4
4
  import 'lit-html/directives/ref.js';
5
5
 
@@ -1,4 +1,4 @@
1
- import { p as QtiAssessmentItem } from '../qti-simple-choice-CFhbe77e.js';
1
+ import { p as QtiAssessmentItem } from '../qti-simple-choice-C2d4_r3u.js';
2
2
  import 'lit-html';
3
3
  import 'lit';
4
4
  import 'lit-html/directives/ref.js';
@@ -30,16 +30,6 @@ type InteractionChangedDetails = ResponseInteraction & {
30
30
  item: string;
31
31
  };
32
32
 
33
- type QtiChoiceElementSelected = CustomEvent<{
34
- identifier: string;
35
- checked: boolean;
36
- }>;
37
- declare global {
38
- interface GlobalEventHandlersEventMap {
39
- 'qti-choice-element-selected': QtiChoiceElementSelected;
40
- }
41
- }
42
-
43
33
  type QtiInteractionChanged = CustomEvent<InteractionChangedDetails>;
44
34
  declare global {
45
35
  interface GlobalEventHandlersEventMap {
@@ -47,20 +37,6 @@ declare global {
47
37
  }
48
38
  }
49
39
 
50
- type QtiInteractionResponse = CustomEvent<ResponseInteraction>;
51
- declare global {
52
- interface GlobalEventHandlersEventMap {
53
- 'qti-interaction-response': QtiInteractionResponse;
54
- }
55
- }
56
-
57
- type QtiLooseChoice = CustomEvent<Record<PropertyKey, never>>;
58
- declare global {
59
- interface GlobalEventHandlersEventMap {
60
- 'qti-loose-choice': QtiLooseChoice;
61
- }
62
- }
63
-
64
40
  type QtiOutcomeChanged = CustomEvent<OutcomeChangedDetails>;
65
41
  declare global {
66
42
  interface GlobalEventHandlersEventMap {
@@ -68,20 +44,6 @@ declare global {
68
44
  }
69
45
  }
70
46
 
71
- type QtiRegisterChoice = CustomEvent<Record<PropertyKey, never>>;
72
- declare global {
73
- interface GlobalEventHandlersEventMap {
74
- 'qti-register-choice': QtiRegisterChoice;
75
- }
76
- }
77
-
78
- type QtiRegisterInteraction = CustomEvent<Record<PropertyKey, never>>;
79
- declare global {
80
- interface GlobalEventHandlersEventMap {
81
- 'qti-register-interaction': QtiRegisterInteraction;
82
- }
83
- }
84
-
85
47
  declare class QtiMapping extends LitElement {
86
48
  defaultValue: number;
87
49
  lowerBound: number;
@@ -111,22 +73,6 @@ interface ResponseVariable extends VariableDeclaration<string | string[] | null>
111
73
  correctResponse?: string | string[] | null;
112
74
  }
113
75
 
114
- type QtiRegisterVariable = CustomEvent<{
115
- variable: VariableDeclaration<string | string[]>;
116
- }>;
117
- declare global {
118
- interface GlobalEventHandlersEventMap {
119
- 'qti-register-variable': QtiRegisterVariable;
120
- }
121
- }
122
-
123
- type QtiRegisterHotspot = CustomEvent<Record<PropertyKey, never>>;
124
- declare global {
125
- interface GlobalEventHandlersEventMap {
126
- 'qti-register-hotspot': QtiRegisterHotspot;
127
- }
128
- }
129
-
130
76
  /**
131
77
  * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
132
78
  * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
@@ -367,6 +313,7 @@ declare abstract class QtiFeedback extends LitElement {
367
313
  outcomeIdentifier: string;
368
314
  protected identifier: string;
369
315
  showStatus: string;
316
+ private _context?;
370
317
  connectedCallback(): void;
371
318
  checkShowFeedback(outcomeIdentifier: string): void;
372
319
  private showFeedback;
@@ -580,7 +527,7 @@ declare abstract class QtiExpression<T> extends LitElement implements QtiExpress
580
527
  render(): lit_html.TemplateResult<1>;
581
528
  calculate(): Readonly<T>;
582
529
  protected getResult(): Readonly<T>;
583
- get assessmentItem(): QtiAssessmentItem;
530
+ protected context?: ItemContext;
584
531
  getVariables: () => VariableDeclaration<number | string | (number | string)[] | null>[];
585
532
  }
586
533
 
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=20.0.0"
23
23
  },
24
- "version": "6.9.1-beta.61",
24
+ "version": "6.9.1-beta.65",
25
25
  "type": "module",
26
26
  "exports": {
27
27
  "./qti-components": "./dist/qti-components/index.js",
@@ -53,7 +53,7 @@
53
53
  "./dist/item.css"
54
54
  ],
55
55
  "scripts": {
56
- "test": "vitest",
56
+ "test": "vitest run",
57
57
  "dev": "vite",
58
58
  "build": "wireit",
59
59
  "build-lib": "tsx scripts/build.ts",
@@ -69,7 +69,8 @@
69
69
  "prepublishOnly": "echo 'calling prepublishOnly as npm lifecycle hook to build-lib!' && npm run build-lib",
70
70
  "postpublish": "echo 'posthook for prosperity, does nothing for now!'",
71
71
  "test:browser": "vitest --browser.headless=false",
72
- "chromatic": "node chromatic-runner.cjs"
72
+ "chromatic": "node chromatic-runner.cjs",
73
+ "prepare": "husky"
73
74
  },
74
75
  "wireit": {
75
76
  "build": {
@@ -126,6 +127,7 @@
126
127
  "eslint-plugin-storybook": "^0.11.0",
127
128
  "eslint-plugin-wc": "^2.2.0",
128
129
  "globals": "^15.11.0",
130
+ "husky": "^9.1.7",
129
131
  "lit": "^3.2.1",
130
132
  "nodemon": "^3.1.7",
131
133
  "np": "^10.0.7",