2025-01-25 02:02:18 -05:00
|
|
|
import { TemplateOptions } from './types';
|
|
|
|
|
import QuestionContainer from './QuestionContainerTemplate';
|
|
|
|
|
import Title from './TitleTemplate';
|
|
|
|
|
import GlobalFeedbackTemplate from './GlobalFeedbackTemplate';
|
2025-01-25 14:19:31 -05:00
|
|
|
import { TextAreaStyle } from '../constants';
|
2025-01-25 02:02:18 -05:00
|
|
|
import { state } from '.';
|
|
|
|
|
import { EssayQuestion } from 'gift-pegjs';
|
2025-01-25 14:19:31 -05:00
|
|
|
import StemTemplate from './StemTemplate';
|
2025-01-25 02:02:18 -05:00
|
|
|
|
|
|
|
|
type EssayOptions = TemplateOptions & EssayQuestion;
|
|
|
|
|
|
|
|
|
|
export default function EssayTemplate({ title, formattedStem, formattedGlobalFeedback }: EssayOptions): string {
|
|
|
|
|
return `${QuestionContainer({
|
|
|
|
|
children: [
|
|
|
|
|
Title({
|
|
|
|
|
type: 'Développement',
|
|
|
|
|
title: title
|
|
|
|
|
}),
|
2025-01-25 14:19:31 -05:00
|
|
|
StemTemplate({formattedStem}),
|
2025-01-25 02:02:18 -05:00
|
|
|
`<textarea class="gift-textarea" style="${TextAreaStyle(
|
|
|
|
|
state.theme
|
|
|
|
|
)}" placeholder="Entrez votre réponse ici..."></textarea>`,
|
|
|
|
|
(formattedGlobalFeedback && formattedGlobalFeedback.text) ?
|
|
|
|
|
GlobalFeedbackTemplate(formattedGlobalFeedback) : ``
|
|
|
|
|
]
|
|
|
|
|
})}`;
|
|
|
|
|
}
|