brotherton-erpnext/erpnext/public/js/education/lms/components/Quiz/QuizSingleChoice.vue

29 lines
765 B
Vue
Raw Normal View History

2018-11-01 14:21:33 +00:00
<template>
<div class="question mt-4">
<h5>{{ question.question }}</h5>
<div class="options ml-2">
2018-11-02 07:21:51 +00:00
<div v-for="option in question.options" :key="option.name" class="form-check pb-1">
2018-11-02 10:59:04 +00:00
<input class="form-check-input" type="radio" :name="question.name" :id="option.name" :value="option.name" @change="emitResponse(question.name, option.name)">
2018-11-02 07:21:51 +00:00
<label class="form-check-label" :for="option.name">
2018-11-01 14:21:33 +00:00
{{ option.option }}
</label>
</div>
</div>
</div>
</template>
<script>
export default {
props: ['question'],
name: 'QuizSingleChoice',
2018-11-02 07:21:51 +00:00
methods: {
emitResponse(q, o) {
this.$emit('updateResponse', {'question':q , 'option': o})
}
}
2018-11-01 14:21:33 +00:00
};
</script>
<style lang="css" scoped>
</style>