diff --git a/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx b/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx index 1c4493ac..44150618 100644 --- a/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx +++ b/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx @@ -129,9 +129,9 @@ export const ChooseAnswerModal = ({ onClick={() => { setOpenModal(false); - const question = listQuestions[quizId][totalIndex]; + const question = { ...listQuestions[quizId][totalIndex] }; - removeQuestionForce(quizId, totalIndex); + removeQuestionForce(quizId, question.id); createQuestion(quizId, selectedValue, totalIndex); updateQuestionsList(quizId, totalIndex, { expanded: question.expanded, diff --git a/src/pages/Questions/TypeQuestions.tsx b/src/pages/Questions/TypeQuestions.tsx index 36560307..2b5e8007 100755 --- a/src/pages/Questions/TypeQuestions.tsx +++ b/src/pages/Questions/TypeQuestions.tsx @@ -17,7 +17,7 @@ import { questionStore, updateQuestionsList, createQuestion, - removeQuestion, + removeQuestionForce, } from "@root/questions"; import type { @@ -110,12 +110,13 @@ export default function TypeQuestions({ totalIndex }: Props) { { - const question = listQuestions[quizId][totalIndex]; + const question = { ...listQuestions[quizId][totalIndex] }; - removeQuestion(quizId, totalIndex); + removeQuestionForce(quizId, question.id); createQuestion(quizId, value, totalIndex); updateQuestionsList(quizId, totalIndex, { expanded: question.expanded, + type: value, }); }} icon={icon}