|
@@ -53,7 +53,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"></MarkCanvas>
|
|
|
+ <MarkCanvas :mouseStatus="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
|
|
|
<!-- 题号显示部分 -->
|
|
|
<div class="qu-index-box">
|
|
|
<div class="qu-tips-box">
|
|
@@ -91,9 +91,11 @@
|
|
|
<Button size="small" type="error" ghost @click="score = 0">零分</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']">
|
|
|
- <span v-for="(item,index) in quScoreArr" :key="index" :class="['score-key', stuScore[getScoreIndex(quIndex,childIndex)] == index ? 'score-key-active':'']" @click="setScore(index)">
|
|
|
- {{item}}
|
|
|
- </span>
|
|
|
+ <vuescroll>
|
|
|
+ <span v-for="(item,index) in quScoreArr" :key="index" :class="['score-key', stuScore[getScoreIndex(quIndex,childIndex)] == index ? 'score-key-active':'']" @click="setScore(index)">
|
|
|
+ {{item}}
|
|
|
+ </span>
|
|
|
+ </vuescroll>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Button type="success" class="submit-score" @click="submit()">提交分数</Button>
|
|
@@ -174,7 +176,7 @@ export default {
|
|
|
let answerIframe = document.getElementById('markIframe')
|
|
|
answerIframe.onload = () => {
|
|
|
answerIframe.style.width = '850px'
|
|
|
- answerIframe.contentWindow.document.body.style.margin = '0px 20px'
|
|
|
+ // answerIframe.contentWindow.document.body.style.margin = '0px 20px'
|
|
|
answerIframe.contentWindow.document.body.style.padding = '10px'
|
|
|
answerIframe.contentWindow.document.body.style.minWidth = '600px'
|
|
|
answerIframe.contentWindow.document.body.style.minHeight = '240px'
|
|
@@ -183,12 +185,10 @@ export default {
|
|
|
let bodyWidth = answerIframe.contentWindow.document.body.clientWidth
|
|
|
answerIframe.style.width = (bodyWidth + 20) + 'px'
|
|
|
answerIframe.contentWindow.document.body.style.backgroundColor = '#f5f5f5'
|
|
|
- console.log('markIframe', answerIframe)
|
|
|
html2canvas(answerIframe.contentWindow.document.body, {}).then((canvas) => {
|
|
|
canvas.id = "canvas" + this.getScoreIndex(this.quIndex, this.childIndex)
|
|
|
this.ansImg = canvas.toDataURL()
|
|
|
// 将转出来的答案绘制到canvas上
|
|
|
- console.log(this.ansImg)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -200,25 +200,40 @@ export default {
|
|
|
setScore(score) {
|
|
|
this.score = score
|
|
|
this.$set(this.stuScore, this.getScoreIndex(this.quIndex, this.childIndex), score)
|
|
|
+ if (this.autoQu) {
|
|
|
+ this.submit()
|
|
|
+ }
|
|
|
},
|
|
|
toQu(index, childIndex) {
|
|
|
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 = index
|
|
|
+ let realIndex = 0
|
|
|
this.paperData.item.forEach((item, itemIndex) => {
|
|
|
- if (itemIndex < index && item.children.length) {
|
|
|
- realIndex += item.children.length
|
|
|
- } else if (itemIndex == index && item.children.length) {
|
|
|
- realIndex += childIndex
|
|
|
+ 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
|
|
|
+ console.log('输出', realIndex)
|
|
|
+ return --realIndex
|
|
|
},
|
|
|
//提交分数
|
|
|
submit() {
|
|
@@ -259,7 +274,7 @@ export default {
|
|
|
}
|
|
|
//当前小题是最后一个,需要判断下一个题目类型
|
|
|
//下一个题目是综合题
|
|
|
- if (this.paperData.item[this.quIndex + 1].children.length) {
|
|
|
+ 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
|
|
|
}
|
|
@@ -330,7 +345,7 @@ export default {
|
|
|
})
|
|
|
} else {
|
|
|
this.$Message.success('已阅完')
|
|
|
- if(this.autoStu){
|
|
|
+ if (this.autoStu) {
|
|
|
//TODE 随机获取下一位学生
|
|
|
}
|
|
|
}
|
|
@@ -355,11 +370,9 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.ansToImg()
|
|
|
-
|
|
|
},
|
|
|
created() {
|
|
|
let routeData = this.$route.params
|
|
|
- console.log('路由数据', routeData)
|
|
|
this.paperData = routeData.fullPaper
|
|
|
this.stuAnswer = routeData.answer
|
|
|
this.stuScore = routeData.score
|
|
@@ -466,15 +479,7 @@ export default {
|
|
|
margin: 10px;
|
|
|
height: auto;
|
|
|
}
|
|
|
-.container-box {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- width: 100%;
|
|
|
- padding: 10px;
|
|
|
-}
|
|
|
-#container {
|
|
|
- max-width: 100%;
|
|
|
-}
|
|
|
+
|
|
|
.qu-tips-box {
|
|
|
& :nth-child(1)::before {
|
|
|
background: #19be6b;
|