2024-03-29 20:08:34 -04:00
|
|
|
import { TemplateOptions, MultipleChoice as MultipleChoiceType } from './types';
|
|
|
|
|
import QuestionContainer from './QuestionContainer';
|
|
|
|
|
import GlobalFeedback from './GlobalFeedback';
|
|
|
|
|
import Title from './Title';
|
2024-09-23 15:55:37 -04:00
|
|
|
import textType from './TextType';
|
2024-03-29 20:08:34 -04:00
|
|
|
import MultipleChoiceAnswers from './MultipleChoiceAnswers';
|
|
|
|
|
import { ParagraphStyle } from '../constants';
|
|
|
|
|
import { state } from '.';
|
|
|
|
|
|
|
|
|
|
type MultipleChoiceOptions = TemplateOptions & MultipleChoiceType;
|
|
|
|
|
|
|
|
|
|
export default function MultipleChoice({
|
|
|
|
|
title,
|
|
|
|
|
stem,
|
|
|
|
|
choices,
|
|
|
|
|
globalFeedback
|
|
|
|
|
}: MultipleChoiceOptions): string {
|
|
|
|
|
return `${QuestionContainer({
|
|
|
|
|
children: [
|
|
|
|
|
Title({
|
|
|
|
|
type: 'Choix multiple',
|
|
|
|
|
title: title
|
|
|
|
|
}),
|
2024-09-23 15:55:37 -04:00
|
|
|
`<p style="${ParagraphStyle(state.theme)}">${textType({
|
2024-03-29 20:08:34 -04:00
|
|
|
text: stem
|
|
|
|
|
})}</p>`,
|
|
|
|
|
MultipleChoiceAnswers({ choices: choices }),
|
|
|
|
|
GlobalFeedback({ feedback: globalFeedback })
|
|
|
|
|
]
|
|
|
|
|
})}`;
|
|
|
|
|
}
|