From 74036550482d83f56d6dc22c63fa2a8ec1fa1349 Mon Sep 17 00:00:00 2001 From: Cja Date: Tue, 21 Jan 2025 11:41:52 +0300 Subject: [PATCH 1/5] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20create=5Fvote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/back/vote/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/back/vote/views.py b/src/back/vote/views.py index b6437b122..f47fe49da 100644 --- a/src/back/vote/views.py +++ b/src/back/vote/views.py @@ -113,7 +113,7 @@ class VoteCreate(APIView): questions = json.loads(request.data['questions']) for count, question_data in enumerate(questions, start=1): - question_image = questions_files.get(question_data['image']['name']) if 'image' in question_data else None + question_image = questions_files.get(question_data['image']['name']) if 'image' in question_data and question_data['image'] is not None else None question = Question.objects.create( name=question_data['text'], vote=vote, @@ -123,7 +123,7 @@ class VoteCreate(APIView): ) for answer in question_data['answers']: - answer_image = answers_files.get(answer['image']['name']) if 'image' in answer else None + answer_image = answers_files.get(answer['image']['name']) if 'image' in answer and answer['image'] is not None else None Answer.objects.create( name=answer['text'], file=answer_image, From 0ef6ed21e0aa5d605ac207a06ff3e0fe0317523c Mon Sep 17 00:00:00 2001 From: Denzel Date: Tue, 21 Jan 2025 11:46:28 +0300 Subject: [PATCH 2/5] ref --- src/front/src/components/vote/CurrentVote.vue | 8 ++-- src/front/src/components/vote/VoteResult.vue | 41 +++++++++++++++---- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/src/front/src/components/vote/CurrentVote.vue b/src/front/src/components/vote/CurrentVote.vue index 618750ac5..1e78374c3 100644 --- a/src/front/src/components/vote/CurrentVote.vue +++ b/src/front/src/components/vote/CurrentVote.vue @@ -32,10 +32,9 @@ -
-

{{ question.name }}

+ :step="question.numb"> +
+

{{ question.name }} (вариантов ответа: {{question.settings.multiChoice}})

-
diff --git a/src/front/src/components/vote/VoteResult.vue b/src/front/src/components/vote/VoteResult.vue index d30c80b49..d77b63410 100644 --- a/src/front/src/components/vote/VoteResult.vue +++ b/src/front/src/components/vote/VoteResult.vue @@ -1,8 +1,23 @@