From 254994b929d36573467a83ead1e3fd2ee065ae07 Mon Sep 17 00:00:00 2001 From: Denis Voinovich Date: Tue, 3 Jun 2025 13:17:20 +0300 Subject: [PATCH] =?UTF-8?q?fix=20[P-01]:=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D1=8F=D0=B5=D0=BC=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D1=8B=20=D0=BF=D0=BE=20=D0=BD=D0=BE=D0=B2=D0=BE=D0=BC=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on_alter_testresult_answer.cpython-310.pyc | Bin 0 -> 840 bytes .../src/components/testing/DetailCardTest.vue | 29 +++++++++--------- 2 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 src/back/tests/migrations/__pycache__/0006_testresult_question_alter_testresult_answer.cpython-310.pyc diff --git a/src/back/tests/migrations/__pycache__/0006_testresult_question_alter_testresult_answer.cpython-310.pyc b/src/back/tests/migrations/__pycache__/0006_testresult_question_alter_testresult_answer.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44a4ecacf539a5868bb6b824c9e6827f71d201fa GIT binary patch literal 840 zcmYjP&2G~`5Z*sKwwqK{C6Ex@IGKZ!3!G5Zs8A#-dMPIhY2{=VW7k=yYe!Xkg%eU9 zgy-Nb_R5I|;DV@N)+S9>n(^$+H?uR}xE_rng6He^qfcj?kRR@{djwvNQJMr55TF%F zDSlbS7Chw(kqS!Q5a1xb5DxEnu*Am?2_<9Fh%15;A9HroH!Qb={C-I>oav@eJC@X*OtM|23^ZIqaB<~FHWYfUfXC|waRq4HmaBE|6acl z^Vs#})bF?BSvJ2McLR*KyB{OPFFHbd3bDtYL7BOlyODn4WO-xUA2>j1o}mf| { const answer = answers.value[questionIndex]; - if (answer === null) return; let selectedIds = []; - if (Array.isArray(answer)) { - selectedIds = answer.map((answerText) => { - const selectedAnswer = question.answers.find((a) => a.name === answerText); - return selectedAnswer ? selectedAnswer.id : null; - }).filter(Boolean); - } else { - const selectedAnswer = question.answers.find((a) => a.name === answer); - if (selectedAnswer) selectedIds = [selectedAnswer.id]; - } - if (selectedIds.length > 0) { - answersToSubmit.push({ - question_id: question.id, - answers_id: selectedIds, - }); + if (answer !== null) { + if (Array.isArray(answer)) { + selectedIds = answer.map((answerText) => { + const selectedAnswer = question.answers.find((a) => a.name === answerText); + return selectedAnswer ? selectedAnswer.id : null; + }).filter(Boolean); + } else { + const selectedAnswer = question.answers.find((a) => a.name === answer); + if (selectedAnswer) selectedIds = [selectedAnswer.id]; + } } + answersToSubmit.push({ + question_id: question.id, + answers_id: selectedIds, + }); }); const testMode = route.query.mode;