Administrator
2021-08-17 90cf4906f4eb91d82aa08045f52c278dc0926eb5
src/components/Subjects/Choices/index.vue
@@ -11,10 +11,13 @@
            </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"
@@ -42,7 +45,8 @@
            },
            options: [],
            userAnswer: '',
            index: ''
            index: '',
            currentAnswer: false,
        }
    },
    methods: {
@@ -53,6 +57,7 @@
            this.userAnswer = answer
        },
        setSubjectInfo (subject, subjectCount, index) {
            this.currentAnswer = false
            this.subjectCount = subjectCount
            this.subjectInfo = subject
            if (subject.hasOwnProperty('examSubjectOptions')) {
@@ -61,7 +66,9 @@
                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 + '.'