fix: test

This commit is contained in:
sajjadtalkhabi
2026-05-28 15:40:22 +03:30
parent fc0aa2586e
commit 3f3c66a02d
25 changed files with 406 additions and 104 deletions
@@ -134,7 +134,7 @@ const blankOption = () => ({ id: createId('option'), optionText: '', isCorrect:
const blankQuestion = () => ({
id: createId('question'),
questionText: '',
position: 1,
score: '',
options: [blankOption(), { ...blankOption(), id: createId('option') }],
__local: true,
})
@@ -172,7 +172,7 @@ const normalizeExistingQuestions = (raw = []) => {
return {
id: q.id ?? createId(`question-${qIdx}`),
questionText: q.questionText || '',
position: q.position ?? qIdx + 1,
score: q.score ?? '',
options: options.map((o, oIdx) => ({
id: o.id ?? createId(`option-${qIdx}-${oIdx}`),
optionText: o.optionText || '',
@@ -220,7 +220,8 @@ const validateLocalQuestions = () => {
questionError.value = ''
return localOnes.map((q, idx) => ({
questionText: q.questionText.trim(),
position: Number(q.position) || idx + 1,
position: idx + 1,
score: Number(q.score) || 0,
options: q.options
.filter((o) => String(o.optionText || '').trim())
.map((o) => ({