lessonInstance.component('question', {
data() {
return {
}
},
props: ['question', 'index',],
emits: ['selected-answer', 'select-word'],
computed: {
isActive: function () {
},
},
methods: {
testemit: function() {
console.dir('test msg')
}
},
// playAudio(word.post_meta.audio),
template: `<div :class="question.elem_type">
<div v-if="question.elem_type == 'list'"
v-for="word in question.words"
@click="$emit('testemit')"
class="word">
<word :word="word"></word>
</div>
<div v-if="question.elem_type == 'images'"
v-for="word in question.words"
@click="selectWord()"
class="word">
<wordImg :image="word.post_meta.image"></wordImg>
<word :word="word"></word>
</div>
<div v-if="question.elem_type == 'match'" class="matchContainer">
<match :question="question"></match>
</div>
</div>
<div class="buttons-block">
<div v-if="showCheckBlock" class="check">
<span @click="checkAnswer" >Проверить</span>
</div>
<div v-if="showNextBlock" class="next">
<div v-if="qResponse">
<p>верный ответ</p>
</div>
<div v-if="!qResponse">
<p>неверный ответ</p>
<p>Правильный ответ: {{ this.question.answer_true[0].post_title }}</p>
</div>
<span @click="$emit('selected-answer')">Далее</span>
</div>
</div>
`
})