import type { ExtraCSSRules, PieEnvironment } from '@pie-element/shared-types'; import type { ChartingCategory, ChartingCategoryCorrectness, ChartingConfiguration, ChartingCorrectAnswer, ChartingModel, ChartingSession } from '../types.js'; /** The environment, plus the extra properties a host may ask the outcome for */ export type ChartingEnvironment = PieEnvironment & { extraProps?: { correctResponseEnabled?: boolean; }; }; /** A category marked correct or incorrect */ export type ScoredCategory = ChartingCategory & { correctness: ChartingCategoryCorrectness; }; /** A category whose value and label both match the correct answer */ export type ChartingCorrectResponse = { label: string; index?: number; }; export type ChartingScore = { score: number; answers: ScoredCategory[]; correctResponses?: ChartingCorrectResponse[]; }; export type ChartingValidationErrors = { teacherInstructions?: string; prompt?: string; rationale?: string; /** Category errors of the correct answer, keyed by category position */ categoryErrors?: Record; correctAnswerErrors?: { categoriesError?: string; identicalError?: string; }; }; /** What `model()` returns for the delivery view */ export type ChartingViewModel = { addCategoryEnabled?: boolean; chartType?: ChartingModel['chartType']; data: Omit[]; domain?: ChartingModel['domain']; graph?: ChartingModel['graph']; prompt?: string | null; range?: ChartingModel['range']; rationale?: string | null; title?: string; size?: ChartingModel['graph']; showToggle: boolean; correctness: { correctness: string; score: string; }; disabled: boolean; scoringType?: ChartingModel['scoringType']; studentNewCategoryDefaultLabel?: string; language?: string; env: ChartingEnvironment; extraCSSRules?: ExtraCSSRules; correctedAnswer?: Omit[]; correctAnswer?: ChartingCorrectAnswer; showKeyLegend?: boolean; teacherInstructions?: string | null; }; type ChartingOutcome = { score: number; empty: boolean; traceLog: string[]; extraProps?: { correctResponse?: ChartingCorrectResponse[]; }; }; export declare const checkLabelsEquality: (givenAnswerLabel?: string, correctAnswerLabel?: string) => boolean; export declare const setCorrectness: (answers: ChartingCategory[] | undefined, partialScoring: boolean) => ScoredCategory[]; export declare const normalize: (question: ChartingModel) => { addCategoryEnabled: boolean; chartType: import("../types.js").ChartingChartType; correctAnswer: ChartingCorrectAnswer; data: ChartingCategory[]; domain: import("../types.js").ChartingDomain; graph: import("../types.js").ChartingGraph; prompt: string; promptEnabled: boolean; range: import("../types.js").ChartingRange | { label: string; max: number; min: number; labelStep: number; }; rationale: string; rationaleEnabled: boolean; scoringType: "all or nothing" | "partial scoring"; studentInstructions?: string; studentInstructionsEnabled: boolean; teacherInstructions: string; teacherInstructionsEnabled: boolean; title: string; placeholderMessages?: import("../types.js").ChartingPlaceholderMessages; spellCheckEnabled?: boolean; rubricEnabled?: boolean; changeInteractiveEnabled: boolean; changeEditableEnabled: boolean; changeAddCategoryEnabled: boolean; studentNewCategoryDefaultLabel: string; language?: string; extraCSSRules?: ExtraCSSRules; id: string; element: string; accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[]; }; export declare const getScore: (question: ChartingModel, session: ChartingSession | null | undefined, env?: Partial) => ChartingScore; /** * 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: ChartingModel, session: ChartingSession | null | undefined, env: ChartingEnvironment) => string[]; export declare const filterCategories: (categories?: T[]) => Omit[]; export declare function model(question: ChartingModel, session: ChartingSession | null | undefined, env: ChartingEnvironment): Promise; export declare function outcome(model: ChartingModel, session: ChartingSession | null | undefined, env: ChartingEnvironment): Promise; export declare const createCorrectResponseSession: (question: ChartingModel, env: ChartingEnvironment) => Promise; export declare const validate: (model?: Partial, config?: ChartingConfiguration) => ChartingValidationErrors; export {};