import type { PieEnvironment } from '@pie-element/shared-types'; import type { NumberLineGraph, NumberLineModel, NumberLineResponse, NumberLineSession, NumberLineConfiguration } from '../types.js'; /** The environment, plus the accessibility settings a host may pass */ type NumberLineEnvironment = PieEnvironment & { accessibility?: { colorContrast?: string; }; }; /** A rule of the legacy partial scoring that `getScore` reads */ type PartialScoringRule = { numberOfCorrect: number; scorePercentage: number; }; /** The legacy question shape `getScore` reads: `partialScoring` holds rules, gated by `allowPartialScoring` */ type LegacyScoredQuestion = { correctResponse: NumberLineResponse[]; allowPartialScoring?: boolean; partialScoring?: PartialScoringRule[]; }; type Corrected = { /** Indices of the answers that match a correct response */ correct: number[]; /** Indices of the answers that match no correct response */ incorrect: number[]; /** Correct responses no answer matched */ notInAnswer: NumberLineResponse[]; noCorrectResponse?: boolean; }; type NumberLineCorrectness = 'unknown' | 'unanswered' | 'correct' | 'partial' | 'incorrect'; export type NumberLineValidationErrors = { teacherInstructions?: string; prompt?: string; widthError?: string; domainError?: string; maxError?: string; pointsError?: string; correctResponseError?: string; }; /** * Generates detailed trace log for scoring evaluation * @param {Object} model - the question model * @param {Object} session - the student session * @param {Object} env - the environment * @returns {Array} traceLog - array of trace messages */ export declare const getLogTrace: (model: NumberLineModel, session: NumberLineSession | null | undefined, env: PieEnvironment) => string[]; /** */ export declare function outcome(model: NumberLineModel, session: NumberLineSession | null | undefined, env: PieEnvironment): Promise<{ score: number; empty?: boolean; logTrace: string[]; }>; export declare function getScore(question: LegacyScoredQuestion, session: NumberLineSession | null | undefined): Promise<{ score: { scaled: number; }; }>; export declare const CLOSE_TO_PRECISION = 3; export declare const closeTo: (a: number, b: number, precision?: number) => boolean; export declare const getCorrected: (answer: NumberLineResponse[], correctResponse: NumberLineResponse[]) => Corrected; export declare const getCorrectness: (corrected: Corrected) => NumberLineCorrectness; /** * A sample of a normalize function see: * https://github.com/pie-framework/pie-elements/issues/21 */ export declare function normalize(question: NumberLineModel): { feedback: { correct: { default: string; type: "none"; }; incorrect: { default: string; type: "none"; }; partial: { default: string; type: "none"; }; }; correctResponse: NumberLineResponse[]; partialScoring?: boolean; graph: NumberLineGraph | { arrows: { left: true; right: true; }; availableTypes: { PF: true; }; domain: { min: number; max: number; }; exhibitOnly: false; initialElements: NumberLineResponse[]; initialType: "PF"; maxNumberOfPoints: number; ticks: { minor: number; major: number; tickIntervalType: "Decimal"; }; title: string; width: number; }; prompt: string; promptEnabled: boolean; spellCheckEnabled?: boolean; rationale: string; rationaleEnabled: boolean; teacherInstructions: string; teacherInstructionsEnabled: boolean; titleEnabled?: boolean; widthEnabled: boolean; toolbarEditorPosition: "bottom" | "top"; language?: string; extraCSSRules?: import("@pie-element/shared-types").ExtraCSSRules; colorContrast?: string; id: string; element: string; accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[]; }; export declare function createDefaultModel(model?: Partial): Promise>; export declare function model(question: NumberLineModel, session: NumberLineSession | null | undefined, env: NumberLineEnvironment): Promise>; export declare const createCorrectResponseSession: (question: NumberLineModel, env: PieEnvironment) => Promise; export declare const validate: (model?: Partial, config?: NumberLineConfiguration) => NumberLineValidationErrors; export {};