소스 검색

#3741 C1148 学生端--无法正常获取智慧练习试题(前端)

XW 5 달 전
부모
커밋
25f4f666e0
2개의 변경된 파일16개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 0
      TEAMModelOS/ClientApp/src/api/studentWeb.js
  2. 12 4
      TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/AnswerBox.vue

+ 4 - 0
TEAMModelOS/ClientApp/src/api/studentWeb.js

@@ -320,6 +320,10 @@ export default {
 			})
 		})
     },
+    // 需要删除的错题
+    deleteWrongItem: function(data) {
+        return post("/common/exam/delete-wrong-item", data)
+    },
     // 获取错题数量
     getErrorItemCnt: function(data) {
         return post("/common/exam/get-error-item-cnt", data)

+ 12 - 4
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/AnswerBox.vue

@@ -486,11 +486,11 @@ export default {
             })
             this.$api.studentWeb.getExamItem(params).then(async res => {
                 try {
+                    let newList = this._.cloneDeep(this.qsAll)
                     if(res.error.length) {
                         let sas = await this.getSas(this.courseNow.scope)
                         let code = this.courseNow.scope === 'school' ? (this.userInfo.scope === 'student' ? this.userInfo.azp : this.userInfo.sub) : this.courseNow.teacherId
                         let courId = this.courseNow.scope === 'school' ? (this.$route.params.subjectId || this.courseNow.subject.id) : this.courseNow.id
-                        let newList = this._.cloneDeep(this.qsAll)
                         for (let i = 0; i < newList.length; i++) {
                             let info = res.error.find(err => newList[i].qId === err.items.id)
                             if(!info) {
@@ -559,6 +559,14 @@ export default {
                             }
                         }
                     } else {
+                        for (let i = 0; i < newList.length; i++) {
+                            this.noInfoExe ++
+                            this.noInfoExamArr.push({
+                                activityId: newList[i].activityId,
+                                qId: newList[i].qId,
+                                unitId: newList[i].unitId
+                            })
+                        }
                         this.$Message.error(this.$t('studentWeb.wrongQues.message2'))
                         setTimeout(() => {
                             this.$router.go(-1)
@@ -581,10 +589,10 @@ export default {
         deleteExam() {
             let params = {
                 sid: this.courseNow.scope == 'school' ? `${this.courseNow.school}-${this.userInfo.sub}` : `${this.userInfo.sub}`,
-                data: JSON.stringify(this.noInfoExamArr)
+                data: this.noInfoExamArr
             }
-            this.$api.studentWeb.deleteExam(params, this.$parent.wrongApi).then(res => {
-                if(res.data.err) {
+            this.$api.studentWeb.deleteWrongItem(params).then(res => {
+                if(res.errors) {
 
                 }
             })