浏览代码

智慧錯題個人課程收集架構修正:呼叫智慧錯題庫參數修正,學校課程才傳遞學校簡碼。

jeff 1 年之前
父节点
当前提交
0dcc2bea34

+ 5 - 0
TEAMModelOS.FunctionV4/CosmosDB/TriggerExam.cs

@@ -1724,6 +1724,11 @@ namespace TEAMModelOS.FunctionV4
                         htc.DefaultRequestHeaders.Remove("x-functions-key");
                     }
                     htc.DefaultRequestHeaders.Add("x-functions-key", accessKey);
+                    ///智慧題庫school欄位修正
+                    foreach (ErrorItems error in errors)
+                    {
+                        error.school = (info.scope.Equals("school")) ? info.school : string.Empty;
+                    }
                     string paramJson = JsonConvert.SerializeObject(errors);
                     var content = new StringContent(paramJson, Encoding.UTF8, "application/json");
                     var response =  await htc.PostAsync(connect, content);

+ 2 - 1
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/AnswerBox.vue

@@ -692,7 +692,8 @@ export default {
                 // 结果传回后端,前端进行答错题目二次练习
                 clearInterval(this.timeAlarmTWO)
                 let param = {
-                    sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                    //sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                    sid: this.courseNow.scope == 'school' ? `${this.courseNow.school}-${this.userInfo.sub}` : `${this.userInfo.sub}`,
                     scoid: this.userInfo.azp,
                     unit_id: this.courseNow.scope === 'school' ? (this.$route.params.subjectId || this.courseNow.subject.id) : this.courseNow.id,
                     rs: JSON.stringify(this.exerciseInfo)

+ 4 - 3
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/QuesList.vue

@@ -269,7 +269,7 @@ export default {
             }
             //if(this.userInfo.scope != 'tmduser') param.code = this.userInfo.azp
             if(this.userInfo.scope === 'student') {
-                param.code = this.courseNow.school
+                param.code = (this.courseNow.scope == 'school') ? this.courseNow.school : null
             }
             this.$api.studentWeb.getErrorItemCnt(param).then(res => {
                 if(res.avaliable) {
@@ -279,7 +279,8 @@ export default {
         },
         getExceTime() {
             let param = {
-                sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                //sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                sid: this.courseNow.scope == 'school' ? `${this.courseNow.school}-${this.userInfo.sub}` : `${this.userInfo.sub}`,
                 unit_id: this.courseNow.subjectList ? this.basicSubId : (this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id), //单元id
                 mode: '2', //1:需要复习  2:题目练习时间   3:首页的最近练习时间
                 // t: Date.now()
@@ -306,7 +307,7 @@ export default {
                 // token: '',
             }
             if(this.userInfo.scope === 'student') {
-                queryData.code = this.courseNow.school
+                queryData.code = (this.courseNow.scope == 'school') ? this.courseNow.school : null
             }
             if(this.continuationToken) {
                 queryData.token = this.continuationToken

+ 4 - 2
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/WrongQues.vue

@@ -171,7 +171,8 @@ export default {
             let param = {
                 stuId: this.userInfo.sub,
                 subjectId: this.courseNow.subjectList ? this.courseNow.subjectList[this.nowSub].id : (this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id),
-                code: this.userInfo.scope != 'tmduser' ? this.userInfo.azp : null
+                // code: this.userInfo.scope != 'tmduser' ? this.userInfo.azp : null
+                code: this.courseNow.scope == 'school' ? this.courseNow.school : null
             }
             this.$api.studentWeb.getErrorItemToday(param).then(res => {
                 if(res.avaliable) {
@@ -183,7 +184,8 @@ export default {
         startReview(type) {
             this.isLoading = true
             let param = {
-                sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                //sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                sid: this.courseNow.scope == 'school' ? `${this.courseNow.school}-${this.userInfo.sub}` : `${this.userInfo.sub}`,
                 unit_id: this.courseNow.subjectList ? this.courseNow.subjectList[this.nowSub].id : (this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id), //单元id
                 mode: type ? '3' : '1',
                 // number: this.filtType.num,

+ 8 - 4
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/mobile/WrongQues.vue

@@ -324,7 +324,8 @@ export default {
         },
         getExceTime() {
             let param = {
-                sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                //sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                sid: this.courseNow.scope == 'school' ? `${this.courseNow.school}-${this.userInfo.sub}` : `${this.userInfo.sub}`,
                 unit_id: this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id, //单元id
                 mode: '2', //1:需要复习  2:题目练习时间   3:首页的最近练习时间
                 // t: Date.now()
@@ -354,7 +355,8 @@ export default {
                 // token: '',
             }
             if(this.userInfo.scope === 'student') {
-                queryData.code = this.courseNow.school
+                //queryData.code = this.courseNow.school
+                queryData.code = (this.courseNow.scope == 'school') ? this.courseNow.school : null
             }
             if(this.continuationToken) {
                 queryData.token = this.continuationToken
@@ -497,7 +499,8 @@ export default {
                 stuId: this.userInfo.sub,
                 subjectId: this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id,
             }
-            if(this.userInfo.scope != 'tmduser') param.code = this.userInfo.azp
+            //if(this.userInfo.scope != 'tmduser') param.code = this.userInfo.azp
+            if (this.courseNow.scope == 'school') param.code = this.courseNow.school
             this.$api.studentWeb.getErrorItemCnt(param).then(res => {
                 if(res.avaliable) {
                     this.dayAdd = res.avaliable - res.record
@@ -507,7 +510,8 @@ export default {
         startReview(type) {
             this.isLoading = true
             let param = {
-                sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                //sid: this.userInfo.scope === 'tmduser' ? this.userInfo.sub : `${this.userInfo.azp}-${this.userInfo.sub}`,
+                sid: this.courseNow.scope == 'school' ? `${this.courseNow.school}-${this.userInfo.sub}` : `${this.userInfo.sub}`,
                 unit_id: this.courseNow.subject.id ? this.courseNow.subject.id : this.courseNow.id, //单元id
                 mode: type ? '3' : '1',
                 // number: this.filtType.num,