|
@@ -139,15 +139,198 @@
|
|
|
<button v-if="!closeTest" class="submitBtn" :class="{ hintClick: hintHandon()}">{{$t("studentWeb.exam.testpop.finish")}}</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Row :gutter="30">
|
|
|
+ <Row :gutter="30" v-if="instantPaper" style="height: calc(100% - 40px);" class="instant-paper-box">
|
|
|
+ <i-col class="instant-paper" :xs="24" :sm="24" :md="12" :lg="14">
|
|
|
+ <vuescroll>
|
|
|
+ <div class="img-wrap">
|
|
|
+ <div v-for="(img, index) in imgList" :key="index" class="left-img" @click="$hevueImgPreview(img)">
|
|
|
+ <img :src="img" alt="">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </vuescroll>
|
|
|
+ </i-col>
|
|
|
+ <i-col class="instant-exam" :xs="24" :sm="24" :md="12" :lg="10">
|
|
|
+ <div v-if="!showExam.length" style="text-align: center; margin-top: 25%; font-size: 20px;">
|
|
|
+ {{ $t("studentWeb.exam.testpop.noExam") }}
|
|
|
+ </div>
|
|
|
+ <template v-else>
|
|
|
+ <vuescroll>
|
|
|
+ <div class="instant-exam-box">
|
|
|
+ <div class="questionContent qamode-box" ref="questionBox" v-for="(item, index) in showExam" :key="index">
|
|
|
+ <div class="questioDes">
|
|
|
+ <div class="que-item" v-if="item.type != 'compose' && item.parent === undefined">
|
|
|
+ <span v-if="isWrong" @click="changeStar(!item.star, index)" style="margin-right: 10px; cursor: pointer;">
|
|
|
+ <Icon custom="iconfont icon-shoucang1" size="25" v-show="!item.star" />
|
|
|
+ <Icon custom="iconfont icon-shoucang2" size="25" color="#FF7A4E" v-show="item.star" />
|
|
|
+ </span>
|
|
|
+ <span v-if="!['single', 'multiple', 'judge'].includes(item.type)">{{ index + 1 }}. </span>
|
|
|
+ <div class="questionType" v-if="item.parent === undefined && (index === 0 ? true : item.type != showExam[index-1].type)">
|
|
|
+ <span>{{getTestType(item.type)}}</span>
|
|
|
+ <span v-if="item.type === 'subjective' && item.answerType">-{{ $t(`evaluation.newExercise.answerType.${item.answerType}`) }}</span>
|
|
|
+ </div>
|
|
|
+ <!--题目渲染-->
|
|
|
+ <!-- <div id="answer-box" v-html="item.question"></div> -->
|
|
|
+ </div>
|
|
|
+ <!-- 无综合题 -->
|
|
|
+ </div>
|
|
|
+ <div class="answers-box">
|
|
|
+ <!--判断题选项-->
|
|
|
+ <div v-if="item.type == 'judge'" align="center">
|
|
|
+ <span>{{ index + 1 }}. </span>
|
|
|
+ <label class="testBtn yesNoBtn">
|
|
|
+ <input type="radio" value="A" v-model="checkers[index][0]" :disabled="!closeTest" />
|
|
|
+ <div class="testbg" :style="{'background-color': isWrong && showEnd && checkers[index][0] === 'A' ? (item.answer[0] === 'A' ? '' : 'red !important') : ''}">
|
|
|
+ <!-- <Icon type="ios-radio-button-off" /> -->
|
|
|
+ <Icon type="md-checkmark" />
|
|
|
+ </div>
|
|
|
+ </label>
|
|
|
+ <label class="testBtn yesNoBtn">
|
|
|
+ <input type="radio" value="B" v-model="checkers[index][0]" :disabled="!closeTest" />
|
|
|
+ <div class="testbg" :style="{'background-color': isWrong && showEnd && checkers[index][0] === 'B' ? (item.answer[0] === 'B' ? '' : 'red !important') : ''}">
|
|
|
+ <Icon type="md-close" />
|
|
|
+ </div>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <!--选择题选项-->
|
|
|
+ <div class="select-box" v-else-if="item.type === 'single' || item.type === 'multiple'">
|
|
|
+ <span>{{ index + 1 }}. </span>
|
|
|
+ <label class="testBtn" v-for="(option, oIndex) in item.option" :key="oIndex">
|
|
|
+ <input type="checkbox" :value="option.code" v-model="checkers[index]" @click="getAns(index, oIndex)" :disabled="!closeTest" />
|
|
|
+ <div class="testbg">
|
|
|
+ <div style="display:flex">
|
|
|
+ <span>{{ option.code }}</span>
|
|
|
+ <div v-html="option.value" @click.stop.native.prevent="showImg($event)"></div>
|
|
|
+ <span v-show="showEnd" style="margin-left: 5px;">
|
|
|
+ <Icon type="md-checkmark-circle" color="#44b5f9" size="20" v-if="item.answer.includes(option.code)" />
|
|
|
+ <Icon type="md-close-circle" color="red" size="20" v-if="checkers[index].includes(option.code) && !item.answer.includes(option.code)" />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div style="clear:both"></div>
|
|
|
+ </div>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <!--问答题-->
|
|
|
+ <div class="compose-content" v-else-if="item.type === 'subjective'">
|
|
|
+ <!-- item.answerType: text(文本) Image(图片) file(文件) audio(音频 useAutoScore(自动评分) answerLang(语言)) -->
|
|
|
+ <!-- <template v-if="item.answerType === 'text' || item.answerType === 'text_Image'"> -->
|
|
|
+ <Input v-if="item.answerType === 'text'" v-model="checkers[index][0]" type="textarea" :rows="5" :autosize="{minRows: 5,maxRows: 10}" :placeholder="$t('studentWeb.exam.inputAnswers')"></Input>
|
|
|
+ <Compose v-else-if="item.answerType === 'text_Image'" ref="compose" :itemInfo="item" :close="!closeTest" :textData="checkers[index]" :index="index" @dataGet="getComposeAns"></Compose>
|
|
|
+ <!-- </template> -->
|
|
|
+ <template v-else-if="item.answerType === 'audio'">
|
|
|
+ <AudioRecorder :textData="checkers[index]" :index="index" @dataGet="getComposeAns" />
|
|
|
+ </template>
|
|
|
+ <template v-else-if="item.answerType === 'file' || item.answerType === 'image'">
|
|
|
+ <Upload type="drag" :accept="subjectiveAccept" action="" :before-upload="file => customUpload(file, index)">
|
|
|
+ <div style="padding: 20px 0" ref="upload1">
|
|
|
+ <Icon type="ios-cloud-upload" size="52" :style="{color: checkers[index].length ? '#b4b4b4' : '#2d8cf0' }"></Icon>
|
|
|
+ <p>
|
|
|
+ <span>
|
|
|
+ {{ checkers[index].length ? $t('jyzx.offline.againLoad') : $t('studentWeb.art.relatedFile')}}
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </Upload>
|
|
|
+ <div class="repair-link-wrap-item-box" v-if="checkers[index].length">
|
|
|
+ <div class="file-icon">
|
|
|
+ <img :src="$tools.getFileThum(getFileType(checkers[index][0]), getFileName(checkers[index][0]))"/>
|
|
|
+ </div>
|
|
|
+ <div class="file-info">
|
|
|
+ <p class="file-name">{{ getFileName(checkers[index][0]) }}</p>
|
|
|
+ <div>
|
|
|
+ <span @click="onPreview(checkers[index][0], true)">{{ $t('ability.review.preview')}}</span>
|
|
|
+ <span @click="onDownload(checkers[index][0], true)">{{ $t('ability.review.download')}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="compose-content" v-else>
|
|
|
+ <Compose ref="compose" :itemInfo="item" :close="!closeTest" :textData="checkers[index]" :index="index" @dataGet="getComposeAns"></Compose>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="compose-content" v-else>
|
|
|
+ <Compose ref="compose" :itemInfo="item" :close="!closeTest" :textData="checkers[index]" :index="index" @dataGet="getComposeAns"></Compose>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div :style="isCheckAns ? 'height: 250px' : ''"></div> -->
|
|
|
+ <!-- 答案解析 -->
|
|
|
+ <div v-if="isWrong && showEnd" :class="['analysis', showEnd ? 'active' : '']" @click="changeAnalysisType(true)">
|
|
|
+ <div class="item-explain">
|
|
|
+ <span class="explain-title">【{{ $t("studentWeb.exam.report.ansRes") }}】</span>
|
|
|
+ <div class="item-explain-details">
|
|
|
+ <span v-if="!checkers[index].length">{{ $t('studentWeb.exam.report.noAns') }}</span>
|
|
|
+ <span v-else v-for="(item, index) in checkers[index]" :key="index" v-html="item"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="item-explain">
|
|
|
+ <span class="explain-title">【{{ $t("studentWeb.exam.report.testAns") }}】</span>
|
|
|
+ <div class="item-explain-details">
|
|
|
+ <span v-if="!item.answer.length">{{ $t('studentWeb.exam.report.noAns') }}</span>
|
|
|
+ <span v-else v-for="(item, index) in item.answer" :key="index" v-html="item"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="item-explain">
|
|
|
+ <span class="explain-title">【{{ $t("studentWeb.exam.report.testAnalyse") }}】</span>
|
|
|
+ <div class="item-explain-details">
|
|
|
+ <div v-html="item.explain ? item.explain : $t('studentWeb.exam.report.noAnalyse')"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 知识点 -->
|
|
|
+ <div class="item-explain">
|
|
|
+ <span class="explain-title">【{{ $t("studentWeb.exam.report.knowledge") }}】</span>
|
|
|
+ <div v-if="item.knowledge && item.knowledge.length" class="item-explain-details">
|
|
|
+ <span v-for="(knowledge, index) in item.knowledge" :key="index" class="knowledge-style">
|
|
|
+ {{ knowledge }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div v-else class="item-explain-details">
|
|
|
+ {{ $t("studentWeb.exam.report.noKnowledge") }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 认知层次 -->
|
|
|
+ <div class="item-explain">
|
|
|
+ <span class="explain-title">【{{ $t("studentWeb.exam.report.filed") }}】</span>
|
|
|
+ <div class="item-explain-details">
|
|
|
+ <div>{{ levelList[item.field - 1] }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="item-explain">
|
|
|
+ <span class="explain-title">【{{ $t("studentWeb.exam.report.repairSource") }}】</span>
|
|
|
+ <div class="item-explain-details-repair">
|
|
|
+ <div v-if="item.repair.length != 0">
|
|
|
+ <div v-for="(repairSource, normalIndex) in item.repair" :key="normalIndex" class="repair-link-wrap-item-box">
|
|
|
+ <div class="file-icon">
|
|
|
+ <img :src="$tools.getFileThum(repairSource.type, repairSource.name)"/>
|
|
|
+ </div>
|
|
|
+ <div class="file-info">
|
|
|
+ <p class="file-name">{{ repairSource.name }}</p>
|
|
|
+ <div>
|
|
|
+ <span @click.stop="onPreview(repairSource)" v-if="repairSource.type !== 'other'">{{ $t('ability.review.preview')}}</span>
|
|
|
+ <span @click.stop="onDownload(repairSource)" v-if="repairSource.type !== 'link'">{{ $t('ability.review.download')}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="!item.repair.length">
|
|
|
+ {{ $t('studentWeb.exam.report.noSource') }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </vuescroll>
|
|
|
+ </template>
|
|
|
+ </i-col>
|
|
|
+ </Row>
|
|
|
+ <Row :gutter="30" v-else>
|
|
|
<!-- 题干 -->
|
|
|
- <i-col :class="['questionArea', {'qamode-area': paperData.qamode}]"
|
|
|
+ <i-col :class="['questionArea', {'qamode-area': instantPaper}]"
|
|
|
:xs="24"
|
|
|
:sm="24"
|
|
|
:md="18"
|
|
|
:lg="20"
|
|
|
>
|
|
|
- <div class="img-wrap" v-if="paperData.qamode">
|
|
|
+ <div class="img-wrap" v-if="instantPaper">
|
|
|
<Carousel v-model="CarouselIndex">
|
|
|
<CarouselItem v-for="(img, indexs) in imgList" :key="indexs">
|
|
|
<!-- 不是综合题 -->
|
|
@@ -183,7 +366,7 @@
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div :class="['questionContent', {'qamode-box': paperData.qamode}]" ref="questionBox" v-if="showExam.length">
|
|
|
+ <div :class="['questionContent', {'qamode-box': instantPaper}]" ref="questionBox" v-if="showExam.length">
|
|
|
<!-- <span class="hintwrap">
|
|
|
<Tooltip :content="$t('studentWeb.exam.report.noSource')" theme="light" placement="left">
|
|
|
<span class="hintIcon">
|
|
@@ -296,7 +479,7 @@
|
|
|
<AudioRecorder :textData="checkers[queNo]" :index="queNo" @dataGet="getComposeAns" />
|
|
|
</template>
|
|
|
<template v-else-if="showExam[queNo].answerType === 'file' || showExam[queNo].answerType === 'image'">
|
|
|
- <Upload type="drag" :accept="subjectiveAccept" action="" :before-upload="customUpload">
|
|
|
+ <Upload type="drag" :accept="subjectiveAccept" action="" :before-upload="file => customUpload(file, queNo)">
|
|
|
<div style="padding: 20px 0" ref="upload1">
|
|
|
<Icon type="ios-cloud-upload" size="52" :style="{color: checkers[queNo].length ? '#b4b4b4' : '#2d8cf0' }"></Icon>
|
|
|
<p>
|
|
@@ -330,7 +513,7 @@
|
|
|
</div>
|
|
|
<!-- <div :style="isCheckAns ? 'height: 250px' : ''"></div> -->
|
|
|
<!-- 答案解析 -->
|
|
|
- <div v-if="isWrong" :class="['analysis', this.showEnd ? 'active' : '']" @click="changeAnalysisType(true)">
|
|
|
+ <div v-if="isWrong" :class="['analysis', showEnd ? 'active' : '']" @click="changeAnalysisType(true)">
|
|
|
<div class="item-explain">
|
|
|
<span class="explain-title">【{{ $t("studentWeb.exam.report.ansRes") }}】</span>
|
|
|
<div class="item-explain-details">
|
|
@@ -398,7 +581,7 @@
|
|
|
</template>
|
|
|
</i-col>
|
|
|
<!--答题卡-->
|
|
|
- <i-col class="ansArea" v-show="widthLimit || (!widthLimit && isShow)"
|
|
|
+ <i-col class="ansArea" v-show="widthLimit || (!widthLimit && isShow)" v-if="!instantPaper"
|
|
|
:xs="24"
|
|
|
:sm="12"
|
|
|
:md="6"
|
|
@@ -460,6 +643,9 @@
|
|
|
</div>
|
|
|
</i-col>
|
|
|
</Row>
|
|
|
+ <div class="top-icon" @click="gotoTop" v-if="instantPaper">
|
|
|
+ <Icon type="ios-arrow-up" size="30" color="#249e35" />
|
|
|
+ </div>
|
|
|
<!-- 补救资源 -->
|
|
|
<Modal v-model="previewStatus" footer-hide width="65%" @on-cancel="closePreview">
|
|
|
<p slot="header"
|
|
@@ -668,7 +854,7 @@
|
|
|
}
|
|
|
//错题练习
|
|
|
if(this.isWrong) {
|
|
|
- let status = this.status[index]
|
|
|
+ let status = this.quesStatus[index]
|
|
|
// 答题卡选项的颜色 0:未作答 1:正确 2:错误 3:未评分
|
|
|
switch(status) {
|
|
|
case 0:
|
|
@@ -688,7 +874,7 @@
|
|
|
}
|
|
|
// 正常作答
|
|
|
else {
|
|
|
- if(!this.status[index]) {
|
|
|
+ if(!this.quesStatus[index]) {
|
|
|
names.push('')
|
|
|
} else {
|
|
|
names.push('has-ans')
|
|
@@ -857,7 +1043,7 @@
|
|
|
this.paperData = this._.cloneDeep(this.getCurrentSubject)
|
|
|
this.isWrong = this.paperData.stuAns[0] ? true : false
|
|
|
this.setTime = this.paperData.time > 0 ? true : false
|
|
|
- if(this.paperData.qamode) {
|
|
|
+ if(this.instantPaper) {
|
|
|
this.getImgList()
|
|
|
}
|
|
|
if(this.setTime && !this.isWrong) {
|
|
@@ -872,12 +1058,12 @@
|
|
|
let answ = JSON.parse(localStorage.getItem("answer"))
|
|
|
answ.map((item, i) => {
|
|
|
this.checkers.push(item)
|
|
|
- this.status[i] = item.length ? 4 : 0
|
|
|
+ // this.status[i] = item.length ? 4 : 0
|
|
|
})
|
|
|
} else {
|
|
|
for (let i = 0; i < this.paperData.stuScore.length; i++) {
|
|
|
this.checkers.push([])
|
|
|
- this.status[i] = 0
|
|
|
+ // this.status[i] = 0
|
|
|
}
|
|
|
}
|
|
|
this.formPaper()
|
|
@@ -910,9 +1096,9 @@
|
|
|
},
|
|
|
// 获得选择题——选中的答案
|
|
|
getAns(data, index) {
|
|
|
- if (this.getQue(this.queNo).type == "single") {
|
|
|
+ if (this.getQue(data).type == "single") {
|
|
|
this.checkers[data].length = 0
|
|
|
- this.checkers[data].push(this.getQue(this.queNo).option[index].code)
|
|
|
+ this.checkers[data].push(this.getQue(data).option[index].code)
|
|
|
}
|
|
|
},
|
|
|
// 完成度的状态
|
|
@@ -980,15 +1166,20 @@
|
|
|
this.rigAns = 0
|
|
|
this.wrgAns = 0
|
|
|
this.noAns = 0
|
|
|
- this.status.map(item => {
|
|
|
- if(item == 0) {
|
|
|
- this.noCheck++
|
|
|
- } else if(item == 1) {
|
|
|
- this.rigAns++
|
|
|
- } else if(item == 2) {
|
|
|
- this.wrgAns++
|
|
|
- } else {
|
|
|
- this.noAns++
|
|
|
+ this.quesStatus.map(item => {
|
|
|
+ switch (item) {
|
|
|
+ case 0:
|
|
|
+ this.noCheck++
|
|
|
+ break
|
|
|
+ case 1:
|
|
|
+ this.rigAns++
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ this.wrgAns++
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ this.noAns++
|
|
|
+ break
|
|
|
}
|
|
|
})
|
|
|
this.showExam.forEach((item, index) => {
|
|
@@ -1013,12 +1204,12 @@
|
|
|
let answ = JSON.parse(localStorage.getItem("answer"))
|
|
|
answ.map((item, i) => {
|
|
|
this.checkers.push(item)
|
|
|
- this.status[i] = item.length ? 4 : 0
|
|
|
+ // this.status[i] = item.length ? 4 : 0
|
|
|
})
|
|
|
} else {
|
|
|
for (let i = 0; i < this.paperData.stuScore.length; i++) {
|
|
|
this.checkers.push([])
|
|
|
- this.status[i] = 0
|
|
|
+ // this.status[i] = 0
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1285,7 +1476,7 @@
|
|
|
}
|
|
|
},
|
|
|
// 文件展示
|
|
|
- async customUpload(file) {
|
|
|
+ async customUpload(file, index) {
|
|
|
// 问答题文件只上传一个
|
|
|
let extension = file.name.substring(file.name.lastIndexOf(".") + 1, file.name.length).toUpperCase()
|
|
|
if(!this.fileTypes.includes(extension)) {
|
|
@@ -1310,8 +1501,8 @@
|
|
|
path,
|
|
|
checkSize: false
|
|
|
}).then(res => {
|
|
|
- this.checkers[this.queNo].length = 0
|
|
|
- this.checkers[this.queNo].push(res.blob)
|
|
|
+ this.checkers[index].length = 0
|
|
|
+ this.checkers[index].push(res.blob)
|
|
|
return false
|
|
|
}).catch(err => {
|
|
|
console.log(err);
|
|
@@ -1334,56 +1525,15 @@
|
|
|
let type = isImg ? 'image' : isVideo ? 'video' : isAudio ? 'audio' : (isDoc ? 'doc' : 'other')
|
|
|
return type
|
|
|
},
|
|
|
+ gotoTop() {
|
|
|
+ document.getElementsByClassName("img-wrap")[0].scrollIntoView()
|
|
|
+ document.getElementsByClassName("instant-exam-box")[0].scrollIntoView()
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
checkers:{
|
|
|
handler(n, o) {
|
|
|
- // 未作答:0 对:1 错:2 主观题:3 已作答:4
|
|
|
- // 已作答
|
|
|
- if(n[this.queNo] && n[this.queNo].length) {
|
|
|
- if(this.isWrong) {
|
|
|
- let objectiveTypes = ["single", "multiple", "judge"]
|
|
|
-
|
|
|
- if(objectiveTypes.includes(this.showExam[this.queNo].type)) {
|
|
|
- if(this.showExam[this.queNo].type != "multiple") {
|
|
|
- if(n[this.queNo][0] == this.showExam[this.queNo].answer[0]) {
|
|
|
- this.status[this.queNo] = 1
|
|
|
- } else {
|
|
|
- this.status[this.queNo] = 2
|
|
|
- }
|
|
|
- }
|
|
|
- // 多选
|
|
|
- else {
|
|
|
- let ans = n[this.queNo]
|
|
|
- let answer = this.showExam[this.queNo].answer
|
|
|
- let q = 0
|
|
|
- ans.map(item => {
|
|
|
- for (let i = 0; i < answer.length; i++) {
|
|
|
- if(item == answer[i]) {
|
|
|
- q += 1
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- if(answer.length == q) {
|
|
|
- this.status[this.queNo] = 1
|
|
|
- } else {
|
|
|
- this.status[this.queNo] = 2
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- this.status[this.queNo] = 3
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.status[this.queNo] = 4
|
|
|
- }
|
|
|
- }
|
|
|
- // 未作答
|
|
|
- else {
|
|
|
- this.status[this.queNo] = 0
|
|
|
- }
|
|
|
if(n && this.setTime && !this.isWrong) {
|
|
|
this.$jsFn.debounce(this.storageCheck(n), 3000)
|
|
|
}
|
|
@@ -1484,6 +1634,53 @@
|
|
|
return ''
|
|
|
}
|
|
|
},
|
|
|
+ instantPaper() {
|
|
|
+ return this.getPaperInfo.qamode === 1 || this.paperData.qamode
|
|
|
+ },
|
|
|
+ quesStatus() {
|
|
|
+ let arr = new Array(this.checkers.length)
|
|
|
+ // 未作答:0 对:1 错:2 主观题:3 已作答:4
|
|
|
+ this.checkers.forEach((item, index) => {
|
|
|
+ if(item && item.length) { // 已作答
|
|
|
+ if(this.isWrong) {
|
|
|
+ let objectiveTypes = ["single", "multiple", "judge"]
|
|
|
+ if(objectiveTypes.includes(this.showExam[index].type)) {
|
|
|
+ if(this.showExam[index].type != "multiple") {
|
|
|
+ if(item[0] == this.showExam[index].answer[0]) {
|
|
|
+ arr[index] = 1
|
|
|
+ } else {
|
|
|
+ arr[index] = 2
|
|
|
+ }
|
|
|
+ } else { // 多选
|
|
|
+ let answer = this.showExam[index].answer
|
|
|
+ let q = 0
|
|
|
+ item.map(check => {
|
|
|
+ for (let i = 0; i < answer.length; i++) {
|
|
|
+ if(check == answer[i]) {
|
|
|
+ q += 1
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(answer.length == q) {
|
|
|
+ arr[index] = 1
|
|
|
+ } else {
|
|
|
+ arr[index] = 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ arr[index] = 3
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ arr[index] = 4
|
|
|
+ }
|
|
|
+ } else { // 未作答
|
|
|
+ arr[index] = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return arr
|
|
|
+ },
|
|
|
},
|
|
|
// 导航守卫监听
|
|
|
beforeRouteLeave(to, from, next) {
|