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
7e6c82a4b0

+ 8 - 2
TEAMModelFunction/TriggerCorrect.cs

@@ -92,7 +92,12 @@ namespace TEAMModelFunction
                                             //结束时间
                                             endTime=correct.endTime,
                                             //批改数量
-                                            count=marker.count
+                                            count=marker.count,
+                                            //按题阅卷时,题号
+                                            qu = marker.qu,
+                                            //模块术
+                                            modle = correct.modle
+                                            //type = correct.isArb
                                         };
                                        await  client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync<CorrectTask>(task,new Azure.Cosmos.PartitionKey(task.code));
                                     }
@@ -199,7 +204,8 @@ namespace TEAMModelFunction
                                                 scores = examClass.studentScores[index],
                                                 //tIds = tmds,
                                                 marks = marks,
-                                                items = items
+                                                items = items,
+                                                modle = correct.modle
 
                                             };
                                             tasks.Add(client.GetContainer("TEAMModelOS", "Teacher").CreateItemAsync<Scoring>(sc, new Azure.Cosmos.PartitionKey(sc.code)));

+ 1 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Scoring.cs

@@ -19,6 +19,7 @@ namespace TEAMModelOS.SDK.Models.Cosmos.Common
         public List<string> tIds { get; set; } = new List<string>();
         public List<string> marks { get; set; } = new List<string>();
         public List<double> scores { get; set; } = new List<double>();
+        public int modle { get; set; }
     }
 
     public class Item

+ 2 - 0
TEAMModelOS.SDK/Models/Cosmos/Teacher/CorrectTask.cs

@@ -41,5 +41,7 @@ namespace TEAMModelOS.SDK.Models
         public List<int> qu { get; set; } = new List<int>();
         //阅卷类型
         public string type { get; set; }
+        //模块数
+        public int modle { get; set; }
     }
 }

+ 6 - 0
TEAMModelOS/ClientApp/src/common/BaseNotification.vue

@@ -68,6 +68,12 @@
 					case 'remove_school':
 						return `${body.schoolname} 已将您移除`
 						break;
+					case 'coedit_syllabus':
+						return `${body.schoolname} 已将您移除`
+						break;
+					case 'share_syllabus':
+						return `${body.schoolname} 已将您移除`
+						break;		
 					default:
 						break;
 				}

+ 1 - 1
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -8,7 +8,7 @@
 
 			<FormItem :label="$t('survey.form.target')" prop="classes">
 				<RadioGroup v-model="classType" @on-change="onClassTypeChange" v-if="qnFormEdit">
-					<Radio label="private">{{ $t('survey.form.privateClass') }}</Radio>
+					<Radio label="private" v-if="getCurScope === 'private'">{{ $t('survey.form.privateClass') }}</Radio>
 					<Radio label="school">{{ $t('survey.form.schoolClass') }}</Radio>
 				</RadioGroup>
 				<div v-if="!qnFormEdit && curQnItem" class="vote-class">

+ 35 - 7
TEAMModelOS/ClientApp/src/view/Home.vue

