refactor [P-36]: добавление картинок к ответам
This commit is contained in:
1 parent
a33f64835f
commit
72a4834e77
1 file changed
+35
-12
@@ -1,11 +1,13 @@
|
|||||||
/* eslint-disable vue/no-mutating-props */
|
|
||||||
<template>
|
<template>
|
||||||
<v-card class="mt-4 w-75 mx-auto d-flex flex-lg-column" style="min-height: 350px">
|
<v-card
|
||||||
|
class="mt-4 w-75 mx-auto d-flex flex-lg-column"
|
||||||
|
style="min-height: 450px; max-height: 700px"
|
||||||
|
>
|
||||||
<v-card-title class="text-h6 font-weight-bold">
|
<v-card-title class="text-h6 font-weight-bold">
|
||||||
Вопрос {{ currentQuestion + 1 }} из {{ totalQuestions }}
|
Вопрос {{ currentQuestion + 1 }} из {{ totalQuestions }}
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text>
|
<h3 class="mb-2 px-4">{{ question.name }}</h3>
|
||||||
<h3 class="mb-4">{{ question.name }}</h3>
|
<v-card-text style="overflow-y: scroll">
|
||||||
<v-img
|
<v-img
|
||||||
v-if="question.file"
|
v-if="question.file"
|
||||||
:src="`http://127.0.0.1:8000${question.file}`"
|
:src="`http://127.0.0.1:8000${question.file}`"
|
||||||
@@ -14,12 +16,20 @@
|
|||||||
|
|
||||||
<!-- Одиночный выбор -->
|
<!-- Одиночный выбор -->
|
||||||
<v-radio-group v-if="!isMultipleChoice" v-model="answers[currentQuestion]">
|
<v-radio-group v-if="!isMultipleChoice" v-model="answers[currentQuestion]">
|
||||||
<v-radio
|
<v-radio v-for="(option, index) in question.answers" :key="index">
|
||||||
v-for="(option, index) in question.answers"
|
<template v-slot:label>
|
||||||
:key="index"
|
<div class="text-center">
|
||||||
:label="option.name"
|
<v-img
|
||||||
:value="option.name"
|
v-if="option.file"
|
||||||
/>
|
:src="`http://127.0.0.1:8000${option.file}`"
|
||||||
|
class="mb-4"
|
||||||
|
max-height="140"
|
||||||
|
contain
|
||||||
|
/>
|
||||||
|
<span>{{ option.name }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</v-radio>
|
||||||
</v-radio-group>
|
</v-radio-group>
|
||||||
|
|
||||||
<!-- Множественный выбор -->
|
<!-- Множественный выбор -->
|
||||||
@@ -28,9 +38,22 @@
|
|||||||
v-for="(option, index) in question.answers"
|
v-for="(option, index) in question.answers"
|
||||||
:key="index"
|
:key="index"
|
||||||
v-model="answers[currentQuestion]"
|
v-model="answers[currentQuestion]"
|
||||||
:label="option.name"
|
|
||||||
:value="option.name"
|
:value="option.name"
|
||||||
/>
|
style="margin-bottom: -25px"
|
||||||
|
>
|
||||||
|
<template v-slot:label>
|
||||||
|
<div class="text-center">
|
||||||
|
<v-img
|
||||||
|
v-if="option.file"
|
||||||
|
:src="`http://127.0.0.1:8000${option.file}`"
|
||||||
|
class="mb-4"
|
||||||
|
max-height="140"
|
||||||
|
contain
|
||||||
|
/>
|
||||||
|
<span>{{ option.name }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</v-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions class="d-flex">
|
<v-card-actions class="d-flex">
|
||||||
|
|||||||
Reference in new issue
Block a user