@citolab/qti-components 6.0.22 → 6.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -189,28 +189,14 @@ declare class QtiMapping extends LitElement {
189
189
  }[];
190
190
  }
191
191
 
192
- declare class ResponseVariable implements VariableDeclaration<string | string[]> {
193
- private _candidateResponse;
194
- private _mapping;
195
- private _correctResponse;
196
- private _cardinality;
197
- private _identifier;
198
- private _basetype;
199
- private _qtiVariable;
200
- constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
201
- mapping: QtiMapping;
202
- correctResponse: string | string[];
203
- cardinality: Cardinality;
204
- baseType: BaseType;
205
- identifier: string;
206
- });
207
- get mapping(): QtiMapping;
208
- get correctResponse(): string | string[];
209
- get cardinality(): Cardinality;
210
- get baseType(): BaseType;
211
- get identifier(): string;
212
- get value(): string | string[];
213
- set value(val: string | string[]);
192
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | undefined> {
193
+ identifier: string;
194
+ cardinality: Cardinality;
195
+ baseType: BaseType;
196
+ value: string | string[] | undefined;
197
+ candidateResponse: string | string[];
198
+ mapping: QtiMapping;
199
+ correctResponse: string | string[];
214
200
  }
215
201
 
216
202
  declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
@@ -232,7 +218,8 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
232
218
  * @slot - The default slot where all the other QTI 3 item structures go.
233
219
  *
234
220
  * @event qti-interaction-changed - Emitted when an interaction is changed.
235
- * @event qti-outcome-changed - Emitted when the radio group receives user input.
221
+ * @event qti-outcome-changed - Emitted when an outcome has changed.
222
+ * @event qti-response-processing - Emitted when response-processing is called.
236
223
  *
237
224
  */