@@ -39,6 +39,7 @@ export default {
     created() {
         let user = JSON.parse(decodeURIComponent(localStorage.userInfo, "utf-8"))
         let user_profile = JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8"))
+		console.log(user_profile)
         if (user_profile.schools) {
             user_profile.schools = user_profile.schools.filter((item) => {
                 return item.status == 'join'
@@ -60,17 +61,44 @@ export default {
             })
         }
 
-        this.$api.service.getNotification({
-            "from": "ies5:" + user_profile.defaultschool || user_profile.schools[0].schoolId,
-            "receiver": user.id
-        }).then(res => {
-            console.log('端外通知', res)
-            this.msgs = res.msgs
-        })
+        // this.$api.service.getNotification({
+        //     "from": "ies5:" + (user_profile.defaultschool || user_profile.schools[0].schoolId),
+        //     "receiver": user.id
+        // }).then(res => {
+        //     console.log('端外通知', res)
+        //     this.msgs = res.msgs
+        // })
+		this.getAllNotice(user_profile,user.id)
 
 
     },
     methods: {
+		async getAllNotice(user_profile,userId){
+			let schoolNotice = await this.getSchoolNotice(user_profile,userId)
+			let privateNotice = await this.getPrivateNotice(userId)
+			this.msgs = schoolNotice.concat(privateNotice)
+			console.log('端外通知', this.msgs)
+		},
+		getSchoolNotice(user_profile,userId){
+			return new Promise((r,j) => {
+				this.$api.service.getNotification({
+				    "from": "ies5:" + (user_profile.defaultschool || user_profile.schools[0].schoolId),
+				    "receiver": userId
+				}).then(res => {
+				    r(res.msgs)
+				})
+			})
+		},
+		getPrivateNotice(userId){
+			return new Promise((r,j) => {
+				this.$api.service.getNotification({
+				    "from": "ies5:private",
+				    "receiver": userId
+				}).then(res => {
+				    r(res.msgs)
+				})
+			})
+		},
         toHome() {
             this.$router.push({ path: '/home/homePage' })
         },

+ 28 - 14
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -1598,7 +1598,7 @@ namespace TEAMModelOS.Controllers
                     {
                         recs.Add(scoring);
                     }
-                    else if (scoring.tIds.Count < scoring.marks.Count)
+                    else if (scoring.tIds.Count < scoring.marks.Count * scoring.modle)
                     {
                         all.Add(scoring);
                     }
@@ -1691,7 +1691,7 @@ namespace TEAMModelOS.Controllers
                         Random random = new Random();
                         SDK.Models.Cosmos.Common.Scoring item = new();
                         List<SDK.Models.Cosmos.Common.Scoring> notYet = new();
-                        notYet =  all.Where(x => x.tIds.Count < x.marks.Count - 1).ToList();
+                        notYet =  all.Where(x => x.tIds.Count < x.marks.Count * x.modle - 1).ToList();
                         if (notYet.Count > 0)
                         {
                             item = notYet[random.Next(notYet.Count)];
@@ -1833,20 +1833,41 @@ namespace TEAMModelOS.Controllers
                 if (requert.TryGetProperty("mark", out JsonElement mark))
                 {
                     //存放老师批注信息到blob                   
-                    builder.Append(id).Append("/");
-                    builder.Append(subjectId).Append("/");
-                    builder.Append(sId).Append("mark").Append("/");
+                    builder.Append(id).Append('/');
+                    builder.Append(subjectId).Append('/');
+                    builder.Append(sId).Append("mark").Append('/');
                     builder.Append("ans.json");
                     await _azureStorage.UploadFileByContainer(code.ToString(), mark.ToJsonString(), "exam", builder.ToString(), false);
                     if (attr.Count > 0)
                     {
                         foreach (SDK.Models.Cosmos.Common.Scoring scoring in attr)
                         {
-                            int index = scoring.tIds.IndexOf(tId.GetString());
+                            foreach (Item item in scoring.items) {
+                                bool flag = false;
+                                int index = 0;
+                                if (item.scores.Count > 0) {
+                                    foreach (Info info in item.scores) {
+                                        if (!info.tmdId.Equals(tId.GetString()))
+                                        {
+                                            index++;
+                                        }
+                                        else {
+                                            scoring.marks[index] = builder.ToString();
+                                            flag = true;
+                                            break;
+                                        }
+                                    }
+                                }
+                                if (flag) {
+                                    break;
+                                }
+                                 //List<Info> info = item.scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
+                            }
+                           /* int index = scoring.tIds.IndexOf(tId.GetString());
                             if (index != -1)
                             {
                                 scoring.marks[index] = builder.ToString();
-                            }
+                            }*/
 
                         }
                     }
@@ -1874,13 +1895,6 @@ namespace TEAMModelOS.Controllers
                                 info.index = itemIndex;
                             }
                             itemIndex++;
-                            /*if (tIdIndex > -1)
-                            {
-                                item.scores[tIdIndex].sc = ssc[itemIndex];
-                                item.scores[tIdIndex].tmdId = tId.GetString();
-                                itemIndex++;
-                            }*/
-
                         }
                         await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(scoring, scoring.id, new PartitionKey(scoring.code));