|
@@ -1,8 +1,7 @@
|
|
|
<template>
|
|
|
- <!-- 未做多语言 -->
|
|
|
<div class="mark-area">
|
|
|
<!-- 头部基础信息 -->
|
|
|
- <div class="mark-header">
|
|
|
+ <div class="mark-header" v-show="!isComplete">
|
|
|
<span class="quit-marking-text">
|
|
|
<Icon type="ios-arrow-back" class="quit-marking-icon" :title="$t('learnActivity.mark.quit')" @click="quit" />
|
|
|
</span>
|
|
@@ -12,27 +11,22 @@
|
|
|
<span class="info-value">{{$t('learnActivity.mark.byStu')}}</span>
|
|
|
<span class="info-label">{{$t('learnActivity.mark.stuId')}}</span>
|
|
|
<span class="info-value stu-id-info">{{stuId}}</span>
|
|
|
- <span class="info-label">{{$t('learnActivity.mark.score')}}</span>
|
|
|
- <span class="info-value score-info">{{totalScore}}</span>
|
|
|
+ <!-- <span class="info-label">{{$t('learnActivity.mark.score')}}</span>
|
|
|
+ <span class="info-value score-info">{{totalScore}}</span> -->
|
|
|
<span class="info-label">{{$t('learnActivity.mark.curQu')}}</span>
|
|
|
- <span class="info-value cur-qu-index" v-if="childIndex > -1">{{`${quIndex + 1}-${childIndex + 1}`}}</span>
|
|
|
- <span class="info-value cur-qu-index" v-else>{{quIndex + 1}}</span>
|
|
|
+ <span class="info-value cur-qu-index">{{quNoList[quIndex] ? quNoList[quIndex].label : '--'}}</span>
|
|
|
<div class="btn-wrap">
|
|
|
- <span class="action-btn" @click="toggleStatus = !toggleStatus">
|
|
|
+ <span class="action-btn" @click="continueMark">
|
|
|
<Icon type="md-shuffle" class="action-btn-icon" />
|
|
|
{{$t('learnActivity.mark.toggleStu')}}
|
|
|
</span>
|
|
|
- <!-- <span class="action-btn">
|
|
|
- <Icon type="md-refresh" class="action-btn-icon" />
|
|
|
- 回评
|
|
|
- </span> -->
|
|
|
- <span class="action-btn" @click="exception">
|
|
|
+ <span class="action-btn" @click="errStatus = true">
|
|
|
<Icon custom="iconfont icon-exception" class="action-btn-icon" />
|
|
|
{{$t('learnActivity.mark.exception')}}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mark-main">
|
|
|
+ <div class="mark-main" v-show="!isComplete">
|
|
|
<!-- 工具条 -->
|
|
|
<div class="mark-tools-wrap">
|
|
|
<Icon custom="iconfont icon-move" class="tool-icon" :title="$t('learnActivity.mark.move')" @click="mouseStatus = 'move'" />
|
|
@@ -48,7 +42,6 @@
|
|
|
</div>
|
|
|
</Poptip>
|
|
|
<Icon custom="iconfont icon-fresh" class="tool-icon" :title="$t('learnActivity.mark.clear')" @click="clear" />
|
|
|
- <!-- <Icon :custom="isFull ? 'iconfont icon-cancel-full' : 'iconfont icon-full-screen'" class="tool-icon" :title="isFull ? '取消全屏' : '全屏'" @click="togglefull" /> -->
|
|
|
</div>
|
|
|
<div class="mark-stage">
|
|
|
<MarkCanvas ref="markCanvas" @getImg="saveMark" :status="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
|
|
@@ -63,17 +56,8 @@
|
|
|
</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <span v-for="(item,index) in paperData.item" :key="index">
|
|
|
- <!-- 综合题 -->
|
|
|
- <span v-if="item.children.length" :key="index">
|
|
|
- <span @click="toQu(index,childIndex)" v-for="(childItem,childIndex) in item.children" :key="childIndex" :class="['qu-index',stuScore[getScoreIndex(index,childIndex)] > -1 ? 'right-qu' : '']">
|
|
|
- {{(index + 1) + '-' + (childIndex + 1)}}
|
|
|
- </span>
|
|
|
- </span>
|
|
|
- <!-- 其他题 -->
|
|
|
- <span v-else @click="toQu(index)" :class="['qu-index',stuScore[getScoreIndex(index)] > -1 ? 'right-qu' : '']">
|
|
|
- {{index + 1}}
|
|
|
- </span>
|
|
|
+ <span v-show="!taskInfo.qu.length || taskInfo.qu.includes(index)" v-for="(item,index) in quNoList" :key="index" :class="['qu-index',stuScore[index] > -1 ? 'right-qu' : '']" @click="toQu(index)">
|
|
|
+ {{item.label}}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -82,19 +66,19 @@
|
|
|
<div class="score-wrap">
|
|
|
<div class="quick-score-box score-input-box">
|
|
|
<span>{{$t('learnActivity.mark.score')}}</span>
|
|
|
- <InputNumber style="flex:1" :max="10" :min="1" v-model="score" @on-change="setScore"></InputNumber>
|
|
|
+ <InputNumber style="flex:1" :max="quScore[quIndex]" :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 size="small" type="info" style="margin-right:8px" ghost @click="setScore(quScoreArr.length - 1)">
|
|
|
{{$t('learnActivity.mark.fullScore')}}
|
|
|
</Button>
|
|
|
- <Button size="small" type="error" ghost @click="score = 0">
|
|
|
+ <Button size="small" type="error" ghost @click="setScore(0)">
|
|
|
{{$t('learnActivity.mark.zeroScore')}}
|
|
|
</Button>
|
|
|
<Icon :type="isShowNum ? 'md-eye-off' : 'md-eye'" class="toggle-num-status" @click="isShowNum = !isShowNum" />
|
|
|
<div :class="['score-key-box', isShowNum ? '':'hind-key-box']">
|
|
|
<vuescroll>
|
|
|
- <span v-for="(item,index) in quScoreArr" :key="index" :class="['score-key', stuScore[getScoreIndex(quIndex,childIndex)] == index ? 'score-key-active':'']" @click="setScore(index)">
|
|
|
+ <span v-for="(item,index) in quScoreArr" :key="index" :class="['score-key', stuScore[quIndex] == index ? 'score-key-active':'']" @click="setScore(index)">
|
|
|
{{item}}
|
|
|
</span>
|
|
|
</vuescroll>
|
|
@@ -119,10 +103,37 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 完成阅卷的提示信息 -->
|
|
|
+ <div class="complete-mark" v-show="isComplete">
|
|
|
+ <div class="complete-box">
|
|
|
+ <Icon type="md-checkmark-circle-outline" class="ok-icon" />
|
|
|
+ <p style="margin-top:20px;font-size:14px">
|
|
|
+ 学生:{{stuId}}
|
|
|
+ </p>
|
|
|
+ <p style="font-size:20px;margin-top:5px">
|
|
|
+ 已阅完
|
|
|
+ </p>
|
|
|
+ <Button type="success" class="continue-btn" @click="continueMark">继续阅卷</Button>
|
|
|
+ <Button type="info" class="quit-btn" @click="quit">退出阅卷</Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!-- 用来单独渲染学生作答数据,提高tocanvas 的效率 -->
|
|
|
<iframe id="markIframe" :srcdoc="curAnswer"></iframe>
|
|
|
<Modal v-model="toggleStatus" :title="$t('learnActivity.mark.toggleStu')" :width="800" footer-hide>
|
|
|
- <StuProg @getStuId="toByStuView" class="light-stu-prog" :total="taskInfo.count" :stusData="stusData"></StuProg>
|
|
|
+ <StuProg @getStuId="toByStuView" class="light-stu-prog" :total="taskInfo.count" :stusData="stusData" :qus="taskInfo ? taskInfo.qu : []"></StuProg>
|
|
|
+ </Modal>
|
|
|
+ <Modal v-model="errStatus" title="异常原因" :width="600" @on-ok="exception" :loading="loading">
|
|
|
+ <CheckboxGroup v-model="errReason">
|
|
|
+ <Checkbox label="twitter" class="reason-item">
|
|
|
+ <span>答案不清晰,看不清楚</span>
|
|
|
+ </Checkbox>
|
|
|
+ <Checkbox label="facebook" class="reason-item">
|
|
|
+ <span>答案图片不完整</span>
|
|
|
+ </Checkbox>
|
|
|
+ <Checkbox label="github" class="reason-item">
|
|
|
+ <span>其他原因</span>
|
|
|
+ </Checkbox>
|
|
|
+ </CheckboxGroup>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -138,6 +149,10 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ isComplete: false,
|
|
|
+ loading: true,
|
|
|
+ errReason: [],
|
|
|
+ errStatus: false,
|
|
|
score: null,
|
|
|
mouseStatus: 'move',
|
|
|
drawImgData: '',
|
|
@@ -149,7 +164,6 @@ export default {
|
|
|
activeIcon: -1,
|
|
|
isShowNum: true,
|
|
|
quIndex: 0,
|
|
|
- childIndex: -1,
|
|
|
stuData: {
|
|
|
name: '',
|
|
|
id: '',
|
|
@@ -162,16 +176,44 @@ export default {
|
|
|
taskInfo: {},
|
|
|
stusData: [],
|
|
|
stuId: '',
|
|
|
- markImg: undefined
|
|
|
+ markImg: undefined,
|
|
|
+ quScore: [] //题目配分数据
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //继续阅卷
|
|
|
+ continueMark() {
|
|
|
+ let stu = this.stusData.find(item => {
|
|
|
+ return item.stuId == this.stuId
|
|
|
+ })
|
|
|
+ if (stu) {
|
|
|
+ stu.item.forEach((item, index) => {
|
|
|
+ item.sc = this.stuScore[index]
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.stuData.item.forEach((item, index) => {
|
|
|
+ item.sc = this.stuScore[index]
|
|
|
+ })
|
|
|
+ this.stusData.push(this.stuData)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.toggleStatus = true
|
|
|
+ },
|
|
|
exception() {
|
|
|
- this.$Message.warning('功能开发中')
|
|
|
+ if (this.errReason.length) {
|
|
|
+ this.errStatus = false
|
|
|
+ this.$Message.warning('暂未对接API')
|
|
|
+ this.errReason = []
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = true
|
|
|
+ })
|
|
|
+ this.$Message.warning('请选择异常原因')
|
|
|
+ }
|
|
|
},
|
|
|
//保存批注
|
|
|
saveMark(data) {
|
|
|
- console.log(data)
|
|
|
this.markImg = data.base64
|
|
|
},
|
|
|
drawImg(imgIndex) {
|
|
@@ -182,6 +224,31 @@ export default {
|
|
|
this.drawImgData = curImg
|
|
|
}
|
|
|
},
|
|
|
+ /**
|
|
|
+ * index 题目index 必传
|
|
|
+ * childIndex 小题index 非必传
|
|
|
+ */
|
|
|
+ getScoreIndex(index, childIndex) {
|
|
|
+ let realIndex = 0
|
|
|
+ this.paperData.item.forEach((item, itemIndex) => {
|
|
|
+ if (itemIndex <= index) {
|
|
|
+ //综合题
|
|
|
+ if (item.children.length) {
|
|
|
+ item.children.forEach((childItem, cIndex) => {
|
|
|
+ if (itemIndex < index) {
|
|
|
+ realIndex++
|
|
|
+ } else if (cIndex <= childIndex) {
|
|
|
+ realIndex++
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ realIndex++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return --realIndex
|
|
|
+ },
|
|
|
//清除所有批注
|
|
|
clear() {
|
|
|
this.$refs['markCanvas'].clear()
|
|
@@ -202,7 +269,7 @@ export default {
|
|
|
answerIframe.style.width = (bodyWidth + 20) + 'px'
|
|
|
answerIframe.contentWindow.document.body.style.backgroundColor = '#f5f5f5'
|
|
|
html2canvas(answerIframe.contentWindow.document.body, {}).then((canvas) => {
|
|
|
- canvas.id = "canvas" + this.getScoreIndex(this.quIndex, this.childIndex)
|
|
|
+ canvas.id = "canvas" + this.quIndex
|
|
|
this.ansImg = canvas.toDataURL()
|
|
|
// 将转出来的答案绘制到canvas上
|
|
|
})
|
|
@@ -211,40 +278,15 @@ export default {
|
|
|
/** 打分 */
|
|
|
setScore(score) {
|
|
|
this.score = score
|
|
|
- this.$set(this.stuScore, this.getScoreIndex(this.quIndex, this.childIndex), score)
|
|
|
- if (this.autoQu) {
|
|
|
- this.submit()
|
|
|
- }
|
|
|
+ this.$set(this.stuScore, this.quIndex, score)
|
|
|
+ //暂时去掉打分自动提交的功能
|
|
|
+ // if (this.autoQu) {
|
|
|
+ // this.submit()
|
|
|
+ // }
|
|
|
},
|
|
|
- toQu(index, childIndex) {
|
|
|
+ toQu(index) {
|
|
|
this.quIndex = index
|
|
|
- this.childIndex = childIndex
|
|
|
- this.score = this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)] == -1 ? null : this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)]
|
|
|
- },
|
|
|
- /**
|
|
|
- * index 题目index 必传
|
|
|
- * childIndex 小题index 非必传
|
|
|
- */
|
|
|
- getScoreIndex(index, childIndex) {
|
|
|
- let realIndex = 0
|
|
|
- this.paperData.item.forEach((item, itemIndex) => {
|
|
|
- if (itemIndex <= index) {
|
|
|
- //综合题
|
|
|
- if (item.children.length) {
|
|
|
- item.children.forEach((childItem, cIndex) => {
|
|
|
- if (itemIndex < index) {
|
|
|
- realIndex++
|
|
|
- } else if (cIndex <= childIndex) {
|
|
|
- realIndex++
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
- realIndex++
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- return --realIndex
|
|
|
+ this.score = this.stuScore[index] == -1 ? null : this.stuScore[index]
|
|
|
},
|
|
|
//提交分数
|
|
|
submit() {
|
|
@@ -254,7 +296,7 @@ export default {
|
|
|
if (this.markImg) {
|
|
|
let img = document.createElement('img')
|
|
|
img.src = this.markImg
|
|
|
- this.stuAnswer[this.getScoreIndex(this.quIndex, this.childIndex)] = img.outerHTML
|
|
|
+ this.stuAnswer[this.quIndex] = img.outerHTML
|
|
|
mark = this.stuAnswer
|
|
|
this.markImg = undefined
|
|
|
}
|
|
@@ -266,6 +308,7 @@ export default {
|
|
|
score: this.stuScore,
|
|
|
count: this.taskInfo.count,
|
|
|
code: this.taskInfo.ecode.replace('Exam-', ''),
|
|
|
+ qu: this.taskInfo.qu,
|
|
|
mark
|
|
|
}
|
|
|
this.$api.mark.saveScore(requstData).then(
|
|
@@ -283,105 +326,51 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
nextQuestion() {
|
|
|
- //首先判断是都已阅完
|
|
|
- if (!this.stuScore.includes(-1)) {
|
|
|
+ //首先判断是否都已评分
|
|
|
+ let s = this._.cloneDeep(this.stuScore)
|
|
|
+ if (this.taskInfo.qu.length) {
|
|
|
+ s = s.filter((item, index) => {
|
|
|
+ return this.taskInfo.qu.includes(index)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (!s.includes(-1)) {
|
|
|
if (this.autoStu) {
|
|
|
- this.toggleStatus = true
|
|
|
+ this.isComplete = true
|
|
|
} else {
|
|
|
this.$Message.warning(this.$t('learnActivity.mark.completeStu'))
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- // 当前不是最后一题
|
|
|
- if (this.quIndex < this.paperData.item.length - 1) {
|
|
|
- //当前题目是综合题
|
|
|
- if (this.paperData.item[this.quIndex].children.length) {
|
|
|
- //当前小题不是最后一个
|
|
|
- if (this.childIndex < this.paperData.item[this.quIndex].children.length - 1) {
|
|
|
- this.childIndex++
|
|
|
- }
|
|
|
- //当前小题是最后一个,需要判断下一个题目类型
|
|
|
- //下一个题目是综合题
|
|
|
- else if (this.childIndex == this.paperData.item[this.quIndex].children.length - 1 && this.paperData.item[this.quIndex + 1].children.length) {
|
|
|
- this.quIndex++
|
|
|
- this.childIndex = 0
|
|
|
- }
|
|
|
- // 下一个题目不是综合题
|
|
|
- else {
|
|
|
- this.quIndex++
|
|
|
- this.childIndex = -1
|
|
|
+ //如果是按题分配的则在分配的题目里面获取下一题
|
|
|
+ if (this.taskInfo.qu.length) {
|
|
|
+ //指定题目的数组在保存的时候是做了排序的,所以这里可以直接循环判断大小即可
|
|
|
+ let has = false
|
|
|
+ for (let qu of this.taskInfo.qu) {
|
|
|
+ if (qu > this.quIndex && this.stuScore[qu] == -1) {
|
|
|
+ this.quIndex = qu
|
|
|
+ has = true
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
- //当前题目不是综合题
|
|
|
- else {
|
|
|
- //下一个题目是综合题
|
|
|
- if (this.paperData.item[this.quIndex + 1].children.length) {
|
|
|
- this.quIndex++
|
|
|
- this.childIndex = 0
|
|
|
- }
|
|
|
- // 下一个题目不是综合题
|
|
|
- else {
|
|
|
- this.quIndex++
|
|
|
- this.childIndex = -1
|
|
|
- }
|
|
|
+ if (!has) {
|
|
|
+ this.$Message.success('还有未阅题目')
|
|
|
}
|
|
|
}
|
|
|
- //如果是最后一题
|
|
|
+ //按人分配则在所有题目里面获取下一题
|
|
|
else {
|
|
|
- //当前题目是综合题,并且不是小题最后一题
|
|
|
- if (this.paperData.item[this.quIndex].children.length && this.childIndex < this.paperData.item[this.quIndex].children.length - 1) {
|
|
|
- this.childIndex++
|
|
|
- }
|
|
|
- //当前目不是综合题 则代表题号已经到最后一个
|
|
|
- else {
|
|
|
- //检查所有题目是否完成评测
|
|
|
- if (this.stuScore.includes(-1)) {
|
|
|
- let qu = ''
|
|
|
- let quIndex = 0
|
|
|
- let childIndex = -1
|
|
|
- let realIndex = 0
|
|
|
- // 检测具体未评分的题目
|
|
|
- for (let i = 0; i < this.paperData.item.length; i++) {
|
|
|
- if (this.paperData.item[i].children.length) {
|
|
|
- let flag = false
|
|
|
- for (let j = 0; j < this.paperData.item[i].children.length; j++) {
|
|
|
- if (this.stuScore[realIndex++] == -1) {
|
|
|
- quIndex = i
|
|
|
- childIndex = j
|
|
|
- flag = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if (flag) {
|
|
|
- break
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (this.stuScore[realIndex++] == -1) {
|
|
|
- quIndex = i
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- qu = childIndex > -1 ? `${(quIndex + 1)}-${(childIndex + 1)}` : quIndex
|
|
|
- this.$Modal.confirm({
|
|
|
- title: this.$t('learnActivity.mark.ummarkQu'),
|
|
|
- content: `${qu}${this.$t('learnActivity.mark.unmarkContent')}`,
|
|
|
- onOk: () => {
|
|
|
- this.quIndex = quIndex
|
|
|
- this.childIndex = childIndex
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$Message.success(this.$t('learnActivity.mark.finished'))
|
|
|
- if (this.autoStu) {
|
|
|
- //TODE 随机获取下一位学生
|
|
|
- this.toggleStatus = true
|
|
|
- }
|
|
|
+ let has = false
|
|
|
+ for (let qu of this.quNoList) {
|
|
|
+ if (qu.value > this.quIndex && this.stuScore[qu] == -1) {
|
|
|
+ this.quIndex = qu.value
|
|
|
+ has = true
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
+ if (!has) {
|
|
|
+ this.$Message.success('还有未阅题目')
|
|
|
+ }
|
|
|
}
|
|
|
- this.score = this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)] == -1 ? null : this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)]
|
|
|
+ this.score = this.stuScore[this.quIndex] == -1 ? null : this.stuScore[this.quIndex]
|
|
|
},
|
|
|
|
|
|
quit() {
|
|
@@ -395,6 +384,7 @@ export default {
|
|
|
*/
|
|
|
async toByStuView(stuId) {
|
|
|
this.toggleStatus = false
|
|
|
+ this.isComplete = false
|
|
|
// 如果挑选的是当前的学生
|
|
|
if (stuId) {
|
|
|
let stuInfo = this.stusData.find(item => {
|
|
@@ -408,7 +398,9 @@ export default {
|
|
|
stuInfo.answer = ansBlob ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`)) : []
|
|
|
}
|
|
|
this.stuAnswer = stuInfo.answer
|
|
|
- this.stuScore = stuInfo.scores
|
|
|
+ this.stuScore = stuInfo.item.map(item => {
|
|
|
+ return item.sc
|
|
|
+ })
|
|
|
this.stuId = stuId
|
|
|
}
|
|
|
// 随机获取一名学生
|
|
@@ -435,7 +427,6 @@ export default {
|
|
|
* @param stuId 如果传了stuid则会获取对应学生的数据,否则随机获取一个学生
|
|
|
*/
|
|
|
getNextStu(stuId) {
|
|
|
- console.log(this.markList, this.taskInfo)
|
|
|
let requestData = {
|
|
|
code: this.taskInfo.ecode.replace('Exam-', ''),
|
|
|
id: this.taskInfo.id,
|
|
@@ -447,19 +438,18 @@ export default {
|
|
|
this.$api.mark.FindNextStu(requestData).then(
|
|
|
async res => {
|
|
|
if (res && !res.msg) {
|
|
|
- console.log('数据格式', this.stusData)
|
|
|
this.stusData.push(res)
|
|
|
-
|
|
|
let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
|
|
|
let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
|
|
|
-
|
|
|
let index = res.tIds.indexOf(this.$store.state.userInfo.TEAMModelId)
|
|
|
let ansBlob = index > -1 ? res.marks[index] || res.blob : res.blob
|
|
|
let answer = ansBlob ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`)) : []
|
|
|
|
|
|
this.stuId = res.stuId
|
|
|
this.stuAnswer = answer
|
|
|
- this.stuScore = res.scores
|
|
|
+ this.stuScore = res.item.map(item => {
|
|
|
+ return item.sc
|
|
|
+ })
|
|
|
this.toggleStatus = false
|
|
|
} else {
|
|
|
this.$Message.error('API ERROR')
|
|
@@ -479,36 +469,38 @@ export default {
|
|
|
this.paperData = routeData.fullPaper
|
|
|
this.stuAnswer = routeData.answer
|
|
|
this.stuScore = routeData.score
|
|
|
+ this.quScore = routeData.quScore
|
|
|
this.stusData = routeData.stusData
|
|
|
this.taskInfo = routeData.task
|
|
|
this.stuId = routeData.stuId
|
|
|
- //初始化题目index
|
|
|
- if (this.paperData && this.paperData.item.length) {
|
|
|
- this.quIndex = 0
|
|
|
- if (this.paperData.item[this.quIndex] && this.paperData.item[this.quIndex].children.length) {
|
|
|
- this.childIndex = 0
|
|
|
+ this.stuData = routeData.stuData
|
|
|
+ console.log('路由数据',routeData)
|
|
|
+ if (this.paperData && this.stuAnswer && this.stuScore && this.quScore && this.taskInfo && this.stuId) {
|
|
|
+ //初始化题目index
|
|
|
+ if (this.taskInfo.qu && this.taskInfo.qu.length) {
|
|
|
+ this.quIndex = this.taskInfo.qu[0]
|
|
|
+ } else {
|
|
|
+ this.quIndex = 0
|
|
|
}
|
|
|
- }
|
|
|
- //默认表情包
|
|
|
- for (let i = 0; i < 9; i++) {
|
|
|
- this.imgs.push(require('@/assets/mark/' + i + '.svg'))
|
|
|
+ //默认表情包
|
|
|
+ for (let i = 0; i < 9; i++) {
|
|
|
+ this.imgs.push(require('@/assets/mark/' + i + '.svg'))
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$Message.error('数据错误')
|
|
|
+ this.quit()
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- /**当期题目分数数组 */
|
|
|
+ /**题目分数数组 */
|
|
|
quScoreArr() {
|
|
|
- let score = 0
|
|
|
- if (this.childIndex > -1 && this.paperData.item[this.quIndex] && this.paperData.item[this.quIndex].children) {
|
|
|
- score = this.paperData.item[this.quIndex].children[this.childIndex].score
|
|
|
- } else {
|
|
|
- score = this.paperData.item[this.quIndex].score
|
|
|
- }
|
|
|
+ let score = this.quScore[this.quIndex] || 10
|
|
|
return Array.from(new Array(score + 1).keys())
|
|
|
},
|
|
|
/**当前题目作答数据 */
|
|
|
curAnswer() {
|
|
|
if (this.stuAnswer.length) {
|
|
|
- let index = this.getScoreIndex(this.quIndex, this.childIndex)
|
|
|
+ let index = this.quIndex
|
|
|
this.score = this.stuScore[index] == -1 ? null : this.stuScore[index]
|
|
|
return this.stuAnswer[index]
|
|
|
} else {
|
|
@@ -522,11 +514,74 @@ export default {
|
|
|
b = b == -1 ? 0 : b
|
|
|
return a + b
|
|
|
}, 0)
|
|
|
+ },
|
|
|
+ //试卷题号列表
|
|
|
+ quNoList() {
|
|
|
+ if (this.paperData.item.length) {
|
|
|
+ let objectiveQu = ['single', 'multiple', 'judge']
|
|
|
+ let data = []
|
|
|
+ let realIndex = 0
|
|
|
+ this.paperData.item.forEach((item, index) => {
|
|
|
+ if (item.children.length) {
|
|
|
+ item.children.forEach((childItem, childIndex) => {
|
|
|
+ data.push({
|
|
|
+ label: (index + 1) + '-' + (childIndex + 1),
|
|
|
+ value: realIndex++,
|
|
|
+ disabled: objectiveQu.includes(childItem.type)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ data.push({
|
|
|
+ label: (index + 1) + '',
|
|
|
+ value: realIndex++,
|
|
|
+ disabled: objectiveQu.includes(item.type)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ return []
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang="less">
|
|
|
+.continue-btn {
|
|
|
+ margin-top: 50px;
|
|
|
+ width: 150px;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.quit-btn {
|
|
|
+ display: block;
|
|
|
+ width: 150px;
|
|
|
+ margin-top: 4px;
|
|
|
+}
|
|
|
+.complete-mark {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: #fcfcfc;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ .complete-box {
|
|
|
+ text-align: center;
|
|
|
+ margin-top: -50px;
|
|
|
+ font-size: 16px;
|
|
|
+ padding: 50px 80px;
|
|
|
+ height: fit-content;
|
|
|
+ box-shadow: 0px 0px 10px #dbdbdb;
|
|
|
+ background: white;
|
|
|
+ }
|
|
|
+ .ok-icon {
|
|
|
+ color: #19be6b;
|
|
|
+ display: block;
|
|
|
+ font-size: 110px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.reason-item {
|
|
|
+ display: block;
|
|
|
+ margin: 10px;
|
|
|
+}
|
|
|
.light-stu-prog {
|
|
|
margin-bottom: 15px;
|
|
|
}
|