analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
25 lines • 1.31 kB
TypeScript
import { type QuestionAnswerResult, type TrueOrFalseOptionState } from '../../Quiz/Quiz.types/index';
/**
* Helper function to format exam info (bank - year)
* @param examBoard - The exam board/bank name
* @param examYear - The exam year
* @returns Formatted string like "(ENEM - 2023)" or empty string if no info
*/
export declare const formatExamInfo: (examBoard: string | null | undefined, examYear: string | null | undefined) => string;
/**
* Shuffle array using a seed for consistent ordering per question
* Uses Fisher-Yates shuffle with seeded random for deterministic results
*/
export declare const shuffleWithSeed: <T>(array: T[], seed: string) => T[];
/**
* Helper to prepend letter to HTML content (handles <p> tags)
* @example prependLetterToHtml('a', '<p>Text</p>') => '<p>a) Text</p>'
* @example prependLetterToHtml('a', 'Text') => 'a) Text'
*/
export declare const prependLetterToHtml: (letter: string, html: string) => string;
/**
* Compute state for a true/false option
* Handles both interactive (default) and result modes
*/
export declare const getTrueOrFalseOptionState: (optionId: string, variant: string, currentQuestionResult: QuestionAnswerResult | null | undefined, localAnswers: Record<string, string>) => TrueOrFalseOptionState;
//# sourceMappingURL=Quiz.utils.d.ts.map