import * as lit from 'lit'; import { LitElement, nothing } from 'lit'; import { b as QtiRuleBase } from './qti-rule-base.d-Bdzg8eGH.js'; import { b as ItemContext, B as BaseType, g as ResponseVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js'; import { Q as QtiExpression, a as QtiExpressionBase, T as TestContext } from './qti-expression.d-B-Cfbqlb.js'; import { Q as QtiConditionExpression } from './qti-condition-expression.d-B-T1NNl0.js'; import './qti.context.d-CejJMlfZ.js'; declare class QtiRule extends LitElement implements QtiRuleBase { render(): lit.TemplateResult<1>; process(): void; } declare global { interface HTMLElementTagNameMap { 'qti-rule': QtiRule; } } /** * The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained * by looking up the value of the associated expression in the lookupTable associated * with the outcome's declaration. */ declare class QtiLookupOutcomeValue extends QtiRule { #private; identifier: string; protected context?: ItemContext; get childExpression(): QtiExpression; process(): number | string | null; } declare global { interface HTMLElementTagNameMap { 'qti-lookup-outcome-value': QtiLookupOutcomeValue; } } /** * Shared logic for the QTI `responseCondition` / `outcomeCondition` family. * * Both conditions are structurally identical: a container that walks its * branches (if / else-if / else) in order and processes the sub-rules of the * first branch whose `shouldProcess()` returns true. The only difference * between response- and outcome- variants is the custom element tag name, so * the behaviour lives here and the concrete classes are empty subclasses that * `elements.ts` maps onto their tags. */ /** * A single branch of a condition (if / else-if / else). It owns the sub-rule * processing; subclasses decide whether the branch applies (`shouldProcess`) * and which of its children are sub-rules (`getSubRules`). */ declare abstract class QtiConditionBranchBase extends LitElement { render(): lit.TemplateResult<1>; /** Whether this branch's sub-rules should be processed. */ abstract shouldProcess(): boolean; /** The sub-rules to process when this branch applies. */ abstract getSubRules(): QtiRule[]; process(): void; } /** * The `else` branch: no condition (always applies), every child is a sub-rule. */ declare abstract class QtiConditionElseBase extends QtiConditionBranchBase { shouldProcess(): boolean; getSubRules(): QtiRule[]; } /** * The `if` / `else-if` branch: first child is the boolean expression, the * remaining children are the sub-rules processed when it evaluates to true. */ declare abstract class QtiConditionIfBase extends QtiConditionBranchBase { shouldProcess(): Readonly; getSubRules(): QtiRule[]; } /** * The condition container: walk branches in order, process the first whose * `shouldProcess()` is true, then stop. */ declare abstract class QtiConditionBase extends QtiRule { render(): lit.TemplateResult<1>; process(): void; } declare class QtiResponseCondition extends QtiConditionBase { } /** * Web component that processes `setOutcomeValue` in QTI. */ declare class QtiSetOutcomeValue extends QtiRule { #private; /** * Processes the QTI rule and dispatches a custom event with the computed outcome value. */ process(): void; } /** * Encapsulates the logic for processing QTI setOutcomeValue expressions. */ declare class QtiSetOutcomeValueRule implements QtiRuleBase { private expression; constructor(expression: QtiExpressionBase); /** * Evaluates the expression and returns its value. */ process(): string | string[] | null; } declare class QtiResponseElse extends QtiConditionElseBase { } declare class QtiResponseIf extends QtiConditionIfBase { } declare class QtiResponseElseIf extends QtiResponseIf { } declare class QtiOutcomeCondition extends QtiConditionBase { } declare class QtiOutcomeElse extends QtiConditionElseBase { } declare class QtiOutcomeIf extends QtiConditionIfBase { } declare class QtiOutcomeElseIf extends QtiOutcomeIf { } type Constructor$1 = new (...args: any[]) => T; declare const QtiAnd_base: { new (...args: any[]): { calculateChildren(children: Array>): boolean; }; } & Constructor$1; /** * @summary The qti-and operator evaluates multiple boolean expressions. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#and * * Takes 1 or more sub-expressions with base-type boolean and single cardinality. * Returns true if all sub-expressions are true, false if any are false. * Special cases: Returns NULL if any sub-expression is NULL and all others are true. */ declare class QtiAnd extends QtiAnd_base { calculate(): boolean; } type MockQtiExpression$1 = { calculate: () => T; }; type MockConstructor$1 = new (...args: any[]) => {}; declare function qtiAndMixin(Base: TBase): { new (...args: any[]): { calculateChildren(children: Array>): boolean; }; } & TBase; /** * @summary The qti-any-N operator checks if a specific range of expressions are true. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#anyN * * Takes 1 or more sub-expressions with base-type boolean and single cardinality. * Attributes 'min' and 'max' define the required range of true values. * Returns true if true count is within [min, max], false if outside this range. * Special cases: Returns NULL if validity cannot be determined due to NULL arguments. */ declare class QtiAnyN extends QtiExpression { min: number; max: number; getResult(): boolean | null; } declare class QtiBaseValue extends QtiExpression { baseType: BaseType; getResult(): string; } /** * @summary The qti-container-size operator returns the count of items in a container. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#containerSize * * Takes 1 sub-expression with multiple or ordered cardinality. * Returns a single integer representing the number of items. * Special cases: Returns 0 if the sub-expression is NULL. */ declare class QtiContainerSize extends QtiExpression { get resultBaseType(): BaseType; getResult(): number; } /** * @summary The qti-contains operator tests whether one container holds another. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#contains * * Takes 2 sub-expressions of the same base-type and the same cardinality, * either both multiple or both ordered. * * Cardinality decides what containment means. An unordered container holds * another when every one of its values is present, multiplicity included and * order disregarded: `[A,B,C]` contains `[C,A]`. An ordered container needs the * second to appear as a strict sub-sequence: `[A,B,C]` contains `[B,C]` but not * `[C,A]`. * * Special cases: Returns NULL if either sub-expression is NULL. */ declare class QtiContains extends QtiExpression { #private; getResult(): boolean | null; } declare global { interface HTMLElementTagNameMap { 'qti-contains': QtiContains; } } /** * @summary The qti-correct operator retrieves the defined correct response for a variable. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#correct * * Looks up the declaration for the identified response variable. * Returns the associated correctResponse value(s). * Special cases: Returns NULL if no correct response was declared. */ declare class QtiCorrect extends QtiExpression { get interpretation(): string; getResult(): string | string[]; } /** * @summary The qti-default operator retrieves the defined default value for a variable. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#default * * Looks up the declaration for the identified item variable. * Returns the associated defaultValue. * Special cases: Returns NULL if no default value was declared. */ declare class QtiDefault extends QtiExpression { identifier: string; protected context?: ItemContext; protected _testContext?: TestContext; getResult(): any; } /** * @summary The qti-equal-rounded operator compares two values after rounding. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#equalRounded * * Takes 2 sub-expressions with numerical base-types and single cardinality. * Requires 'figures' and 'rounding-mode' (decimalPlaces or significantFigures) attributes. * Returns true if equal after specified rounding, false otherwise. * Special cases: Returns NULL if either sub-expression is NULL. */ declare class QtiEqualRounded extends QtiExpression { roundingMode: 'decimalPlaces' | 'significantFigures'; get figures(): number; getResult(): boolean; } /** * @summary The qti-round operator rounds a numerical value to the nearest integer. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#round * * Takes 1 numerical sub-expression of single cardinality. * Returns integer n for input in range [n-0.5, n+0.5). * Special cases: Returns NULL if input is NULL or NaN. */ declare class QtiRound extends QtiExpression { get resultBaseType(): BaseType; getResult(): number | null; } /** * @summary The qti-round-to operator rounds a numerical value to specified precision. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.round-to * * Takes one sub-expression with single cardinality and numerical base-type. * Returns a single float rounded by the specified method to the specified precision. * Supports rounding to decimal places or significant figures. */ declare class QtiRoundTo extends QtiExpression { #private; roundingMode: 'decimalPlaces' | 'significantFigures'; figures: number; get resultBaseType(): BaseType; getResult(): number | null; } /** * @summary The qti-equal operator checks if two numerical expressions are equal. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#equal * * Takes 2 sub-expressions with numerical base-types and single cardinality. * Supports tolerance-mode (exact, absolute, relative) for floating-point comparisons, * with 'tolerance', 'include-lower-bound' and 'include-upper-bound'. * Returns true if numerically equal within specified tolerance, false otherwise. * Special cases: Returns NULL if either sub-expression is NULL. */ declare class QtiEqual extends QtiExpression { #private; toleranceMode: 'exact' | 'relative' | 'absolute'; /** One or two numbers: the lower and upper tolerance. One means both. */ tolerance: string; /** * Read off the attribute rather than declared as a Lit boolean property: QTI * writes `include-lower-bound="false"`, and Lit's boolean converter takes the * mere presence of an attribute as true. Both default to true, per the spec. */ get includeLowerBound(): boolean; get includeUpperBound(): boolean; getResult(): boolean; } /** * @summary The qti-divide operator performs numerical division. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#divide * * Takes exactly 2 sub-expressions with numerical base-types and single cardinality. * Returns a single float representing (first / second). * Special cases: Returns NULL if either sub-expression is NULL or if divisor is 0. */ declare class QtiDivide extends QtiExpression { #private; /** Always a float, even dividing two integers exactly. */ get resultBaseType(): BaseType; getResult(): number | null; } declare class QtiDurationGte extends QtiExpression { #private; getResult(): boolean | null; } /** * @summary The qti-duration-lt operator compares two time durations. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#durationLT * * Takes 2 sub-expressions with base-type duration and single cardinality. * Returns true if the first duration is shorter than the second. * Special cases: Returns NULL if either argument is NULL; handles variable precision. */ declare class QtiDurationLt extends QtiExpression { #private; getResult(): boolean | null; } /** * @summary The qti-gcd operator calculates the greatest common divisor of integer values. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.gcd * * Takes 1 or more sub-expressions with base-type integer and any cardinality. * Returns a single integer equal to the greatest common divisor of all argument values. * Special cases: gcd(0,0)=0, gcd(0,n)=n if n≠0, returns NULL if any argument is NULL or non-numerical. */ declare class QtiGcd extends QtiExpression { #private; getResult(): number | null; } declare class QtiGt extends QtiExpression { getResult(): boolean; } declare class QtiGte extends QtiConditionExpression { getResult(): boolean; } declare class QtiInside extends QtiExpression { #private; shape: string; coords: string; getResult(): boolean | null; } /** * @summary The qti-integer-divide operator performs integer division rounded down. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerDivide * * Takes 2 sub-expressions with base-type integer and single cardinality. * Returns result of (x / y) rounded down toward negative infinity. * Special cases: Returns NULL if any argument is NULL or if divisor is 0. */ declare class QtiIntegerDivide extends QtiExpression { #private; get resultBaseType(): BaseType; getResult(): number | null; } /** * @summary The qti-integer-modulus operator returns the remainder of integer division. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerModulus * * Takes 2 sub-expressions with base-type integer and single cardinality. * Returns the remainder that goes with qti-integer-divide, which rounds down. * Special cases: Returns NULL if any argument is NULL or if divisor is 0. */ declare class QtiIntegerModulus extends QtiExpression { #private; get resultBaseType(): BaseType; getResult(): number | null; } /** * @summary The qti-integer-to-float operator converts an integer to a float. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerToFloat * * Takes 1 sub-expression with base-type integer and single cardinality. * Returns a value of base-type float with the same numeric value. * Special cases: Returns NULL if sub-expression is NULL. */ declare class QtiIntegerToFloat extends QtiExpression { get resultBaseType(): BaseType; getResult(): number | null; } declare class QtiLcm extends QtiExpression { #private; getResult(): number | null; } /** * @summary The qti-null expression returns the NULL value. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.null * * A simple expression that returns the NULL value. The null value is treated * as if it is of any desired base-type. */ declare class QtiNull extends QtiExpression { getResult(): null; } /** * @summary The qti-is-null operator checks if a variable or expression is missing its value. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#isNull * * Takes 1 sub-expression with any base-type or cardinality. * Returns true if the sub-expression is NULL, false otherwise. * Special cases: Empty containers and empty strings are treated as NULL. */ declare class QtiIsNull extends QtiExpression { getResult(): boolean; } /** * @summary The qti-exit-response rule ends the response processing of an attempt. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.exit-response * * No rule after it runs, at any depth. The outcomes already set are kept: a * `qti-set-outcome-value` writes as it is processed, so everything before the * exit has landed by the time this throws. */ declare class QtiExitResponse extends QtiRule { process(): never; } declare global { interface HTMLElementTagNameMap { 'qti-exit-response': QtiExitResponse; } } /** * @summary The qti-exit-test rule ends the outcome processing of a test. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.exit-test * * The test-level counterpart of `qti-exit-response`. No rule after it runs, at * any depth, and the test outcomes already set are kept. */ declare class QtiExitTest extends QtiRule { process(): never; } declare global { interface HTMLElementTagNameMap { 'qti-exit-test': QtiExitTest; } } /** * @summary The qti-field-value operator retrieves a specific field from a record. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#fieldValue * * Takes a sub-expression with record cardinality. 'field-identifier' identifies the field. * Returns the value of the specified field. * Special cases: Returns NULL if sub-expression is NULL or field does not exist. */ declare class QtiFieldValue extends QtiExpression { #private; /** * The base type of the field last read: as declared on the record's correct response when it * is, otherwise read off the value. The value alone is a string like `"4.1"` or `"455 250"`, and * an operator reading it as text would refuse to compare it as a number or test it as a point. */ get resultBaseType(): BaseType | undefined; /** * Every failure here is NULL rather than a thrown error. `qti-is-null` over a * `qti-field-value` is the specified way to ask whether a record carries a * field at all, so a missing one has to be an ordinary value — throwing * aborted the whole response processing run instead. */ getResult(): any; } declare class QtiLt extends QtiExpression { getResult(): boolean; } declare class QtiLte extends QtiConditionExpression { getResult(): boolean; } /** * @summary The qti-map-response operator applies a mapping to a candidate's response. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#mapResponse * * Transforms the bound response variable using the declaration's qti-mapping. * Returns a single float representing the mapped score (or sum of mapped values). * Special cases: Returns 0.0 if response is NULL; counts identical values in containers once. */ declare class QtiMapResponse extends QtiExpression { identifier: string; getResult(): number; } declare class QtiMapResponsePoint extends QtiExpression { identifier: string; getResult(): number; } /** * @summary The qti-math-constant expression returns a mathematical constant. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.math-constant * * Takes no sub-expressions. The 'name' attribute selects the constant. * Returns a single float. * Special cases: Returns NULL for a name outside the vocabulary. */ declare class QtiMathConstant extends QtiExpression { name: string; get resultBaseType(): BaseType; getResult(): number | null; } declare global { interface HTMLElementTagNameMap { 'qti-math-constant': QtiMathConstant; } } /** * @summary The qti-math-operator performs mathematical operations on numerical values. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.math-operator * * Takes 1 or more sub-expressions with single cardinality and numerical base-types. * The result is a single float, except for signum, floor and ceil which return integers. * Returns NULL if any argument is NULL or falls outside the function's natural domain. */ declare class QtiMathOperator extends QtiExpression { #private; name: string; /** * Float for every function except the three that produce a whole number: * `floor`, `ceil` and `signum`. */ get resultBaseType(): BaseType; getResult(): number | null; } /** * @summary The qti-match operator compares two expressions for exact value equality. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#match * * Takes 2 sub-expressions which must have the same base-type and cardinality. * Returns true if they represent the same value, false otherwise. * Special cases: Must not be used for float or duration types; returns NULL if any argument is NULL. */ declare class QtiMatch extends QtiExpression { getResult(): boolean; static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable): boolean; } /** * @summary The qti-max operator finds the largest value in a numerical set. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#max * * Takes 1 or more numerical sub-expressions of any cardinality. * Returns the largest value in the collection. * Special cases: Returns NULL if any argument is NULL or non-numerical. */ declare class QtiMax extends QtiExpression { #private; getResult(): number | null; } declare class QtiMember extends QtiExpression { getResult(): boolean; } /** * @summary The qti-min operator finds the smallest value in a numerical set. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#min * * Takes 1 or more numerical sub-expressions of any cardinality. * Returns the smallest value in the collection. * Special cases: Returns NULL if any argument is NULL or non-numerical. */ declare class QtiMin extends QtiExpression { #private; getResult(): number | null; } declare class QtiMultiple extends QtiExpression[]> { getResult(): ResponseVariable[]; } /** * @summary The qti-not operator performs logical negation. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#not * * Takes exactly 1 sub-expression with base-type boolean and single cardinality. * Returns true if sub-expression is false, and false if sub-expression is true. * Special cases: Returns NULL if sub-expression is NULL. */ declare class QtiNot extends QtiExpression { render(): lit.TemplateResult<1>; getResult(): boolean; } /** * @summary The qti-or operator evaluates if any provided boolean expressions are true. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#or * * Takes 1 or more sub-expressions with base-type boolean and single cardinality. * Returns true if at least one sub-expression is true, false if all are false. * Special cases: Returns NULL if any sub-expression is NULL and all others are false. */ declare class QtiOr extends QtiConditionExpression { getResult(): boolean; } declare class QtiOrdered extends QtiExpression { getResult(): ResponseVariable[]; } /** * @summary The qti-power operator raises the first expression to the power of the second. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.power * * Takes 2 sub-expressions with single cardinality and numerical base-types. * Returns a single float corresponding to the first expression raised to the power of the second. * Returns NULL if either expression is NULL or if the result is outside the float value set. */ declare class QtiPower extends QtiExpression { get resultBaseType(): BaseType; getResult(): number | null; } /** * @summary The qti-pattern-match operator checks a string against a regular expression. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#patternMatch * * Takes 1 string sub-expression; 'pattern' attribute contains the regex. * Returns true if the string matches the pattern, false otherwise. * Special cases: Returns NULL if sub-expression is NULL. */ declare class QtiPatternMatch extends QtiExpression { #private; pattern: string; getResult(): boolean | null; } /** * @summary Prints the value of an item variable into the item body. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#printedVariable * * A container variable is printed as its values joined by `delimiter`; a record as * `namevalue` pairs joined by the same delimiter. A NULL variable — absent, * null, or an empty container — prints nothing at all. * * @attr {string} identifier - Required. Identifier of the variable to print. * @attr {string} [format] - printf-style conversion string, e.g. `%.2f` or `Score: %d`. Applies * to each value printed. Takes precedence over `base` and `power-form`. * @attr {number} [base=10] - Number base used when printing an integer variable. * @attr {number} [index] - 1-based index selecting a single value of an ordered variable. * @attr {boolean} [power-form=false] - Print numeric values in exponential form. * @attr {string} [field] - Field of a record variable to print, instead of the whole record. * @attr {string} [delimiter=;] - Separator between the values of an ordered/multiple/record variable. * @attr {string} [mapping-indicator==] - Separator between a record field's name and its value. */ declare class QtiPrintedVariable extends LitElement { #private; identifier: string; format?: string; base: number; index?: number; powerForm: boolean; field?: string; delimiter: string; mappingIndicator: string; protected context?: ItemContext; render(): lit.TemplateResult<1> | typeof nothing; calculate(): VariableDeclaration; } /** * @summary The qti-product operator calculates the product of multiple numerical values. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#product * * Takes 1 or more sub-expressions with numerical base-types and any cardinality. * Returns a single float (or integer if all arguments are integers). * Special cases: Returns NULL if any sub-expression is NULL. */ declare class QtiProduct extends QtiExpression { getResult(): number; } declare class QtiRepeat extends QtiExpression { #private; numberRepeats: string; getResult(): ResponseVariable[]; } /** * Web component that processes `setCorrectResponse` in QTI. */ declare class QtiSetCorrectResponse extends QtiRule { #private; /** * Processes the QTI rule and dispatches a custom event with the computed correct response value. */ process(): void; } /** * Encapsulates the logic for processing QTI setCorrectResponse expressions. */ declare class QtiSetCorrectResponseRule implements QtiRuleBase { #private; private expression; constructor(expression: QtiExpressionBase); /** * Evaluates the expression and returns its value. */ process(): unknown; } /** * Web component that processes `setTemplateValue` in QTI. */ declare class QtiSetTemplateValue extends QtiRule { #private; /** * Processes the QTI rule and dispatches a custom event with the computed template value. */ process(): void; } /** * Encapsulates the logic for processing QTI setTemplateValue expressions. */ declare class QtiSetTemplateValueRule implements QtiRuleBase { #private; private expression; constructor(expression: QtiExpressionBase); /** * Evaluates the expression and returns its value. */ process(): unknown; } /** * @summary The qti-stats-operator performs statistical calculations on a container. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#statsOperator * * Takes 1 container (multiple/ordered) of numerical base-type. * 'name' attribute identifies function (mean, median, popVariance, popSD, sampleVariance, sampleSD). * Returns result as a single float. * Special cases: Returns NULL if any values in container are NULL or non-numerical. */ declare class QtiStatsOperator extends QtiExpression { #private; name: string; get resultBaseType(): BaseType; getResult(): number | null; } type Constructor = new (...args: any[]) => T; declare const QtiSubtract_base: { new (...args: any[]): { calculateChildren(children: Array>): number; }; } & Constructor>; /** * @summary The qti-subtract operator performs numerical subtraction. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#subtract * * Takes exactly 2 sub-expressions with numerical base-types and single cardinality. * Returns (first - second) as a float, or integer if both inputs are integers. * Special cases: Returns NULL if either sub-expression is NULL. */ declare class QtiSubtract extends QtiSubtract_base { getResult(): number; } type MockQtiExpression = { calculate: () => T; }; type MockConstructor = new (...args: any[]) => {}; declare function qtiSubtractMixin(Base: TBase): { new (...args: any[]): { calculateChildren(children: Array>): number; }; } & TBase; declare global { interface HTMLElementTagNameMap { 'qti-subtract': QtiSubtract; } } /** * @summary The qti-substring operator checks if one string is contained within another. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#substring * * Takes 2 sub-expressions with base-type string and single cardinality. * Returns true if the first string is a substring of the second. * Special cases: Returns NULL if either argument is NULL. */ declare class QtiSubstring extends QtiExpression { caseSensitive: string; getResult(): boolean | null; } declare class QtiStringMatch extends QtiExpression { caseSensitive: string; getResult(): boolean; } /** * @summary The qti-sum operator calculates the total of multiple numerical values. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#sum * * Takes 1 or more sub-expressions with numerical base-types and any cardinality. * Returns a single float (or integer if all arguments are integers) representing the total. * Special cases: Returns NULL if any sub-expression is NULL. */ declare class QtiSum extends QtiExpression { getResult(): number; } declare class QtiSumExpression implements QtiExpressionBase { private expressions; constructor(expressions: QtiExpressionBase[]); calculate(): number; } /** * @summary The qti-truncate operator removes fractional parts of a number. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#truncate * * Takes 1 numerical sub-expression of single cardinality. * Returns integer formed by truncating value toward zero. * Special cases: Returns NULL if input is NULL or NaN. */ declare class QtiTruncate extends QtiExpression { get resultBaseType(): BaseType; getResult(): number | null; } declare class QtiVariable extends QtiExpression { getResult(): string | string[]; } /** * @summary The qti-random-integer operator selects a random integer from a specified range. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.random-integer * * Selects a random integer from the range [min,max] satisfying min + step * n for some integer n. * For example, with min=2, max=11 and step=3 the values {2,5,8,11} are possible. */ declare class QtiRandomInteger extends QtiExpression { min: number; max: number; step: number; getResult(): number; /** * Get all possible values for testing purposes */ getPossibleValues(): number[]; } declare class QtiRandom extends QtiExpression { getResult(): any; } /** * @summary The qti-delete operator removes all instances of a value from a container. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#delete * * Takes a single value (1st) and a container (2nd) of the same base-type. * Returns a new container derived from the 2nd with all instances of 1st removed. * Special cases: Returns NULL if either argument is NULL. */ declare class QtiDelete extends QtiExpression { getResult(): string[] | null; } /** * @summary The qti-index operator retrieves a specific item from an ordered container. * @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#index * * Takes 1 ordered container sub-expression; 'n' attribute specifies 1-based index. * Returns the nth value from the container with original base-type and single cardinality. * Special cases: Returns NULL if container is NULL or n exceeds container size. */ declare class QtiIndex extends QtiExpression { #private; n: string; getResult(): any; } /** * @summary The qti-response-processing-fragment groups rules for reuse. * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.response-processing-fragment * * A fragment is a transparent container: its rules run in place, in document * order, exactly as if they had been written where the fragment sits. * * A fragment held in a separate file is not pulled in, because `qti-include` is * not resolved — only the rules authored inside this element run. */ declare class QtiResponseProcessingFragment extends QtiRule { process(): void; } declare global { interface HTMLElementTagNameMap { 'qti-response-processing-fragment': QtiResponseProcessingFragment; } } export { QtiAnd, QtiAnyN, QtiBaseValue, QtiContainerSize, QtiContains, QtiCorrect, QtiDefault, QtiDelete, QtiDivide, QtiDurationGte, QtiDurationLt, QtiEqual, QtiEqualRounded, QtiExitResponse, QtiExitTest, QtiFieldValue, QtiGcd, QtiGt, QtiGte, QtiIndex, QtiInside, QtiIntegerDivide, QtiIntegerModulus, QtiIntegerToFloat, QtiIsNull, QtiLcm, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMathConstant, QtiMathOperator, QtiMax, QtiMember, QtiMin, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrdered, QtiOutcomeCondition, QtiOutcomeElse, QtiOutcomeElseIf, QtiOutcomeIf, QtiPatternMatch, QtiPower, QtiPrintedVariable, QtiProduct, QtiRandom, QtiRandomInteger, QtiRepeat, QtiResponseCondition, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessingFragment, QtiRound, QtiRoundTo, QtiSetCorrectResponse, QtiSetCorrectResponseRule, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSetTemplateValue, QtiSetTemplateValueRule, QtiStatsOperator, QtiStringMatch, QtiSubstring, QtiSubtract, QtiSum, QtiSumExpression, QtiTruncate, QtiVariable, qtiAndMixin, qtiSubtractMixin };