Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
<div class="vote_edit">
<div class="formpart" tabindex="0" ref="autofocus">
{{ $gettext('Frage') }}
<studip-wysiwyg v-model="val_clone.description" :key="question_id"></studip-wysiwyg>
</div>
<input-array v-model="val_clone.options"></input-array>
<label>
<input type="checkbox" v-model.number="val_clone.multiplechoice" true-value="1" false-value="0">
{{ $gettext('Mehrere Antworten sind erlaubt') }}
</label>
<label>
<input type="checkbox" v-model.number="val_clone.mandatory" true-value="1" false-value="0">
{{ $gettext('Pflichtfrage') }}
</label>
<label>
<input type="checkbox" v-model.number="val_clone.randomize" true-value="1" false-value="0">
{{ $gettext('Antworten den Teilnehmenden zufällig präsentieren') }}
</label>
</div>
</template>
<script>
import StudipWysiwyg from "../StudipWysiwyg.vue";
import InputArray from "./InputArray.vue";
export default {
name: 'vote-edit',
components: {
StudipWysiwyg,
InputArray
},
props: {
value: {
type: Object,
required: false,
default: function () {
return {};
}
},
question_id: {
type: String,
required: false
}
},
data: function () {
return {
val_clone: {}
};
},
mounted: function () {
this.val_clone = this.value;
if (!this.value.description) {
this.$emit('input', {
multiplechoice: 1,
options: ['', '', '', '']
});
}
this.$refs.autofocus.focus();
},
watch: {
value (new_val) {
this.val_clone = new_val;
}
}
}
</script>