import * as lit from 'lit'; import { LitElement } from 'lit'; import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js'; import { a as QtiContextType, Q as QtiContext } from './qti.context.d-CejJMlfZ.js'; interface TestContext { items: (ItemContext & { category?: string; })[]; testOutcomeVariables?: VariableDeclaration[]; } declare const INITIAL_TEST_CONTEXT: Readonly; declare const testContext: { __context__: Readonly; }; type ExpressionVariable = ResponseVariable | VariableDeclaration; interface QtiExpressionBase { calculate(): Readonly; } declare abstract class QtiExpression extends LitElement implements QtiExpressionBase { #private; protected result: any; /** * What the last `calculate()` produced, or undefined if it has not run. * * This is the supported way to inspect a scoring run: process the responses, * then walk the rule tree reading this off each expression. A tool that wants * to visualise how a score came about gets the whole tree annotated with its * values, without the components having to re-render to show them. */ get lastResult(): Readonly | undefined; get lastVariables(): readonly ExpressionVariable[]; static styles: lit.CSSResult; render(): lit.TemplateResult<1>; protected shouldUpdate(): boolean; calculate(): Readonly; protected getResult(): Readonly; /** * The base type this operator always produces, when the QTI vocabulary fixes * one regardless of its operands — `qti-divide` is a float even dividing two * integers exactly, and `qti-round` is an integer whatever it rounds. * * Left undefined by operators whose result type follows their operands (a * `qti-sum` of integers is an integer) and by those that return no number at * all; the type is then read off the value. */ get resultBaseType(): BaseType | undefined; protected context?: ItemContext; protected qtiContext?: QtiContext; protected _testContext?: TestContext; /** * Resolve a declared variable from the closest available scope: item-level * first, then the test-level outcome variables. So an expression used in an * assessmentTest's outcome processing can reference a test-level outcome * (e.g. a total set earlier in the same run) — which the QTI variable * expression is specified to do. Returns null when unresolved rather than * throwing, so callers degrade gracefully. */ protected resolveVariable(identifier: string): VariableDeclaration | null; /** * `ITEMREF.VAR`: a variable of an individual item session, looked up by prefixing the variable * with the identifier the item ref gave the item (QTI 3 `qti-variable`), e.g. `Q01.SCORE`. An * item that was never presented has no variables, which resolves to NULL. Instances of a cloned * item (`Q01.2.SCORE`) are not supported: the item itself is used. */ private resolveItemVariable; getVariables: () => ExpressionVariable[]; } export { INITIAL_TEST_CONTEXT as I, QtiExpression as Q, type TestContext as T, type QtiExpressionBase as a, testContext as t };