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) => {
|
||||
const listQuestions = { ...questionStore.getState()["listQuestions"] };
|
||||
|
||||
listQuestions[quizId].push({
|
||||
...listQuestions[quizId][copiedQuestionIndex],
|
||||
});
|
||||
listQuestions[quizId].splice(
|
||||
copiedQuestionIndex,
|
||||
0,
|
||||
listQuestions[quizId][copiedQuestionIndex]
|
||||
);
|
||||
|
||||
questionStore.setState({ listQuestions });
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user