فهرست منبع

阅卷打分验证

liqk 4 سال پیش
والد
کامیت
7cd61011cc

+ 2 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/MgtSchoolEva.vue

@@ -109,10 +109,10 @@
                     </span>
 
                     <!-- 阅卷功能0531之前完成不了,暂时隐藏 -->
-                    <!-- <span :class="curBarIndex == 2 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(2)">
+                    <span :class="curBarIndex == 2 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(2)">
                         {{$t('learnActivity.mgtScEv.markSetting')}}
                     </span>
-                    <span :class="curBarIndex == 3 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(3)">
+                    <!-- <span :class="curBarIndex == 3 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(3)">
                         {{$t('learnActivity.mgtScEv.markData')}}
                     </span> -->
 

+ 27 - 19
TEAMModelOS/ClientApp/src/view/task/index.vue

@@ -336,22 +336,29 @@ export default {
             sessionStorage.setItem('markFrom', this.$route.name)
             let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
             let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
-            let stuInfo = this.markData.attr.find(item => {
-                return item.stuId == stuId
-            })
-            let answer, score
-            if (stuInfo) {
-                answer = await this.$tools.getFile(`${blobUrl}/exam/${stuInfo.info.ans}?${sas}`)
-                answer = answer ? JSON.parse(answer) : []
+
+            let answer, score, sId
+            if (stuId) {
+                let stuInfo = this.markData.attr.find(item => {
+                    return item.stuId == stuId
+                })
+                answer = stuInfo.info.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${stuInfo.info.ans}?${sas}`)) : []
                 score = stuInfo.info.score
+                sId = stuId
+            } else {
+                let resData = await this.getNextStu()
+                console.log('API返回了',resData)
+                answer = resData.ans.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${resData.ans.ans}?${sas}`)) : []
+                score = resData.ans.score
+                sId = resData.stuId
             }
-            // this.getNextStu(stuId)
+            console.log('跳转了')
             this.$router.push({
                 name: 'ByStu',
                 params: {
                     from: this.$route.name,
                     task: this.markList[this.curTaskIndex],
-                    stuId: stuInfo.stuId,
+                    stuId: sId,
                     fullPaper: this.fullPaper,
                     answer,
                     score
@@ -370,7 +377,7 @@ export default {
             let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
             // 获取学生作答数据
             this.markData.attr.forEach(async item => {
-                item.info.answer = item.info.ans ? await this.$tools.getFile(`${blobUrl}/exam/${item.info.ans}?${sas}`) : []
+                item.info.answer = item.info.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${item.info.ans}?${sas}`)) : []
             })
             console.log(this.markData)
             this.$router.push({
@@ -396,16 +403,17 @@ export default {
                 subjectId: this.markList[this.curTaskIndex].subject,
                 count: this.markList[this.curTaskIndex].count,
                 tmdId: this.$store.state.userInfo.TEAMModelId,
-                stuId: 'hbcn070201'
+                stuId
             }
-            this.$api.mark.FindNextStu(requestData).then(
-                res => {
-                    console.log(res)
-                },
-                err => {
-                    console.log(err)
-                }
-            )
+            return this.$api.mark.FindNextStu(requestData)
+            // this.$api.mark.FindNextStu(requestData).then(
+            //     res => {
+            //         console.log(res)
+            //     },
+            //     err => {
+            //         console.log(err)
+            //     }
+            // )
         },
         /**获取type对应的label */
         getTypeLabel(code) {

+ 29 - 24
TEAMModelOS/ClientApp/src/view/task/mark/ByQu.vue

@@ -97,7 +97,7 @@ export default {
     },
     data() {
         return {
-            score: 0,
+            score: null,
             mouseStatus: 'move',
             drawImgData: '',
             ansImg: '',
@@ -157,27 +157,30 @@ export default {
         },
         //提交分数
         submit() {
-            let requstData = {
-                id: this.taskInfo.id,
-                stuId: this.stusInfo[this.stuIndex].stuId,
-                subjectId: this.taskInfo.subject,
-                tmdId: this.$store.state.userInfo.TEAMModelId,
-                score: this.stusInfo[this.stuIndex].info.score,
-                count: this.taskInfo.count,
-                code: this.taskInfo.ecode.replace('Exam-', ''),
-                mark: ''
-            }
-            this.$api.mark.saveScore(requstData).then(
-                res => {
-                    this.$Message.success('保存成功')
-                    //按题阅卷自动加载下一人
-                    this.getDefStu()
-                },
-                err => {
-                    this.$Message.error('保存失败')
+            if (this.score > -1 && this.score != null) {
+                let requstData = {
+                    id: this.taskInfo.id,
+                    stuId: this.stusInfo[this.stuIndex].stuId,
+                    subjectId: this.taskInfo.subject,
+                    tmdId: this.$store.state.userInfo.TEAMModelId,
+                    score: this.stusInfo[this.stuIndex].info.score,
+                    count: this.taskInfo.count,
+                    code: this.taskInfo.ecode.replace('Exam-', ''),
+                    mark: ''
                 }
-            )
-
+                this.$api.mark.saveScore(requstData).then(
+                    res => {
+                        this.$Message.success('保存成功')
+                        //按题阅卷自动加载下一人
+                        this.getDefStu()
+                    },
+                    err => {
+                        this.$Message.error('保存失败')
+                    }
+                )
+            } else {
+                this.$Message.warning('请先打分')
+            }
         },
         quit() {
             // 返回页面
@@ -208,6 +211,7 @@ export default {
             for (let i = 0; i < this.stusInfo.length; i++) {
                 if (this.stusInfo[i].info.score[scoreIndex] == -1) {
                     this.stuIndex = i
+                    this.score = null
                     has = true
                 }
             }
@@ -215,7 +219,7 @@ export default {
             if (!has && this.stusInfo.length == this.taskInfo.count) {
                 // 提示当前题目已阅完,切换题目
                 this.$Message.warning('当前题目已阅完,请切换题目')
-            } else if (!has && this.stusInfo.length < this.taskInfo.count){
+            } else if (!has && this.stusInfo.length < this.taskInfo.count) {
                 //当前学生数据已阅,需要继续随机获取学生进行阅卷
                 this.getNextStu()
             }
@@ -230,7 +234,7 @@ export default {
                 id: this.taskInfo.id,
                 subjectId: this.taskInfo.subject,
                 tmdId: this.$store.state.userInfo.TEAMModelId,
-                count:this.taskInfo.count,
+                count: this.taskInfo.count,
                 stuId: stuId
             }
             this.$api.mark.FindNextStu(requestData).then(
@@ -247,6 +251,7 @@ export default {
                         }
                     })
                     this.stuIndex = this.stusInfo.length - 1
+                    this.score = res.ans.score[this.getScoreIndex(this.quIndex,this.childIndex)] == -1 ? null : res.ans.score[this.getScoreIndex(this.quIndex,this.childIndex)]
                 },
                 err => {
                     console.log(err)
@@ -608,7 +613,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;

+ 40 - 26
TEAMModelOS/ClientApp/src/view/task/mark/ByStu.vue

@@ -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;