|
|
@ -10,34 +10,34 @@ |
|
|
|
<el-progress :percentage="progress" :show-text="false"></el-progress> |
|
|
|
<el-progress :percentage="progress" :show-text="false"></el-progress> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div class="item"> |
|
|
|
<div class="item" v-if="singleCount"> |
|
|
|
<p class="type">单选题(共{{singleCount}}题,合计{{singlePoint}}分)</p> |
|
|
|
<p class="type">单选题({{singlePoint}}分/{{singleCount}}题,合计{{singlePoint * singleCount}}分)</p> |
|
|
|
<div class="nums"> |
|
|
|
<div class="nums"> |
|
|
|
<span v-for="n in singleCount" :class="{active: n <= singleAnsweredCount}" :key="n">{{n}}</span> |
|
|
|
<span v-for="n in singleCount" :class="{active: singleAnswered.includes(n - 1)}" :key="n">{{n}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<div class="item" v-if="multipleCount"> |
|
|
|
<p class="type">多选题(共{{multipleCount}}题,合计{{multipleChoiceScore}}分)</p> |
|
|
|
<p class="type">多选题({{multipleChoiceScore}}分/{{multipleCount}}题,合计{{multipleChoiceScore * multipleCount}}分)</p> |
|
|
|
<div class="nums"> |
|
|
|
<div class="nums"> |
|
|
|
<span v-for="n in multipleCount" :class="{active: n <= multipleAnsweredCount}" :key="n">{{n}}</span> |
|
|
|
<span v-for="n in multipleCount" :class="{active: multipleAnswered.includes(n - 1)}" :key="n">{{n}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<div class="item" v-if="judgeCount"> |
|
|
|
<p class="type">判断题(共{{judgeCount}}题,合计{{judgeScore}}分)</p> |
|
|
|
<p class="type">判断题({{judgeScore}}分/{{judgeCount}}题,合计{{judgeScore * judgeCount}}分)</p> |
|
|
|
<div class="nums"> |
|
|
|
<div class="nums"> |
|
|
|
<span v-for="n in judgeCount" :class="{active: n <= judgeAnsweredCount}" :key="n">{{n}}</span> |
|
|
|
<span v-for="n in judgeCount" :class="{active: judgeAnswered.includes(n - 1)}" :key="n">{{n}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<div class="item" v-if="fillBlankCount"> |
|
|
|
<p class="type">填空题(共{{fillBlankCount}}题,合计{{fillBlanksScore}}分)</p> |
|
|
|
<p class="type">填空题({{fillBlanksScore}}分/{{fillBlankCount}}题,合计{{fillBlanksScore * fillBlankCount}}分)</p> |
|
|
|
<div class="nums"> |
|
|
|
<div class="nums"> |
|
|
|
<span v-for="n in fillBlankCount" :class="{active: n <= fillBlankAnsweredCount}" :key="n">{{n}}</span> |
|
|
|
<span v-for="n in fillBlankCount" :class="{active: fillBlankAnswered.includes(n - 1)}" :key="n">{{n}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<div class="item" v-if="briefAnswerCount"> |
|
|
|
<p class="type">简答题(共{{briefAnswerCount}}题,合计{{briefAnswerScore}}分)</p> |
|
|
|
<p class="type">简答题({{briefAnswerScore}}分/{{briefAnswerCount}}题,合计{{briefAnswerScore * briefAnswerCount}}分)</p> |
|
|
|
<div class="nums"> |
|
|
|
<div class="nums"> |
|
|
|
<span v-for="n in briefAnswerCount" :class="{active: n <= briefAnswerAnsweredCount}" :key="n">{{n}}</span> |
|
|
|
<span v-for="n in briefAnswerCount" :class="{active: briefAnswerAnswered.includes(n - 1)}" :key="n">{{n}}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="btn"> |
|
|
|
<div class="btn"> |
|
|
@ -87,7 +87,7 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
<el-button type="primary" class="ml20">上传文件</el-button> |
|
|
|
<el-button type="primary" class="ml20">上传文件</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
<el-input type="textarea" rows="5" v-model="item.val" @input="updateProgress"></el-input> |
|
|
|
<el-input type="textarea" rows="5" resize="none" v-model="item.val" @input="updateProgress"></el-input> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -121,6 +121,11 @@ export default { |
|
|
|
judgeAnsweredCount: 0, |
|
|
|
judgeAnsweredCount: 0, |
|
|
|
fillBlankAnsweredCount: 0, |
|
|
|
fillBlankAnsweredCount: 0, |
|
|
|
briefAnswerAnsweredCount: 0, |
|
|
|
briefAnswerAnsweredCount: 0, |
|
|
|
|
|
|
|
singleAnswered: [], |
|
|
|
|
|
|
|
multipleAnswered: [], |
|
|
|
|
|
|
|
judgeAnswered: [], |
|
|
|
|
|
|
|
fillBlankAnswered: [], |
|
|
|
|
|
|
|
briefAnswerAnswered: [], |
|
|
|
|
|
|
|
|
|
|
|
singlePoint: 0, |
|
|
|
singlePoint: 0, |
|
|
|
multipleChoiceScore: 0, |
|
|
|
multipleChoiceScore: 0, |
|
|
@ -188,6 +193,7 @@ export default { |
|
|
|
this.$get(`${this.api.enterExam}?testPaperId=${this.testPaperId}&userId=${this.userId}&assessmentId=${this.assessmentId}`) |
|
|
|
this.$get(`${this.api.enterExam}?testPaperId=${this.testPaperId}&userId=${this.userId}&assessmentId=${this.assessmentId}`) |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
let data = res.data |
|
|
|
let data = res.data |
|
|
|
|
|
|
|
if(res.data.entertime) this.startTime = new Date(res.data.entertime).getTime() |
|
|
|
this.subjects = [ |
|
|
|
this.subjects = [ |
|
|
|
[...data.singleChoiceList], |
|
|
|
[...data.singleChoiceList], |
|
|
|
[...data.multipleChoiceList], |
|
|
|
[...data.multipleChoiceList], |
|
|
@ -209,8 +215,7 @@ export default { |
|
|
|
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore] |
|
|
|
this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore] |
|
|
|
|
|
|
|
|
|
|
|
this.handleOptions() |
|
|
|
this.handleOptions() |
|
|
|
}) |
|
|
|
}).catch(err => {}) |
|
|
|
.catch(err => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
getAnswer() { |
|
|
|
getAnswer() { |
|
|
|
this.$get(`${this.api.queryGzAnswerDetails}?userId=${this.userId}&assessmentId=${this.assessmentId}&testPaperId=${this.testPaperId}`) |
|
|
|
this.$get(`${this.api.queryGzAnswerDetails}?userId=${this.userId}&assessmentId=${this.assessmentId}&testPaperId=${this.testPaperId}`) |
|
|
@ -239,6 +244,7 @@ export default { |
|
|
|
n.value = answer[j] |
|
|
|
n.value = answer[j] |
|
|
|
}) |
|
|
|
}) |
|
|
|
n.val = answered.userAnswer |
|
|
|
n.val = answered.userAnswer |
|
|
|
|
|
|
|
if(answer.filter(n => n).length) n.hadAnswer = 1 |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
n.val = answered.userAnswer |
|
|
|
n.val = answered.userAnswer |
|
|
|
} |
|
|
|
} |
|
|
@ -248,6 +254,33 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
let subjects = this.subjects |
|
|
|
|
|
|
|
let singleAnswered = [] |
|
|
|
|
|
|
|
let multipleAnswered = [] |
|
|
|
|
|
|
|
let judgeAnswered = [] |
|
|
|
|
|
|
|
let fillBlankAnswered = [] |
|
|
|
|
|
|
|
let briefAnswerAnswered = [] |
|
|
|
|
|
|
|
subjects[0].map((n,i) => { |
|
|
|
|
|
|
|
n.val && singleAnswered.push(i) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
subjects[1].map((n,i) => { |
|
|
|
|
|
|
|
n.val.length && multipleAnswered.push(i) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
subjects[2].map((n,i) => { |
|
|
|
|
|
|
|
n.val && judgeAnswered.push(i) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
subjects[3].map((n,i) => { |
|
|
|
|
|
|
|
n.hadAnswer && fillBlankAnswered.push(i) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
subjects[4].map((n,i) => { |
|
|
|
|
|
|
|
n.val && briefAnswerAnswered.push(i) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.singleAnswered = singleAnswered |
|
|
|
|
|
|
|
this.multipleAnswered = multipleAnswered |
|
|
|
|
|
|
|
this.judgeAnswered = judgeAnswered |
|
|
|
|
|
|
|
this.fillBlankAnswered = fillBlankAnswered |
|
|
|
|
|
|
|
this.briefAnswerAnswered = briefAnswerAnswered |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(err => {}) |
|
|
|
.catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -300,6 +333,7 @@ export default { |
|
|
|
this.$post(`${this.api.getStateById}?id=${this.assessmentId}`) |
|
|
|
this.$post(`${this.api.getStateById}?id=${this.assessmentId}`) |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
if(res.data.state == '已结束'){ |
|
|
|
if(res.data.state == '已结束'){ |
|
|
|
|
|
|
|
clearInterval(this.queryStateTimer) |
|
|
|
this.isDone = true |
|
|
|
this.isDone = true |
|
|
|
this.save() |
|
|
|
this.save() |
|
|
|
} |
|
|
|
} |
|
|
@ -328,14 +362,16 @@ export default { |
|
|
|
if(i == 1){ |
|
|
|
if(i == 1){ |
|
|
|
userAnswer = n.val.join('') |
|
|
|
userAnswer = n.val.join('') |
|
|
|
}else if(i == 3){ |
|
|
|
}else if(i == 3){ |
|
|
|
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).join('<>') |
|
|
|
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).filter(n => n).join('<>') |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
userAnswer = n.val |
|
|
|
userAnswer = n.val |
|
|
|
} |
|
|
|
} |
|
|
|
n.fileUrl = JSON.stringify(n.fileUrl) |
|
|
|
let fileUrl = n.fileUrl |
|
|
|
n.video = JSON.stringify(n.video) |
|
|
|
let videoAudio = n.video |
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
fileUrl = JSON.stringify(fileUrl) |
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
videoAudio = JSON.stringify(videoAudio) |
|
|
|
|
|
|
|
if(fileUrl == '{}') fileUrl = '' |
|
|
|
|
|
|
|
if(videoAudio == '{}') videoAudio = '' |
|
|
|
data1.push({ |
|
|
|
data1.push({ |
|
|
|
assessmentId: this.assessmentId, |
|
|
|
assessmentId: this.assessmentId, |
|
|
|
questionId: n.id, |
|
|
|
questionId: n.id, |
|
|
@ -343,12 +379,11 @@ export default { |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
userAnswer, |
|
|
|
userAnswer, |
|
|
|
userId: this.userId, |
|
|
|
userId: this.userId, |
|
|
|
fileUrl: n.fileUrl, |
|
|
|
fileUrl, |
|
|
|
videoAudio: n.video |
|
|
|
videoAudio |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.$post(`${this.api.coverGzAnswerDetails}?userId=${this.userId}&testPaperId=${this.testPaperId}&assessmentId=${this.assessmentId}`) |
|
|
|
this.$post(`${this.api.coverGzAnswerDetails}?userId=${this.userId}&testPaperId=${this.testPaperId}&assessmentId=${this.assessmentId}`) |
|
|
|
.then(res => { |
|
|
|
.then(res => { |
|
|
|
this.$post(`${this.api.addGzAnswerDetails}`,data1) |
|
|
|
this.$post(`${this.api.addGzAnswerDetails}`,data1) |
|
|
@ -393,14 +428,16 @@ export default { |
|
|
|
if(i == 1){ |
|
|
|
if(i == 1){ |
|
|
|
userAnswer = n.val.join('') |
|
|
|
userAnswer = n.val.join('') |
|
|
|
}else if(i == 3){ |
|
|
|
}else if(i == 3){ |
|
|
|
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).join('<>') |
|
|
|
userAnswer = [...document.querySelectorAll(`.stem${i}${k} input`)].map(n => n.value).filter(n => n).join('<>') |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
userAnswer = n.val |
|
|
|
userAnswer = n.val |
|
|
|
} |
|
|
|
} |
|
|
|
n.fileUrl = JSON.stringify(n.fileUrl) |
|
|
|
let fileUrl = n.fileUrl |
|
|
|
n.video = JSON.stringify(n.video) |
|
|
|
let videoAudio = n.video |
|
|
|
if(n.fileUrl == '{}') n.fileUrl = '' |
|
|
|
fileUrl = JSON.stringify(fileUrl) |
|
|
|
if(n.video == '{}') n.video = '' |
|
|
|
videoAudio = JSON.stringify(videoAudio) |
|
|
|
|
|
|
|
if(fileUrl == '{}') fileUrl = '' |
|
|
|
|
|
|
|
if(videoAudio == '{}') videoAudio = '' |
|
|
|
data1.push({ |
|
|
|
data1.push({ |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
assessmentId: this.assessmentId, |
|
|
|
assessmentId: this.assessmentId, |
|
|
@ -409,19 +446,17 @@ export default { |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
testPaperId: this.testPaperId, |
|
|
|
userAnswer: userAnswer, |
|
|
|
userAnswer: userAnswer, |
|
|
|
userId: this.userId, |
|
|
|
userId: this.userId, |
|
|
|
fileUrl: n.fileUrl, |
|
|
|
fileUrl, |
|
|
|
videoAudio: n.video |
|
|
|
videoAudio |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.$post(`${this.api.coverGzAnswerDetails}?userId=${this.userId}&testPaperId=${this.testPaperId}&assessmentId=${this.assessmentId}`) |
|
|
|
this.$post(`${this.api.coverGzAnswerDetails}?userId=${this.userId}&testPaperId=${this.testPaperId}&assessmentId=${this.assessmentId}`).then(res => { |
|
|
|
.then(res => { |
|
|
|
|
|
|
|
this.$post(`${this.api.addGzAnswerDetails}`,data1) |
|
|
|
this.$post(`${this.api.addGzAnswerDetails}`,data1) |
|
|
|
.then(res => {}) |
|
|
|
.then(res => {}) |
|
|
|
.catch(err => {}) |
|
|
|
.catch(err => {}) |
|
|
|
}) |
|
|
|
}).catch(err => {}) |
|
|
|
.catch(err => {}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|