Kaynağa Gözat

Merge branch 'develop5.0-tmd' into develop5.0

CrazyIter_Bin 3 yıl önce
ebeveyn
işleme
dbf9a88fc0

+ 8 - 3
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -90,6 +90,9 @@
                             <b class="title">{{ filterPeriodName }}</b>
                             <Icon type="ios-arrow-down" style="margin-left:8px;"></Icon>
                         </span>
+                        <DropdownMenu slot="list" value="all">
+                            <DropdownItem name="all">全部</DropdownItem>
+                        </DropdownMenu>
                         <DropdownMenu slot="list" v-for="(item,index) in schoolBase.period" :value="item.id" :key="index">
                             <DropdownItem :name="item.id">{{ item.name }}</DropdownItem>
                         </DropdownMenu>
@@ -392,7 +395,7 @@ export default {
                     // 更新源数据
                     let type = this.fileListShow[editIndex].type
                     for (let index = 0; index < this.fileList[type].length; index++) {
-                        if(this.fileList[type][index].id == this.fileListShow[editIndex].id){
+                        if (this.fileList[type][index].id == this.fileListShow[editIndex].id) {
                             this.fileList[type].splice(index, 1, this.fileListShow[editIndex])
                             break
                         }
@@ -1183,7 +1186,7 @@ export default {
                     "name": this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
                     "type": this.activeType,
                     "scope": this.routerScope,
-                    "periodId": this.routerScope == 'school' ? this.filterPeriod : ''
+                    "periodId": this.routerScope == 'school' ? this.filterPeriod == 'all' ? '' : this.filterPeriod : ''
                 }
                 this.$api.blob.listBlobInfo(rd, this.urlString, this.containerName).then(
                     res => {
@@ -1358,7 +1361,9 @@ export default {
                 let data = this.schoolBase.period
                 let pId = this.filterPeriod
                 let name = ''
-                if (pId !== '') {
+                if (pId == 'all') {
+                    return '全部'
+                } else {
                     let temp = data.filter(item => {
                         return pId == item.id
                     })

+ 0 - 41
TEAMModelOS/Controllers/Client/Models/Class.cs

@@ -1,41 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace TEAMModelOS.Controllers.Client.Models
-{
-    public class ChannelRequest
-    {  
-        /// <summary>
-        /// 請填Client Name (HiTeach、HiTeachCC)
-        /// </summary>
-        [Required]
-        public string id_token { get; set; }
-
-       
-        
-
-        /// <summary>
-        /// 教室PIN碼
-        /// </summary>
-        [Required]
-        public string pin { get; set; }
-
-        /// <summary>
-        /// 區網IP,動態申請可不填
-        /// </summary>
-        public string local_ip { get; set; }
-
-        /// <summary>
-        /// 教室評道號碼,如無傳入為動態頻道號碼,一天過期
-        /// </summary>
-        public string channel { get; set; }
-
-        /// <summary>
-        /// 如有學校簡碼請輸入
-        /// </summary>
-        public string school_code { get; set; }
-    }
-}

+ 4 - 4
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -577,7 +577,7 @@ namespace TEAMModelOS.Controllers
             if (!request.TryGetProperty("answer", out JsonElement answer)) return BadRequest();
             if (!request.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
             if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-            if (!request.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
+            //if (!request.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
             if (!request.TryGetProperty("multipleRule", out JsonElement multipleRule)) return BadRequest();
             //if (!request.TryGetProperty("answers ", out JsonElement tandardAnswer)) return BadRequest();
             if (!request.TryGetProperty("paperId", out JsonElement paperId)) return BadRequest();
@@ -586,12 +586,12 @@ namespace TEAMModelOS.Controllers
             if (!request.TryGetProperty("scode", out JsonElement scode)) return BadRequest();
             try
             {
-                List<string> ids = new List<string>();
-                ids = classId.ToObject<List<string>>();
+                //List<string> ids = new List<string>();
+                //ids = classId.ToObject<List<string>>();
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamClassResult> examClassResults = new List<ExamClassResult>();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
-                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.info.id in ({string.Join(",", ids.Select(o => $"'{o}'"))})",
+                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and array_contains(c.studentIds,'{studentId}')",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);