考试-理论

This commit is contained in:
Yuan 2022-10-24 15:31:54 +08:00
parent 8976cfd474
commit 4e0635b7ad
2 changed files with 33 additions and 7 deletions

View File

@ -4,6 +4,16 @@
<div>满分: {{ composition.fullScore }}</div>
<div>考试时间: {{ composition.validDuration }}分钟</div>
</div>
<div class="legend-area">
<div class="legend">
<div class="box finished"></div>
<div class="text">已作答</div>
</div>
<div class="legend">
<div class="box"></div>
<div class="text">未作答</div>
</div>
</div>
<div>理论题</div>
<div class="questionList">
<div
@ -46,8 +56,7 @@
: {}
"
@submit="recordSubmit"
@prev="currentQuestionIndex--"
@next="currentQuestionIndex++"
@navigate="navigate"
/>
</div>
</template>
@ -92,8 +101,10 @@ export default {
this.$refs.theoryQuestion.doShow()
}
},
recordSubmit(index, direction) {
recordSubmit(index) {
this.$set(this.questionStateList[0], index, true)
},
navigate(direction) {
if (direction === '+') {
this.currentQuestionIndex++
} else if (direction === '-') {
@ -140,6 +151,21 @@ export default {
.header {
padding: 10px;
}
.legend-area {
display: flex;
justify-content: space-evenly;
.legend {
display: flex;
.box {
width: 1rem;
height: 1rem;
background: #eee;
}
.finished {
border: 1px solid #67c23a;
}
}
}
.questionList {
display: flex;
flex-wrap: wrap;

View File

@ -116,11 +116,11 @@ export default {
},
navigate(direction) {
const selected = this.type === 2 ? !!this.questionData.answer.length : !isNaN(this.questionData.answer)
if (!selected) {
return
if (selected) {
this.submit()
this.$emit('submit', this.index, direction)
}
this.submit()
this.$emit('submit', this.index, direction)
this.$emit('navigate', direction)
if (!direction) this.doClose()
},
},