Prechádzať zdrojové kódy

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

CrazyIter_Bin 4 rokov pred
rodič
commit
952f08fdd7

+ 30 - 6
TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkSetting.vue

@@ -109,7 +109,7 @@
                                         <Button type="error" size="small" @click="removeMarker(row,index)">{{$t('learnActivity.mark.remove')}}</Button>
                                     </template>
                                     <template slot-scope="{ row }" slot="count">
-                                        <span>{{`${row.count}/${evInfo.stuCount}`}}</span>
+                                        <span>{{`${row.count}/${evInfo.stuCount * setting.num}`}}</span>
                                     </template>
                                     <template slot-scope="{ row }" slot="qu">
                                         <span :style="{color:setting.mode == 'full' ? '#2db7f5' : row.qu.length ? '#FFFFFF' : '#ed4014'}">
@@ -405,12 +405,13 @@ export default {
                         })
                     }
                 })
-                let more = this.evInfo.stuCount % subject.markers.length
+                let count = this.evInfo.stuCount * this.setting.num
+                let more = count % subject.markers.length
                 subject.markers.map((item, index) => {
                     if (index < more) {
-                        item.count = Math.ceil(this.evInfo.stuCount / subject.markers.length)
+                        item.count = Math.ceil(count / subject.markers.length)
                     } else {
-                        item.count = Math.floor(this.evInfo.stuCount / subject.markers.length)
+                        item.count = Math.floor(count / subject.markers.length)
                     }
 
                 })
@@ -493,6 +494,27 @@ export default {
                 this.$emit('statusChange', this.isSetting)
             },
             immediate: true
+        },
+        'setting.num': {
+            handler(n, o) {
+                console.log(n, this.setting)
+                if (this.setting.subs) {
+                    let count = this.evInfo.stuCount * this.setting.num
+                    this.setting.subs.forEach((item, subIndex) => {
+                        if (item.markers && item.markers.length) {
+                            let more = count % item.markers.length
+                            item.markers.map((m, index) => {
+                                if (index < more) {
+                                    this.$set(this.setting.subs[subIndex].markers[index], 'count', Math.ceil(count / item.markers.length))
+                                } else {
+                                    this.$set(this.setting.subs[subIndex].markers[index], 'count', Math.floor(count / item.markers.length))
+                                    // m.count = Math.floor(count / item.markers.length)
+                                }
+                            })
+                        }
+                    })
+                }
+            }
         }
     },
     computed: {
@@ -515,15 +537,17 @@ export default {
         },
         //从基础信息获取当前学科阅卷老师
         markers() {
+            console.log('变了')
             let arr = []
-            if (this.setting.subs && this.subjects && this.subjects[this.curSubIndex]) {
+            if (this.setting.num && this.setting.subs && this.subjects && this.subjects[this.curSubIndex]) {
                 let subject = this.setting.subs.find(item => {
                     return item.id == this.subjects[this.curSubIndex].id
                 })
                 if (subject) {
-                    arr = subject.markers
+                    arr = [...subject.markers]
                 }
             }
+            console.log(arr)
             return arr
         },
         //当前评测科目

+ 1 - 0
TEAMModelOS/ClientApp/src/view/task/index.vue

@@ -271,6 +271,7 @@ export default {
             this.markData.attr.forEach(async item => {
                 let index = item.tIds.indexOf(this.$store.state.userInfo.TEAMModelId)
                 let ansBlob = index > -1 ? item.marks[index] || item.blob : item.blob
+                console.log('遍历',ansBlob)
                 this.$set(item, 'answer', ansBlob ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`)) : [])
             })
             this.$router.push({

+ 9 - 11
TEAMModelOS/ClientApp/src/view/task/mark/ByQu.vue

@@ -1,5 +1,4 @@
 <template>
-    <!-- 未做多语言 -->
     <div class="mark-area">
         <!-- 头部基础信息 -->
         <div class="mark-header">
@@ -26,7 +25,7 @@
                     <Icon type="md-refresh" class="action-btn-icon" />
                     回评
                 </span> -->
-                <span class="action-btn"  @click="exception">
+                <span class="action-btn" @click="exception">
                     <Icon custom="iconfont icon-exception" class="action-btn-icon" />
                     {{$t('learnActivity.mark.exception')}}
                 </span>
@@ -136,7 +135,7 @@ export default {
         }
     },
     methods: {
-        exception(){
+        exception() {
             this.$Message.warning('功能开发中')
         },
         setQuIndex(data) {
@@ -302,14 +301,12 @@ export default {
                 async res => {
                     let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
                     let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
-                    let ansBlob = res.ans.mark || res.ans.ans 
+                    let index = res.tIds.indexOf(this.$store.state.userInfo.TEAMModelId)
+                    let ansBlob = index > -1 ? res.marks[index] || res.blob : res.blob
                     this.stusInfo.push({
                         stuId: res.stuId,
-                        info: {
-                            ans: res.ans.ans,
-                            answer: ansBlob ? await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`) : [],
-                            score: res.ans.score
-                        }
+                        answer: ansBlob ? await this.$tools.getFile(`${blobUrl}/exam/${ansBlob}?${sas}`) : [],
+                        score: res.ans.score
                     })
                     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)]
@@ -352,13 +349,14 @@ export default {
             return `${marked}/${this.taskInfo.count}`
         },
         curAnswer() {
-            console.log('学生数据',this.stusInfo)
+            console.log('学生数据', this.stusInfo, this.stuIndex)
             if (this.stusInfo && this.stusInfo[this.stuIndex]) {
                 let s = this.stusInfo[this.stuIndex].scores[this.getScoreIndex(this.quIndex, this.childIndex)]
                 this.score = s == -1 ? null : s
-                if (this.stusInfo[this.stuIndex].answer) {
+                if (this.stusInfo[this.stuIndex].answer && this.stusInfo[this.stuIndex].answer.length) {
                     return this.stusInfo[this.stuIndex].answer[this.getScoreIndex(this.quIndex, this.childIndex)]
                 } else {
+                    console.log('未作答')
                     return this.stusInfo[this.stuIndex].stuId + this.$t('learnActivity.mark.noAnswer')
                 }
             } else {

+ 1 - 1
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -1789,7 +1789,7 @@ namespace TEAMModelOS.Controllers
                 List<ExamClassResult> classResults = new();
                 List<SDK.Models.Cosmos.Common.Scoring> attr = new();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
-                                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and array_contains(c.tIds,'{tId}') ",
+                                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.stuId = '{sId}' and array_contains(c.tIds,'{tId}') ",
                                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Scoring-{code}") }))
                 {
                     attr.Add(item);