Skip to content
Snippets Groups Projects
Commit cb132bc1 authored by BURCKEL MAXIME's avatar BURCKEL MAXIME
Browse files

fix display answers in scrum and team mode

parent 20abc152
Branches
No related merge requests found
......@@ -803,7 +803,7 @@ export default function AdvancedQuizCreation() {
onClick={handlePublishQuiz}
className="w-full bg-green-500 text-white py-2 rounded-md shadow-md hover:bg-green-600"
>
Update
Edit
</button>
</div>
......
......@@ -210,19 +210,31 @@ export default function QuizQuestionPage() {
/>
<div className="w-full max-w-md space-y-4 mt-4">
{currentQuestion.answers.map((option, index) => (
<AnswerOption
key={index}
label={String.fromCharCode(65 + index)}
text={option.text}
isCorrect={
correctAnswer?.isCorrect &&
option.text === selectedAnswer?.text
}
isSelected={option.id === selectedAnswer?.id}
onClick={() => handleAnswerSelect(option)}
/>
))}
{currentQuestion.answers.map((option, index) => {
const correct = correctAnswer?.correctAnswer;
const isCorrectOption =
correctAnswer?.isCorrect && option.id === selectedAnswer?.text;
const correctAnswerReveal = currentQuestion.answers.find(
(reponse) => reponse.id == correctAnswer?.correctAnswer
);
return (
<AnswerOption
key={index}
label={String.fromCharCode(65 + index)}
type={
currentQuestion.answerType as "text" | "sound" | "image"
}
text={option.text}
ressource={option?.ressource}
isCorrect={option.id === correct || false}
isSelected={option.id === selectedAnswer?.id || false}
onClick={() => handleAnswerSelect(option)}
showResult={!isLoading && isSubmitted}
correctAnswer={correctAnswerReveal?.id} // Transmettre la bonne réponse
answerId={option.id}
/>
);
})}
</div>
<NextButton onClick={handleNext} isSubmitted={isSubmitted} />
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment