fix: 2 bugs
This commit is contained in:
parent
81fd62c85b
commit
9aa6fbf411
@ -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<QuizQuestionBase>(quizId, totalIndex, {
|
||||
expanded: question.expanded,
|
||||
|
||||
@ -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) {
|
||||
<QuestionsMiniButton
|
||||
key={title}
|
||||
onClick={() => {
|
||||
const question = listQuestions[quizId][totalIndex];
|
||||
const question = { ...listQuestions[quizId][totalIndex] };
|
||||
|
||||
removeQuestion(quizId, totalIndex);
|
||||
removeQuestionForce(quizId, question.id);
|
||||
createQuestion(quizId, value, totalIndex);
|
||||
updateQuestionsList<QuizQuestionBase>(quizId, totalIndex, {
|
||||
expanded: question.expanded,
|
||||
type: value,
|
||||
});
|
||||
}}
|
||||
icon={icon}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user