Ver Fonte

Merge branch 'develop3.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0-tmd

JAELYS há 4 anos atrás
pai
commit
7c898f26d8

+ 2 - 2
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -277,10 +277,10 @@
 				}
 			},
 			
-			/* 频弹窗切换事件 */
+			/* 频弹窗切换事件 */
 			onVideoModalChange(val) {
 				if (!val) {
-					// this.$refs.audioPlayer.onCloseAudio()
+					this.$refs.videoPlayer.onCloseAudio()
 				}
 			},
 			

+ 3 - 3
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -301,11 +301,11 @@
 					this.$refs.audioPlayer.onCloseAudio()
 				}
 			},
-
-			/* 频弹窗切换事件 */
+			
+			/* 频弹窗切换事件 */
 			onVideoModalChange(val) {
 				if (!val) {
-					// this.$refs.audioPlayer.onCloseAudio()
+					this.$refs.videoPlayer.onCloseAudio()
 				}
 			},
 

+ 11 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue

@@ -176,6 +176,17 @@
 			completionEditor.customConfig.onblur = function () {
 				that.isStemFocus = false
 			}
+			
+			completionEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			completionEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,completionEditor)
+			},
+			
+			
             completionEditor.create()
 
             this.stemEditor = completionEditor

+ 10 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompose.vue

@@ -35,6 +35,16 @@
 			stemEditor.customConfig.onchange = (html) => {
 				this.stemContent = html
 			}
+			
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
+			
 			stemEditor.create()
 			this.stemEditor = stemEditor
 			

+ 10 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseJudge.vue

@@ -43,6 +43,16 @@
 			stemEditor.customConfig.onchange = (html) => {
 				this.stemContent = html
 			}
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
+			
+			
 			stemEditor.create()
 			this.stemEditor = stemEditor
 			

+ 10 - 0
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue

@@ -175,6 +175,16 @@
             stemEditor.customConfig.onchange = (html) => {
                 this.stemContent = html
             }
+			
+			stemEditor.customConfig.onVideoWarning = (text) => {
+				this.$Message.warning(text)
+			},
+			
+			// 选择视频文件后的上传Blob操作
+			stemEditor.customConfig.onVideoSelected = async (file) => {
+					this.$tools.doUploadVideo(this,file,stemEditor)
+			},
+			
             stemEditor.create()
             this.stemEditor = stemEditor
             // 初始化选项编辑器

+ 3 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/ExamPaperAnalysis.vue

@@ -19,8 +19,8 @@
                 <div class="whole-table-col">
                     <p class="while-table-question-type">{{examAnalysisData.whole.objectiveScore}}({{examAnalysisData.whole.objectiveScoreP}}%)</p>
                     <p class="while-table-question-type">{{examAnalysisData.whole.subjectiveScore}}({{examAnalysisData.whole.subjectiveScoreP}}%)</p>
+					<p class="while-table-question-type">{{examAnalysisData.whole.objectiveNum}}({{examAnalysisData.whole.objectiveNumP}}%)</p>
                     <p class="while-table-question-type">{{examAnalysisData.whole.subjectiveNum}}({{examAnalysisData.whole.subjectiveNumP}}%)</p>
-                    <p class="while-table-question-type">{{examAnalysisData.whole.objectiveNum}}({{examAnalysisData.whole.objectiveNumP}}%)</p>
                 </div>
             </div>
         </div>
@@ -224,7 +224,7 @@
                 let subjectiveNumP = 0
                 let objectiveNumP = 0
                 for (let key in this.groupQuestion) {
-                    if (key == 'Complete' || key == 'Subjective' || key == 'Compose') {
+                    if (key == 'complete' || key == 'subjective' || key == 'compose') {
                         subjectiveNum += this.groupQuestion[key].length
                         subjectiveScore += this.groupQuestion[key].reduce((total, item) => total + item.score, 0)
                     } else {
@@ -333,6 +333,7 @@
             },
             drawDiffChart() {
                 this.option.series[0].data = this.examAnalysisData.difficult.count
+				console.log(this.examAnalysisData)
                 this.myPie.setOption(this.option)
             },
             getQuestionLabel(key) {

+ 3 - 0
TEAMModelOS/ClientApp/src/view/settings/SchoolMgmt.vue

@@ -152,6 +152,9 @@
 									props: {
 										type: 'primary'
 									},
+									style: {
+										display: this.mySchoolList.length ? (this.mySchoolList.map(i => i.schoolId).indexOf(params.row.id)  > -1 ? 'none' : 'unset') : 'unset'
+									},
 									on: {
 										click: () => {
 											this.onJoinSchool(params.row)

+ 28 - 16
TEAMModelOS/Controllers/Exam/ExamController.cs

@@ -629,6 +629,7 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 if (!requert.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
+                if (!requert.TryGetProperty("school", out JsonElement school)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.code,A0.id paperId,A0.code paperCode,A0.name paperName,A0.multipleRule,A0.scope,A0.blob from c join A0 in c.papers where c.id ='{id}' and c.progress = 'going'";
                 List<object> props = new List<object>();
@@ -643,9 +644,9 @@ namespace TEAMModelOS.Controllers
                         }
                     }
                 }
-                var querySubject = $"select A0.id subjectId,A0.name subjectName from c join A0 in c.subjects where c.id ='{id}' and c.progress = 'going'";
+                var querySubject = $"select c.subjects from c where c.id ='{id}' and c.progress = 'going'";
                 //List<object> props = new List<object>();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: querySubject, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -655,22 +656,33 @@ namespace TEAMModelOS.Controllers
                             props.Add(obj.ToObject<object>());
                         }
                     }
-                }
-                /*var queryAnswers = $"select c.id,c.code from c where c.examid ='{id}' and c.progress = 'going' and c.subjectId";
-                List<object> answers = new List<object>();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
-                {
-                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                }                
+				var queryAnswers = $"select c.id,c.code,c.studentIds,c.subjectId,c.studentAnswers from c where c.examId ='{id}' and c.progress = 'going' and array_contains(c.studentIds,'{studentId}')";
+				List<ExamClassResult> answers = new List<ExamClassResult>();
+				await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: queryAnswers, 
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school}") }))
+				{
+					using var json = await JsonDocument.ParseAsync(item.ContentStream);
+					if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+					{
+						foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+						{
+							answers.Add(obj.ToObject<ExamClassResult>());
+						}
+					}
+				}
+                List<List<List<string>>> stuAns = new List<List<List<string>>>();
+                if (answers.Count > 0) {                   
+                    for (int i = 0; i < answers.Count; i++)
                     {
-                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
-                        {
-                            answers.Add(obj.ToObject<object>());
+                        int index = answers[i].studentIds.IndexOf(studentId.ToString());
+                        if (index == -1) {
+                            break;
                         }
+                        stuAns.Add(answers[i].studentAnswers[index]);
                     }
-                }*/
-
-                return Ok(props);
+                }                
+				return Ok(new { props , stuAns});
             }
             catch (Exception ex)
             {
@@ -693,7 +705,7 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                var query = $"select c.id,c.code,c.name,c.startTime,c.endTime,c.type,c.progress from c where array_contains(c.targetClassIds,'{id}') and c.progress = 'going'";
+                var query = $"select c.id,c.code,c.name,c.startTime,c.endTime,c.type,c.progress,c.school from c where array_contains(c.targetClassIds,'{id}') and c.progress = 'going'";
                 List<object> props = new List<object>();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query))
                 {