Sfoglia il codice sorgente

#3200 C696 个人评测--协同/任课教师查询非本人发布活动,查询异常(前端)

XW 1 anno fa
parent
commit
3c5eac3a38

+ 1 - 1
TEAMModelOS/ClientApp/src/components/student-web/ClassRecord/ExamTable.vue

@@ -252,7 +252,7 @@ export default {
             this.dataLoading = true
             let requestData = {
                 id: this.examDetaiInfo.id,
-                code: this.recordInfo.scope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
+                code: this.recordInfo.scope == 'school' ? this.$store.state.userInfo.schoolCode : this.examDetaiInfo.code.substr(this.examDetaiInfo.code.lastIndexOf("-") + 1),
                 subjectId: this.recordInfo.subjectId,
                 classId: this.recordInfo.groupIds[0],
 				startTime: this.examInfo.startTime,

+ 1 - 1
TEAMModelOS/ClientApp/src/view/classrecord/eventchart/ExamTable.vue

@@ -251,7 +251,7 @@ export default {
             this.dataLoading = true
             let requestData = {
                 id: this.examInfo.id,
-                code: this.recordInfo.scope == 'school' ? this.$store.state.userInfo.schoolCode : this.recordInfo.tmdid,
+                code: this.recordInfo.scope == 'school' ? this.$store.state.userInfo.schoolCode : this.examInfo.code.substr(this.examInfo.code.lastIndexOf("-") + 1),
                 subjectId: this.recordInfo.scope == 'school' ? this.recordInfo.subjectId : this.recordInfo.courseId,
                 classId: this.recordInfo.groupIds[0],
 				startTime: this.examInfo.startTime,

+ 6 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/ExamMgt.vue

@@ -661,7 +661,12 @@
 									resData.papers[index].owner = resData.owner;
 									resData.papers[index].sheetNo = sheetNo;
 									try {
-										resData.papers[index] = await this.$evTools.getFullPaper(resData.papers[index]);
+										let tmdid = this.evaListShow[this.curEvaIndex].code.substr(this.evaListShow[this.curEvaIndex].code.lastIndexOf("-") + 1)
+										if(tmdid != this.$store.state.userInfo.TEAMModelId && this.evaListShow[this.curEvaIndex].scope != 'school') {
+											resData.papers[index] = await this.$evTools.getFullPaperByTmdId(tmdid, resData.papers[index].blob)
+										} else {
+											resData.papers[index] = await this.$evTools.getFullPaper(resData.papers[index])
+										}
 									} catch (e) {
 										resData.papers[index].item = [];
 										resData.examPaperErr = true;

+ 9 - 7
TEAMModelOS/ClientApp/src/view/learnactivity/StuReport.vue

@@ -310,14 +310,16 @@ export default {
           this.filed = res.filed[subjectIndex]
           let sas = this.examInfo.scope === 'school' ? this.$store.state.user.schoolProfile.blob_sas : this.$store.state.user.userProfile.blob_sas
           let blobUrl = this.examInfo.scope === 'school' ? JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
-          this.markData = res.mark[subjectIndex].map(item => {
-            if (item.length) {
-              for (const mark of item) {
-                mark.mark = blobUrl + "/" + mark.mark + "?" + sas
+          if(res.mark[subjectIndex]) {
+            this.markData = res.mark[subjectIndex].map(item => {
+              if (item.length) {
+                for (const mark of item) {
+                  mark.mark = blobUrl + "/" + mark.mark + "?" + sas
+                }
               }
-            }
-            return item
-          })
+              return item
+            })
+          }
           this.stuDataNew = {
             total: 0,
             data: res.stuScore[subjectIndex]

+ 2 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/tabs/AnswerTable.vue

@@ -764,7 +764,7 @@
 					cList.forEach((c) => {
 						let requestData = {
 							id: this.examInfo.id,
-							code: this.examInfo.scope == "school" ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
+							code: this.examInfo.scope == "school" ? this.$store.state.userInfo.schoolCode : this.examInfo.code.substr(this.examInfo.code.lastIndexOf("-") + 1),
 							subjectId: subject.id,
 							classId: c,
 							startTime: this.examInfo.startTime,
@@ -1029,7 +1029,7 @@
 				this.dataLoading = true;
 				let requestData = {
 					id: this.examInfo.id,
-					code: this.examInfo.scope == "school" ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
+					code: this.examInfo.scope == "school" ? this.$store.state.userInfo.schoolCode : this.examInfo.code.substr(this.examInfo.code.lastIndexOf("-") + 1),
 					subjectId: this.chooseSubject,
 					classId: this.chooseClass,
 					startTime: this.examInfo.startTime,

+ 17 - 4
TEAMModelOS/ClientApp/src/view/mycourse/exam/EvDetail.vue

@@ -174,7 +174,7 @@ export default {
             )
         },
         //查询当前评测的完整信息
-        findExamInfo(examId, code) {
+        findExamInfo(examId, code, scope) {
             let requestData = {
                 id: examId,
                 code: code.includes('Exam-') ? code : 'Exam-' + code
@@ -195,7 +195,19 @@ export default {
                                     let blob = resData.papers[index].blob
                                     resData.papers[index].examScope = resData.scope
                                     resData.papers[index].examId = resData.id
-                                    resData.papers[index] = await this.$evTools.getFullPaper(resData.papers[index])
+                                    // resData.papers[index] = await this.$evTools.getFullPaper(resData.papers[index])
+                                    try {
+										let tmdid = code.includes('Exam-') ? code.substr(code.lastIndexOf("-") + 1) : code
+										if(tmdid != this.$store.state.userInfo.TEAMModelId && scope != 'school') {
+											resData.papers[index] = await this.$evTools.getFullPaperByTmdId(tmdid, resData.papers[index].blob)
+										} else {
+											resData.papers[index] = await this.$evTools.getFullPaper(resData.papers[index])
+										}
+									} catch (e) {
+										resData.papers[index].item = [];
+										resData.examPaperErr = true;
+										this.$Message.error(this.$t("learnActivity.simple.paperErr"));
+									}
                                     resData.papers[index].blob = blob
                                     //处理试卷渲染组件需要的字段
                                     resData.papers[index].examScope = resData.scope
@@ -272,8 +284,9 @@ export default {
     created() {
         let examId = this.$route.query.examId
         let code = this.$route.query.code
-        if (examId && code) {
-            this.findExamInfo(examId, code)
+        let scope = this.$route.query.scope
+        if (examId && code && scope) {
+            this.findExamInfo(examId, code, scope)
         } else {
             this.$router.push({
                 path: '/home/myCourse'

+ 2 - 1
TEAMModelOS/ClientApp/src/view/mycourse/exam/Exam.vue

@@ -330,7 +330,8 @@ export default {
                 path: '/home/evDetail',
                 query: {
                     examId: this.examList[index].id,
-                    code: this.examList[index].code
+                    code: this.examList[index].code,
+                    scope: this.examList[index].scope,
                 }
             })
         },