fix: copyQuestion
This commit is contained in:
parent
2575d776a4
commit
2d944f8c47
@ -204,9 +204,11 @@ export const createQuestion = (quizId: number) => {
|
|||||||
export const copyQuestion = (quizId: number, copiedQuestionIndex: number) => {
|
export const copyQuestion = (quizId: number, copiedQuestionIndex: number) => {
|
||||||
const listQuestions = { ...questionStore.getState()["listQuestions"] };
|
const listQuestions = { ...questionStore.getState()["listQuestions"] };
|
||||||
|
|
||||||
listQuestions[quizId].push({
|
listQuestions[quizId].splice(
|
||||||
...listQuestions[quizId][copiedQuestionIndex],
|
copiedQuestionIndex,
|
||||||
});
|
0,
|
||||||
|
listQuestions[quizId][copiedQuestionIndex]
|
||||||
|
);
|
||||||
|
|
||||||
questionStore.setState({ listQuestions });
|
questionStore.setState({ listQuestions });
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user