238
225
  declare class QtiAssessmentItem extends LitElement {
@@ -243,6 +230,7 @@ declare class QtiAssessmentItem extends LitElement {
243
230
  readonly: boolean;
244
231
  title: string;
245
232
  identifier: string;
233
+ private _numAttempts;
246
234
  render(): lit_html.TemplateResult<1>;
247
235
  _handleDisabledChange: (_: boolean, disabled: boolean) => void;
248
236
  _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
@@ -255,7 +243,7 @@ declare class QtiAssessmentItem extends LitElement {
255
243
  set responses(myResponses: ResponseInteraction[]);
256
244
  resetInteractions(): void;
257
245
  validateResponses(): boolean;
258
- getVariable(identifier: string): VariableDeclaration<any>;
246
+ getVariable(identifier: string): VariableDeclaration<number | string | string[] | undefined>;
259
247
  getResponse(identifier: string): ResponseVariable | null;
260
248
  getOutcome(identifier: string): OutcomeVariable | null;
261
249
  private registerFeedbackElement;
@@ -598,14 +586,14 @@ declare class QtiResponseElseIf extends QtiResponseIf {
598
586
  render(): lit_html.TemplateResult<1>;
599
587
  }
600
588
 
601
- declare class QtiExpression<T> extends LitElement {
589
+ declare abstract class QtiExpression<T> extends LitElement {
602
590
  protected _error: any[];
603
591
  protected set error(val: string);
604
592
  static styles: lit.CSSResult;
605
593
  render(): lit_html.TemplateResult<1>;
606
594
  calculate(): T;
607
595
  protected get assessmentItem(): QtiAssessmentItem;
608
- protected getVariables: () => VariableDeclaration<string | string[]>[];
596
+ protected getVariables: () => VariableDeclaration<number | string | string[] | undefined>[];
609
597
  }
610
598
 
611
599
  declare class QtiGt extends QtiExpression<boolean> {
@@ -691,10 +679,10 @@ declare class QtiMatch extends QtiExpression<boolean> {
691
679
 
692
680
  declare class QtiVariable extends QtiExpression<number | string | string[]> {
693
681
  render(): lit_html.TemplateResult<1>;
694
- calculate(): any;
682
+ calculate(): string | number | string[];
695
683
  }
696
684
 
697
- declare class QtiMultiple extends QtiExpression<ResponseVariable[]> {
685
+ declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
698
686
  calculate(): ResponseVariable[];
699
687
  }
700
688
 
@@ -703,10 +691,11 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
703
691
  }
704
692
 
705
693
  declare class QtPrintedVariable extends LitElement {
706
- value: string;
694
+ identifier: string;
695
+ value: string | string[] | number;
707
696
  render(): lit_html.TemplateResult<1>;
708
697
  constructor();
709
- calculate(): any;
698
+ calculate(): string | string[] | number;
710
699
  }
711
700
 
712
701
  declare class QtiMember extends QtiExpression<boolean | null> {
package/dist/index.d.ts CHANGED
@@ -189,28 +189,14 @@ declare class QtiMapping extends LitElement {
189
189
  }[];
190
190
  }
191
191
 
192
- declare class ResponseVariable implements VariableDeclaration<string | string[]> {
193
- private _candidateResponse;
194
- private _mapping;
195
- private _correctResponse;
196
- private _cardinality;
197
- private _identifier;
198
- private _basetype;
199
- private _qtiVariable;
200
- constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
201
- mapping: QtiMapping;
202
- correctResponse: string | string[];
203
- cardinality: Cardinality;
204
- baseType: BaseType;
205
- identifier: string;
206
- });
207
- get mapping(): QtiMapping;
208
- get correctResponse(): string | string[];
209
- get cardinality(): Cardinality;
210
- get baseType(): BaseType;
211
- get identifier(): string;
212
- get value(): string | string[];
213
- set value(val: string | string[]);
192
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | undefined> {
193
+ identifier: string;
194
+ cardinality: Cardinality;
195
+ baseType: BaseType;
196
+ value: string | string[] | undefined;
197
+ candidateResponse: string | string[];
198
+ mapping: QtiMapping;
199
+ correctResponse: string | string[];
214
200
  }
215
201
 
216
202
  declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
@@ -232,7 +218,8 @@ declare class OutcomeVariable implements VariableDeclaration<number | string | s
232
218
  * @slot - The default slot where all the other QTI 3 item structures go.
233
219
  *
234
220
  * @event qti-interaction-changed - Emitted when an interaction is changed.
235
- * @event qti-outcome-changed - Emitted when the radio group receives user input.
221
+ * @event qti-outcome-changed - Emitted when an outcome has changed.
222
+ * @event qti-response-processing - Emitted when response-processing is called.
236
223
  *
237
224
  */
238
225
  declare class QtiAssessmentItem extends LitElement {
@@ -243,6 +230,7 @@ declare class QtiAssessmentItem extends LitElement {
243
230
  readonly: boolean;
244
231
  title: string;
245
232
  identifier: string;
233
+ private _numAttempts;
246
234
  render(): lit_html.TemplateResult<1>;
247
235
  _handleDisabledChange: (_: boolean, disabled: boolean) => void;
248
236
  _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
@@ -255,7 +243,7 @@ declare class QtiAssessmentItem extends LitElement {
255
243
  set responses(myResponses: ResponseInteraction[]);
256
244
  resetInteractions(): void;
257
245
  validateResponses(): boolean;
258
- getVariable(identifier: string): VariableDeclaration<any>;
246
+ getVariable(identifier: string): VariableDeclaration<number | string | string[] | undefined>;
259
247
  getResponse(identifier: string): ResponseVariable | null;
260
248
  getOutcome(identifier: string): OutcomeVariable | null;
261
249
  private registerFeedbackElement;
@@ -598,14 +586,14 @@ declare class QtiResponseElseIf extends QtiResponseIf {
598
586
  render(): lit_html.TemplateResult<1>;
599
587
  }
600
588
 
601
- declare class QtiExpression<T> extends LitElement {
589
+ declare abstract class QtiExpression<T> extends LitElement {
602
590
  protected _error: any[];
603
591
  protected set error(val: string);
604
592
  static styles: lit.CSSResult;
605
593
  render(): lit_html.TemplateResult<1>;
606
594
  calculate(): T;
607
595
  protected get assessmentItem(): QtiAssessmentItem;
608
- protected getVariables: () => VariableDeclaration<string | string[]>[];
596
+ protected getVariables: () => VariableDeclaration<number | string | string[] | undefined>[];
609
597
  }
610
598
 
611
599
  declare class QtiGt extends QtiExpression<boolean> {
@@ -691,10 +679,10 @@ declare class QtiMatch extends QtiExpression<boolean> {
691
679
 
692
680
  declare class QtiVariable extends QtiExpression<number | string | string[]> {
693
681
  render(): lit_html.TemplateResult<1>;
694
- calculate(): any;
682
+ calculate(): string | number | string[];
695
683
  }
696
684
 
697
- declare class QtiMultiple extends QtiExpression<ResponseVariable[]> {
685
+ declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
698
686
  calculate(): ResponseVariable[];
699
687
  }
700
688
 
@@ -703,10 +691,11 @@ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
703
691
  }
704
692
 
705
693
  declare class QtPrintedVariable extends LitElement {
706
- value: string;
694
+ identifier: string;
695
+ value: string | string[] | number;
707
696
  render(): lit_html.TemplateResult<1>;
708
697
  constructor();
709
- calculate(): any;
698
+ calculate(): string | string[] | number;
710
699
  }
711
700
 
712
701
  declare class QtiMember extends QtiExpression<boolean | null> {