|
@@ -90,7 +90,7 @@
|
|
|
<div class="score-wrap">
|
|
|
<div class="quick-score-box score-input-box">
|
|
|
<span>分数:</span>
|
|
|
- <InputNumber style="flex:1" :max="10" :min="1" v-model="stuScore[getScoreIndex(quIndex,childIndex)]"></InputNumber>
|
|
|
+ <InputNumber style="flex:1" :max="10" :min="1" v-model="score" @on-change="setScore"></InputNumber>
|
|
|
</div>
|
|
|
<div class="quick-score-box">
|
|
|
<Button size="small" type="info" style="margin-right:8px" ghost @click="score = 10">满分</Button>
|
|
@@ -116,7 +116,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 用来单独渲染学生作答数据,提高tocanvas 的效率 -->
|
|
|
- <iframe id="markIframe" :srcdoc="curAnswer" v-if="curAnswer"></iframe>
|
|
|
+ <iframe id="markIframe" :srcdoc="curAnswer"></iframe>
|
|
|
<Modal v-model="toggleStatus" title="切换学生">
|
|
|
进行中
|
|
|
</Modal>
|
|
@@ -133,6 +133,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ score: null,
|
|
|
mouseStatus: 'move',
|
|
|
drawImgData: '',
|
|
|
ansImg: '',
|
|
@@ -203,6 +204,7 @@ export default {
|
|
|
},
|
|
|
/** 打分 */
|
|
|
setScore(score) {
|
|
|
+ this.score = score
|
|
|
this.$set(this.stuScore, this.getScoreIndex(this.quIndex, this.childIndex), score)
|
|
|
},
|
|
|
toQu(index, childIndex) {
|
|
@@ -226,28 +228,31 @@ export default {
|
|
|
},
|
|
|
//提交分数
|
|
|
submit() {
|
|
|
- let requstData = {
|
|
|
- id: this.taskInfo.id,
|
|
|
- stuId: this.stuId,
|
|
|
- subjectId: this.taskInfo.subject,
|
|
|
- tmdId: this.$store.state.userInfo.TEAMModelId,
|
|
|
- score: this.stuScore,
|
|
|
- count: this.taskInfo.count,
|
|
|
- code: this.taskInfo.ecode.replace('Exam-', ''),
|
|
|
- mark: ''
|
|
|
- }
|
|
|
- this.$api.mark.saveScore(requstData).then(
|
|
|
- res => {
|
|
|
- this.$Message.success('保存成功')
|
|
|
- // 按人阅卷自动跳转下一题
|
|
|
- this.nextQuestion()
|
|
|
- this.ansToImg()
|
|
|
- },
|
|
|
- err => {
|
|
|
- this.$Message.error('保存失败')
|
|
|
+ if (this.score > -1 && this.score != null) {
|
|
|
+ let requstData = {
|
|
|
+ id: this.taskInfo.id,
|
|
|
+ stuId: this.stuId,
|
|
|
+ subjectId: this.taskInfo.subject,
|
|
|
+ tmdId: this.$store.state.userInfo.TEAMModelId,
|
|
|
+ score: this.stuScore,
|
|
|
+ count: this.taskInfo.count,
|
|
|
+ code: this.taskInfo.ecode.replace('Exam-', ''),
|
|
|
+ mark: ''
|
|
|
}
|
|
|
- )
|
|
|
-
|
|
|
+ this.$api.mark.saveScore(requstData).then(
|
|
|
+ res => {
|
|
|
+ this.$Message.success('保存成功')
|
|
|
+ // 按人阅卷自动跳转下一题
|
|
|
+ this.nextQuestion()
|
|
|
+ this.ansToImg()
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error('保存失败')
|
|
|
+ }
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ this.$Message.warning('请先打分')
|
|
|
+ }
|
|
|
},
|
|
|
nextQuestion() {
|
|
|
// 当前不是最后一题
|
|
@@ -335,6 +340,7 @@ export default {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ this.score = this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)] == -1 ? null : this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)]
|
|
|
},
|
|
|
|
|
|
quit() {
|
|
@@ -356,6 +362,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
let routeData = this.$route.params
|
|
|
+ console.log('路由数据', routeData)
|
|
|
this.paperData = routeData.fullPaper
|
|
|
this.stuAnswer = routeData.answer
|
|
|
this.stuScore = routeData.score
|
|
@@ -386,11 +393,18 @@ export default {
|
|
|
},
|
|
|
/**当前题目作答数据 */
|
|
|
curAnswer() {
|
|
|
- let index = this.getScoreIndex(this.quIndex, this.childIndex)
|
|
|
- return this.stuAnswer[index]
|
|
|
+ if (this.stuAnswer.length) {
|
|
|
+ let index = this.getScoreIndex(this.quIndex, this.childIndex)
|
|
|
+ return this.stuAnswer[index]
|
|
|
+ } else {
|
|
|
+ return this.stuId + '未作答'
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
totalScore() {
|
|
|
return this.stuScore.reduce((a, b) => {
|
|
|
+ a = a == -1 ? 0 : a
|
|
|
+ b = b == -1 ? 0 : b
|
|
|
return a + b
|
|
|
}, 0)
|
|
|
}
|
|
@@ -704,7 +718,7 @@ export default {
|
|
|
outline: none !important;
|
|
|
line-height: 1.5;
|
|
|
}
|
|
|
-.score-input-box .ivu-input-number-input{
|
|
|
+.score-input-box .ivu-input-number-input {
|
|
|
font-size: 18px;
|
|
|
color: red;
|
|
|
font-weight: 800;
|