|
@@ -20,12 +20,12 @@
|
|
|
<div class="btn-wrap">
|
|
|
<span class="action-btn" @click="toggleStatus = !toggleStatus">
|
|
|
<Icon type="md-shuffle" class="action-btn-icon" />
|
|
|
- 切换
|
|
|
+ 切换学生
|
|
|
</span>
|
|
|
- <span class="action-btn">
|
|
|
+ <!-- <span class="action-btn">
|
|
|
<Icon type="md-refresh" class="action-btn-icon" />
|
|
|
回评
|
|
|
- </span>
|
|
|
+ </span> -->
|
|
|
<span class="action-btn">
|
|
|
<Icon custom="iconfont icon-exception" class="action-btn-icon" />
|
|
|
异常申报
|
|
@@ -51,7 +51,7 @@
|
|
|
<!-- <Icon :custom="isFull ? 'iconfont icon-cancel-full' : 'iconfont icon-full-screen'" class="tool-icon" :title="isFull ? '取消全屏' : '全屏'" @click="togglefull" /> -->
|
|
|
</div>
|
|
|
<div class="mark-stage">
|
|
|
- <MarkCanvas :mouseStatus="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
|
|
|
+ <MarkCanvas ref="markCanvas" @getImg="saveMark" :status="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
|
|
|
<!-- 题号显示部分 -->
|
|
|
<div class="qu-index-box">
|
|
|
<div class="qu-tips-box">
|
|
@@ -112,7 +112,7 @@
|
|
|
<!-- 用来单独渲染学生作答数据,提高tocanvas 的效率 -->
|
|
|
<iframe id="markIframe" :srcdoc="curAnswer"></iframe>
|
|
|
<Modal v-model="toggleStatus" title="切换学生" :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"></StuProg>
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -151,37 +151,35 @@ export default {
|
|
|
stuScore: [],
|
|
|
taskInfo: {},
|
|
|
stusData: [],
|
|
|
- stuId: ''
|
|
|
+ stuId: '',
|
|
|
+ markImg: undefined
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- /**
|
|
|
- * 按人阅卷
|
|
|
- */
|
|
|
- toByStuView(stuId) {
|
|
|
- this.$Message.warning('这里切换学生逻辑暂未处理!')
|
|
|
+ //保存批注
|
|
|
+ saveMark(data) {
|
|
|
+ console.log(data)
|
|
|
+ this.markImg = data.base64
|
|
|
},
|
|
|
drawImg(imgIndex) {
|
|
|
- // this.activeIcon = imgIndex
|
|
|
- // this.curImg = new Image()
|
|
|
- // this.curImg.src = this.imgs[imgIndex]
|
|
|
- // this.curImg.onload = () => {
|
|
|
- // this.mouseStatus = 'img'
|
|
|
- // this.startImg({ x: 100, y: 100 })
|
|
|
- // }
|
|
|
+ let curImg = new Image()
|
|
|
+ curImg.src = this.imgs[imgIndex]
|
|
|
+ curImg.onload = () => {
|
|
|
+ this.mouseStatus = 'img'
|
|
|
+ this.drawImgData = curImg
|
|
|
+ }
|
|
|
},
|
|
|
//清除所有批注
|
|
|
clear() {
|
|
|
-
|
|
|
- // this.markLayer.removeChildren()
|
|
|
- // this.stage.add(this.markLayer)
|
|
|
+ this.$refs['markCanvas'].clear()
|
|
|
},
|
|
|
/**将答案绘制到canvas上 */
|
|
|
ansToImg() {
|
|
|
let answerIframe = document.getElementById('markIframe')
|
|
|
answerIframe.onload = () => {
|
|
|
answerIframe.style.width = '850px'
|
|
|
- // answerIframe.contentWindow.document.body.style.margin = '0px 20px'
|
|
|
+ answerIframe.style.margin = '0px'
|
|
|
+ answerIframe.contentWindow.document.body.style.margin = '0px'
|
|
|
answerIframe.contentWindow.document.body.style.padding = '10px'
|
|
|
answerIframe.contentWindow.document.body.style.minWidth = '600px'
|
|
|
answerIframe.contentWindow.document.body.style.minHeight = '240px'
|
|
@@ -197,10 +195,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- //将图片(答案)绘制到canvas
|
|
|
- imgToCanvas(img) {
|
|
|
- console.log('将图片(答案)绘制到canvas', img)
|
|
|
- },
|
|
|
/** 打分 */
|
|
|
setScore(score) {
|
|
|
this.score = score
|
|
@@ -237,12 +231,20 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- console.log('输出', realIndex)
|
|
|
return --realIndex
|
|
|
},
|
|
|
//提交分数
|
|
|
submit() {
|
|
|
if (this.score > -1 && this.score != null) {
|
|
|
+ //保存批注
|
|
|
+ let mark
|
|
|
+ if (this.markImg) {
|
|
|
+ let img = document.createElement('img')
|
|
|
+ img.src = this.markImg
|
|
|
+ this.stuAnswer[this.getScoreIndex(this.quIndex, this.childIndex)] = img.outerHTML
|
|
|
+ mark = this.stuAnswer
|
|
|
+ this.markImg = undefined
|
|
|
+ }
|
|
|
let requstData = {
|
|
|
id: this.taskInfo.id,
|
|
|
stuId: this.stuId,
|
|
@@ -251,7 +253,7 @@ export default {
|
|
|
score: this.stuScore,
|
|
|
count: this.taskInfo.count,
|
|
|
code: this.taskInfo.ecode.replace('Exam-', ''),
|
|
|
- mark: ''
|
|
|
+ mark
|
|
|
}
|
|
|
this.$api.mark.saveScore(requstData).then(
|
|
|
res => {
|
|
@@ -269,6 +271,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
nextQuestion() {
|
|
|
+ //首先判断是都已阅完
|
|
|
+ if (!this.stuScore.includes(-1)) {
|
|
|
+ if (this.autoStu) {
|
|
|
+ this.toggleStatus = true
|
|
|
+ } else {
|
|
|
+ this.$Message.warning('当前完成当前学生评分,如果继续评分,请切换学生')
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 当前不是最后一题
|
|
|
if (this.quIndex < this.paperData.item.length - 1) {
|
|
|
//当前题目是综合题
|
|
@@ -352,6 +364,7 @@ export default {
|
|
|
this.$Message.success('已阅完')
|
|
|
if (this.autoStu) {
|
|
|
//TODE 随机获取下一位学生
|
|
|
+ this.toggleStatus = true
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -366,11 +379,86 @@ export default {
|
|
|
name: sessionStorage.getItem('markFrom')
|
|
|
})
|
|
|
},
|
|
|
- uuid() {
|
|
|
- function S4() {
|
|
|
- return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
|
|
|
+ /**
|
|
|
+ * 按人阅卷
|
|
|
+ */
|
|
|
+ async toByStuView(stuId) {
|
|
|
+ this.toggleStatus = false
|
|
|
+ // 如果挑选的是当前的学生
|
|
|
+ if (stuId) {
|
|
|
+ let stuInfo = this.stusData.find(item => {
|
|
|
+ return item.stuId == stuId
|
|
|
+ })
|
|
|
+ if (stuInfo && !stuInfo.info.answer) {
|
|
|
+ let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
|
|
|
+ let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
|
|
|
+ let ansBlob = stuInfo.info.mark || stuInfo.info.ans
|
|
|
+ stuInfo.info.answer = ansBlob ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`)) : []
|
|
|
+ }
|
|
|
+ this.stuAnswer = stuInfo.info.answer
|
|
|
+ this.stuScore = stuInfo.info.score
|
|
|
+ this.stuId = stuId
|
|
|
+ }
|
|
|
+ // 随机获取一名学生
|
|
|
+ else {
|
|
|
+ if (this.taskInfo.count == this.stusData.length) {
|
|
|
+ let res = this.stusData.filter(item => {
|
|
|
+ return item.info.score.includes(-1)
|
|
|
+ })
|
|
|
+ if (res.length) {
|
|
|
+ this.$Message.warning('已无未阅学生,请挑选进行中的学生继续阅卷。')
|
|
|
+ this.toggleStatus = true
|
|
|
+ } else {
|
|
|
+ this.$Message.success('您已完成阅卷任务')
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.getNextStu()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 批阅下个学生
|
|
|
+ * @param stuId 如果传了stuid则会获取对应学生的数据,否则随机获取一个学生
|
|
|
+ */
|
|
|
+ getNextStu(stuId) {
|
|
|
+ let requestData = {
|
|
|
+ code: this.markList[this.curTaskIndex].ecode.replace('Exam-', ''),
|
|
|
+ id: this.markList[this.curTaskIndex].id,
|
|
|
+ subjectId: this.markList[this.curTaskIndex].subject,
|
|
|
+ count: this.markList[this.curTaskIndex].count,
|
|
|
+ tmdId: this.$store.state.userInfo.TEAMModelId,
|
|
|
+ stuId
|
|
|
+ }
|
|
|
+ this.$api.mark.FindNextStu(requestData).then(
|
|
|
+ async res => {
|
|
|
+ if (res) {
|
|
|
+ let obj = {
|
|
|
+ stuId: res.stuId,
|
|
|
+ info: {
|
|
|
+ ans: res.ans.ans,
|
|
|
+ score: res.ans.score,
|
|
|
+ mark: res.ans.mark
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
|
|
|
+ let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
|
|
|
+ obj.info.answer = JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${obj.info.ans}?${sas}`))
|
|
|
+ this.stusData.push(obj)
|
|
|
+
|
|
|
+ this.stuId = res.stuId
|
|
|
+ this.stuAnswer = obj.info.answer
|
|
|
+ this.stuScore = obj.info.score
|
|
|
+ this.toggleStatus = false
|
|
|
+ } else {
|
|
|
+ this.$Message.error('API ERROR')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error('API ERROR')
|
|
|
+ }
|
|
|
+ )
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
@@ -429,7 +517,7 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped lang="less">
|
|
|
-.light-stu-prog{
|
|
|
+.light-stu-prog {
|
|
|
margin-bottom: 15px;
|
|
|
}
|
|
|
.score-setting-wrap {
|
|
@@ -736,29 +824,29 @@ export default {
|
|
|
color: red;
|
|
|
font-weight: 800;
|
|
|
}
|
|
|
-.light-stu-prog .setting-content{
|
|
|
- background: #FFF;
|
|
|
+.light-stu-prog .setting-content {
|
|
|
+ background: #fff;
|
|
|
box-shadow: none;
|
|
|
border-color: #e8eaec;
|
|
|
}
|
|
|
-.light-stu-prog .filter-tab-item{
|
|
|
+.light-stu-prog .filter-tab-item {
|
|
|
border-color: #e8eaec;
|
|
|
}
|
|
|
-.light-stu-prog .filter-tab-item-active{
|
|
|
- background: #FFF !important;
|
|
|
+.light-stu-prog .filter-tab-item-active {
|
|
|
+ background: #fff !important;
|
|
|
color: black;
|
|
|
}
|
|
|
-.light-stu-prog .filter-tab-item{
|
|
|
- background: #EEE;
|
|
|
+.light-stu-prog .filter-tab-item {
|
|
|
+ background: #eee;
|
|
|
}
|
|
|
-.light-stu-prog .no-mark-text .no-mark-count{
|
|
|
+.light-stu-prog .no-mark-text .no-mark-count {
|
|
|
color: #515a6e;
|
|
|
}
|
|
|
-.light-stu-prog .stu-name{
|
|
|
+.light-stu-prog .stu-name {
|
|
|
background: #eee;
|
|
|
color: #515a6e;
|
|
|
}
|
|
|
-.light-stu-prog .stu-name:hover{
|
|
|
+.light-stu-prog .stu-name:hover {
|
|
|
color: #515a6e;
|
|
|
box-shadow: 0px 0px 5px 2px #ccc;
|
|
|
}
|