@@ -198,7 +198,6 @@ const normalizeExistingQuestions = (raw = []) => {
|
||||
optionText: o.optionText || '',
|
||||
isCorrect: !!o.isCorrect,
|
||||
})),
|
||||
// No `__local` flag — these came from the server, so the builder will lock them.
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -280,7 +279,6 @@ const submitting = computed(
|
||||
|
||||
const postQuestionsSequentially = async (id, list) => {
|
||||
for (const payload of list) {
|
||||
// Sequential so question position ordering is preserved on the backend.
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await addQuestionMutation.mutateAsync({ examId: id, payload })
|
||||
}
|
||||
@@ -302,7 +300,7 @@ const onSubmit = async () => {
|
||||
if (targetExamId && newQuestions.length > 0) {
|
||||
await postQuestionsSequentially(targetExamId, newQuestions)
|
||||
}
|
||||
await queryClient.invalidateQueries({ queryKey: adminExamsKeys.all })
|
||||
await queryClient.invalidateQueries({ queryKey: adminExamsKeys.all, refetchType: 'all' })
|
||||
router.push({ name: 'admin-exams' })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user