import type { ExtraCSSRules, PieEnvironment } from '@pie-element/shared-types'; import type { SelectTextConfiguration, SelectTextModel, SelectTextSession, TextToken } from '../types.js'; type ResponseCorrectness = 'unknown' | 'correct' | 'partially-correct' | 'incorrect'; /** A token as the delivery view receives it; `correct` and `isMissing` are set in evaluate mode only. */ type TokenView = Omit & { correct: boolean | undefined; isMissing: boolean | undefined; }; /** The model the delivery view receives. */ type ModelView = { tokens: TokenView[]; highlightChoices?: boolean; prompt: string | null | undefined; text: string; disabled: boolean; maxSelections?: number; correctness: ResponseCorrectness | undefined; env: PieEnvironment; feedback: string | undefined; incorrect: boolean | undefined; language?: string; extraCSSRules?: ExtraCSSRules; rationale?: string | null; teacherInstructions?: string | null; }; type Outcome = { score: number | undefined; empty?: boolean; completed?: undefined; logTrace: string[]; }; /** Errors `validate()` reports, keyed by field. */ export type SelectTextValidationErrors = { teacherInstructions?: string; prompt?: string; rationale?: string; tokensError?: string; selectionsError?: string; }; /** The session `model()` works on; without a session it starts from one carrying `selectedToken`. */ type ModelSession = SelectTextSession & { selectedToken?: TextToken[]; }; export declare const getCorrectness: (tokens: TextToken[], selected: TextToken[]) => ResponseCorrectness; export declare const getPartialScore: (question: SelectTextModel, session: SelectTextSession | undefined, totalCorrect: TextToken[]) => number; /** * Generates detailed trace log for select-text scoring evaluation * @param {Object} question - the question model * @param {Object} session - the student session * @param {Object} env - the environment * @returns {Array} traceLog */ export declare const getLogTrace: (question: SelectTextModel, session: SelectTextSession | undefined, env: PieEnvironment) => string[]; export declare const outcome: (question: SelectTextModel, session: SelectTextSession | undefined, env: PieEnvironment) => Promise; export declare function createDefaultModel(model?: Partial): Promise>; export declare const normalizeSession: (session: SelectTextSession | undefined) => { id?: string; element?: string; selectedTokens: TextToken[]; }; export declare const normalize: (question: SelectTextModel) => { maxSelections: number; mode: "sentence" | "words" | "paragraphs" | "word" | "paragraph" | ""; partialScoring: boolean; feedback?: import("../types.js").ComplexFeedbackType; tokens: TextToken[]; text: string; prompt: string; promptEnabled: boolean; highlightChoices: boolean; rationale: string; scoringType: "auto" | "rubric"; studentInstructions?: string; teacherInstructions: string; feedbackEnabled: boolean; rationaleEnabled: boolean; studentInstructionsEnabled: boolean; teacherInstructionsEnabled: boolean; spellCheckEnabled?: boolean; toolbarEditorPosition: "bottom" | "top"; rubricEnabled?: boolean; language?: string; extraCSSRules?: ExtraCSSRules; id: string; element: string; accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[]; }; export declare const model: (question: SelectTextModel, session: ModelSession | null | undefined, env: PieEnvironment) => Promise; export declare const createCorrectResponseSession: (question: SelectTextModel, env: PieEnvironment) => Promise; export declare const validate: (model?: Partial, config?: SelectTextConfiguration) => SelectTextValidationErrors; export {};