UNPKG

@openhpi/quiz-recap

Version:

Component for quiz recapitulation in education.

51 lines (41 loc) 1.42 kB
export declare type AnswerType = { id: string; correct: boolean; text: string; }; export declare type ContextType = { quizEnded: boolean; setQuizEnded: React.Dispatch<React.SetStateAction<boolean>>; results: ResultType[]; setResults: React.Dispatch<React.SetStateAction<ResultType[]>>; numberOfQuestions: number; setNumberOfQuestions: React.Dispatch<React.SetStateAction<number>>; setQuizStarted: React.Dispatch<React.SetStateAction<boolean>>; questionsPool: QuestionPoolType[]; setQuestionsPool: React.Dispatch<React.SetStateAction<QuestionPoolType[]>>; }; export declare type Data = QuestionType[]; export declare type QuestionPoolType = QuestionType & { remainingAttempts: number; correctlyAnswered: boolean; }; export declare type QuestionType = { id: string; type: QuizType; text: string; answers: AnswerType[]; referenceLink?: string; }; export declare enum QuestionTypes { MultipleChoice = "multiple-choice", SingleChoice = "single-choice" } export declare type QuizType = QuestionTypes.MultipleChoice | QuestionTypes.SingleChoice; declare const renderQuizRecap: (id: string, data: Data, locale?: string) => void; export default renderQuizRecap; export declare type ResultType = { id: string; question: QuestionPoolType; selections: AnswerType[]; }; export { }