| | |
| | | </div> |
| | | |
| | | <ul class="subject-options" |
| | | id="subjectOptions" |
| | | v-for="option in options" |
| | | :key="option.id"> |
| | | <li class="subject-option"> |
| | | <input class="toggle" |
| | | <input |
| | | :disabled="currentAnswer" |
| | | class="toggle" |
| | | type="checkbox" |
| | | :checked="userAnswer === option.optionName" |
| | | :id="'option' + option.id" |
| | |
| | | }, |
| | | options: [], |
| | | userAnswer: '', |
| | | index: '' |
| | | index: '', |
| | | currentAnswer: false, |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.userAnswer = answer |
| | | }, |
| | | setSubjectInfo (subject, subjectCount, index) { |
| | | this.currentAnswer = false |
| | | this.subjectCount = subjectCount |
| | | this.subjectInfo = subject |
| | | if (subject.hasOwnProperty('examSubjectOptions')) { |
| | |
| | | console.log(this.options) |
| | | } |
| | | if (subject.hasOwnProperty('answer')) { |
| | | console.log(subject.answer); |
| | | if (subject.answer) { |
| | | this.currentAnswer = true |
| | | } |
| | | this.setAnswer(subject.answer) |
| | | } |
| | | this.index = index + '.' |