Bläddra i källkod

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

OnePsycho 4 år sedan
förälder
incheckning
7954451b96

+ 66 - 57
TEAMModelFunction/MonitorCosmosDB.cs

@@ -22,7 +22,7 @@ namespace TEAMModelFunction
         private readonly AzureStorageFactory _azureStorage;
         private readonly DingDing _dingDing;
 
-        public MonitorCosmosDB(IHttpClientFactory clientFactory, AzureCosmosFactory azureCosmos,AzureServiceBusFactory azureServiceBus, AzureStorageFactory azureStorage, DingDing dingDing)
+        public MonitorCosmosDB(IHttpClientFactory clientFactory, AzureCosmosFactory azureCosmos, AzureServiceBusFactory azureServiceBus, AzureStorageFactory azureStorage, DingDing dingDing)
         {
             _clientFactory = clientFactory;
             _azureCosmos = azureCosmos;
@@ -48,7 +48,7 @@ namespace TEAMModelFunction
                 {
                     string pk = input.GetPropertyValue<string>("pk");
                     if (!string.IsNullOrWhiteSpace(pk))
-                    {                        
+                    {
                         long stime = input.GetPropertyValue<long>("startTime");
                         long etime = input.GetPropertyValue<long>("endTime");
                         string school = input.GetPropertyValue<string>("school");
@@ -106,6 +106,7 @@ namespace TEAMModelFunction
                                     case "going":
                                         if (examClassResults.Count == 0)
                                         {
+                                            // 初始化ExamClassResult
                                             for (int j = 0; j < info.subjects.Count; j++)
                                             {
                                                 for (int k = 0; k < info.targetClassIds.Count; k++)
@@ -117,9 +118,7 @@ namespace TEAMModelFunction
                                                         id = Guid.NewGuid().ToString(),
                                                         subjectId = info.subjects[j].id,
                                                         year = info.year,
-                                                        scope = info.scope,
-                                                        ttl = -1,
-                                                        pk = typeof(ExamClassResult).Name
+                                                        scope = info.scope
                                                     };
                                                     result.info.id = info.targetClassIds[k];
                                                     var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(info.targetClassIds[k], new Azure.Cosmos.PartitionKey($"Class-{info.school}"));
@@ -148,6 +147,7 @@ namespace TEAMModelFunction
 
                                                 }
                                             }
+                                            // 发送信息通知
                                             var messageEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = code }.ToJsonString());
                                             messageEnd.ApplicationProperties.Add("name", "Exam");
                                             if (records.Count > 0)
@@ -172,68 +172,77 @@ namespace TEAMModelFunction
                                                 //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
                                             }
                                         }
+                                        else
+                                        {
+                                            for (int j = 0; j < info.subjects.Count; j++)
+                                            {
+                                                if (info.subjects[j].classCount == info.targetClassIds.Count)
+                                                {
+                                                    info.progress = "finish";
+                                                    await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(info, info.id, new Azure.Cosmos.PartitionKey($"{code}"));
+                                                }
+                                            }
+                                        }
                                         break;
                                     case "finish":
                                         for (int j = 0; j < info.subjects.Count; j++)
                                         {
-                                            if (info.subjects[j].classCount == info.targetClassIds.Count)
+                                            ExamResult result = new ExamResult();
+                                            //人数总和
+                                            int Count = 0;
+                                            int m = 0;
+                                            List<ClassRange> classRanges = new List<ClassRange>();
+                                            foreach (ExamClassResult classResult in examClassResults)
                                             {
-                                                ExamResult result = new ExamResult();
-                                                //人数总和
-                                                int Count = 0;
-                                                int m = 0;
-                                                List<ClassRange> classRanges = new List<ClassRange>();
-                                                foreach (ExamClassResult classResult in examClassResults)
+                                                if (classResult.subjectId.Equals(info.subjects[j].id))
                                                 {
-                                                    if (classResult.subjectId.Equals(info.subjects[j].id))
+                                                    foreach (List<double> scores in classResult.studentScores)
                                                     {
-                                                        foreach (List<double> scores in classResult.studentScores)
-                                                        {
-                                                            result.studentScores.Add(scores);
-                                                        }
-                                                        //处理班级信息
-                                                        ClassRange range = new ClassRange();
-                                                        range.id = classResult.info.id;
-                                                        range.name = classResult.info.name;
-                                                        List<int> ran = new List<int>();
-                                                        int stuCount = classResult.studentIds.Count;
-                                                        Count += stuCount;
-                                                        if (m == 0)
-                                                        {
-                                                            ran.Add(0);
-                                                            ran.Add(stuCount - 1);
-                                                        }
-                                                        else
-                                                        {
-                                                            ran.Add(Count - stuCount);
-                                                            ran.Add(Count - 1);
-                                                        }
-                                                        m++;
-                                                        range.range = ran;
-                                                        classRanges.Add(range);
-                                                        //处理学生ID
-                                                        foreach (string id in classResult.studentIds)
-                                                        {
-                                                            result.studentIds.Add(id);
-                                                        }
+                                                        result.studentScores.Add(scores);
+                                                    }
+                                                    //处理班级信息
+                                                    ClassRange range = new ClassRange();
+                                                    range.id = classResult.info.id;
+                                                    range.name = classResult.info.name;
+                                                    List<int> ran = new List<int>();
+                                                    int stuCount = classResult.studentIds.Count;
+                                                    Count += stuCount;
+                                                    if (m == 0)
+                                                    {
+                                                        ran.Add(0);
+                                                        ran.Add(stuCount - 1);
+                                                    }
+                                                    else
+                                                    {
+                                                        ran.Add(Count - stuCount);
+                                                        ran.Add(Count - 1);
+                                                    }
+                                                    m++;
+                                                    range.range = ran;
+                                                    classRanges.Add(range);
+                                                    //处理学生ID
+                                                    foreach (string id in classResult.studentIds)
+                                                    {
+                                                        result.studentIds.Add(id);
                                                     }
                                                 }
-                                                result.classes = classRanges;                                                
-                                                result.pk = typeof(ExamResult).Name;
-                                                result.code = "ExamResult-" + info.id;
-                                                result.school = info.school;
-                                                result.id = info.subjects[j].id;
-                                                result.examId = info.id;
-                                                result.subjectId = info.subjects[j].id;
-                                                result.year = info.year;
-                                                result.paper = info.papers[j];
-                                                //result.point = info.papers[j].point;
-                                                result.scope = info.scope;
-                                                result.name = info.name;
-                                                result.time = info.startTime;
-                                                result.ttl = -1;
-                                                await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Common").UpsertItemAsync(result, new Azure.Cosmos.PartitionKey($"ExamResult-{info.id}"));
                                             }
+                                            result.classes = classRanges;
+                                            result.pk = typeof(ExamResult).Name;
+                                            result.code = "ExamResult-" + info.id;
+                                            result.school = info.school;
+                                            result.id = info.subjects[j].id;
+                                            result.examId = info.id;
+                                            result.subjectId = info.subjects[j].id;
+                                            result.year = info.year;
+                                            result.paper = info.papers[j];
+                                            //result.point = info.papers[j].point;
+                                            result.scope = info.scope;
+                                            result.name = info.name;
+                                            result.time = info.startTime;
+                                            result.ttl = -1;
+                                            await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Common").UpsertItemAsync(result, new Azure.Cosmos.PartitionKey($"ExamResult-{info.id}"));
+
                                         }
                                         break;
                                 }

+ 44 - 1
TEAMModelOS.SDK/DI/AzureCosmos/AzureCosmosExtensions.cs

@@ -25,7 +25,7 @@ using TEAMModelOS.SDK.Models;
 namespace TEAMModelOS.SDK.DI
 {
     public static class AzureCosmosExtensions
-    {    
+    {
         public static double RU(this Response response)
         {
             try
@@ -53,6 +53,13 @@ namespace TEAMModelOS.SDK.DI
             }
         }
 
+        /// <summary>
+        /// 取得当前容器指定分区键的Count数,支持SQL Where条件,不支持排序
+        /// </summary>
+        /// <param name="container"></param>
+        /// <param name="partitionkey"></param>
+        /// <param name="queryWhere"></param>
+        /// <returns></returns>
         public static async Task<int> GetCount(this CosmosContainer container, string partitionkey, string queryWhere = "WHERE 1=1")
         {
             int totalCount = 0;
@@ -71,5 +78,41 @@ namespace TEAMModelOS.SDK.DI
             }
             return totalCount;
         }
+
+        public static async Task<List<Response>> DeleteItemsStreamAsync(this CosmosContainer container, List<string> ids, string partitionkey )
+        {
+            List<Response> responses = new List<Response>();
+
+            foreach (var id in ids)
+            {
+                try
+                {
+                    responses.Add(await container.DeleteItemStreamAsync(id, new PartitionKey(partitionkey)));
+                }
+                catch 
+                {
+                    continue;
+                }
+            }
+            return responses;
+        }
+
+        public static async Task<List<ItemResponse<T>>> DeleteItemsAsync<T>(this CosmosContainer container, List<string> ids, string partitionkey)
+        {
+            List<ItemResponse<T>> responses = new List<ItemResponse<T>>();
+
+            foreach (var id in ids)
+            {
+                try
+                {
+                    responses.Add(await container.DeleteItemAsync<T>(id, new PartitionKey(partitionkey)));
+                }
+                catch
+                {
+                    continue;
+                }
+            }
+            return responses;
+        }
     }
 }

+ 5 - 38
TEAMModelOS.SDK/DI/AzureStorage/AzureStorageBlobExtensions.cs

@@ -38,8 +38,7 @@ namespace TEAMModelOS.SDK.DI
             }
         }
 
-        /// <summary>
-        /// https://teammodelstorage.blob.core.chinacloudapi.cn/ydzt/112315401795%2F
+        /// <summary>        
         /// 批量刪除Blobs
         /// </summary>      
         /// <param name="prefix">篩選開頭名稱,Null代表容器</param>        
@@ -104,7 +103,6 @@ namespace TEAMModelOS.SDK.DI
             BlobContainerClient blobContainer = azureStorage.GetBlobContainerClient(name.ToLower().Replace("#", "")); //blobClient.GetContainerReference(groupName);            
 
             var blockBlob = blobContainer.GetBlobClient($"{root}/{blobpath}");
-            
             string content_type = "application/octet-stream";
             if (!contentTypeDefault)
             {
@@ -114,16 +112,6 @@ namespace TEAMModelOS.SDK.DI
                 {
                     content_type = contenttype;
                 }
-                else
-                {
-
-                    //blockBlob.Properties.ContentType = content_type;
-                }
-            }
-            else
-            {
-
-                //blockBlob.Properties.ContentType = content_type;
             }
             byte[] bytes = System.Text.Encoding.Default.GetBytes(json);
             Stream streamBlob = new MemoryStream(bytes);
@@ -149,45 +137,24 @@ namespace TEAMModelOS.SDK.DI
         /// <param name="fileName">文件名</param>
         /// <param name="contentTypeDefault">是否存放文件后缀对应的contentType</param>
         /// <returns></returns>
-        public static async Task<AzureBlobModel> UploadFileByContainer(this AzureStorageFactory azureStorage, string name, Stream stream, string folder, string fileName, bool contentTypeDefault = true)
+        public static async Task<string> UploadFileByContainer(this AzureStorageFactory azureStorage, string name, Stream stream, string root, string blobpath, bool contentTypeDefault = true)
         {
-
-            // string groupName =folder;
-
             BlobContainerClient blobContainer = azureStorage.GetBlobContainerClient(name.ToLower().Replace("#", "")); //blobClient.GetContainerReference(groupName); 
             Uri url = blobContainer.Uri;
-
-            var blockBlob = blobContainer.GetBlobClient(folder + "/" + fileName);
-            string fileext = fileName.Substring(fileName.LastIndexOf(".") > 0 ? fileName.LastIndexOf(".") : 0);
+            var blockBlob = blobContainer.GetBlobClient($"{root}/{blobpath}");
             string content_type = "application/octet-stream";
             if (!contentTypeDefault)
             {
+                string fileext = blobpath.Substring(blobpath.LastIndexOf(".") > 0 ? blobpath.LastIndexOf(".") : 0);
                 ContentTypeDict.dict.TryGetValue(fileext, out string contenttype);
                 if (!string.IsNullOrEmpty(contenttype))
                 {
                     content_type = contenttype;
-
-
-                }
-                else
-                {
-
-                    //blockBlob.Properties.ContentType = content_type;
                 }
             }
-            else
-            {
-
-                //blockBlob.Properties.ContentType = content_type;
-            }
             await blockBlob.UploadAsync(stream, true);
             blockBlob.SetHttpHeaders(new BlobHttpHeaders { ContentType = content_type });
-            AzureBlobModel model = new AzureBlobModel(fileName, name, folder, fileName, folder, content_type, stream.Length)
-            {
-                Sha1Code = ShaHashHelper.GetSHA1(stream),
-                BlobUrl = blockBlob.Uri.ToString()
-            };
-            return model;
+            return blockBlob.Uri.ToString();
         }
     }
 }

+ 3 - 3
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -2,9 +2,9 @@
 
   <PropertyGroup>
     <TargetFramework>netcoreapp3.1</TargetFramework>
-    <Version>3.0.1211</Version>
-    <AssemblyVersion>3.0.1211.0</AssemblyVersion>
-    <FileVersion>3.0.1211.0</FileVersion>
+    <Version>3.0.1217</Version>
+    <AssemblyVersion>3.0.1217.0</AssemblyVersion>
+    <FileVersion>3.0.1217.0</FileVersion>
     <PackageReleaseNotes>520发版</PackageReleaseNotes>
   </PropertyGroup>
 

+ 151 - 119
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTest.vue

@@ -41,74 +41,72 @@
                 </div>
             </div>
             <!--<div
-              v-if="  this.$store.getters.getItemTitle.isDone == false && this.$store.getters.getItemTitle.endTime <= '2020.02.10' && this.$store.getters.getItemTitle.allowRetryNow == true " >
-              <br v-if="!ishideHint" />
-              <div class="dec animate__animated animate__bounceInLeft" v-if="!ishideHint">
-                <svg-icon icon-class="handonHint" class="warm-icon" />
-                <span
-                  class="warm-hint"
-                  v-if="this.$store.getters.getCurrentLaguage == 'tw'"
-                >
-                  評量活動時間已結束,請於
-                  <span class="retry-date">2020.02.13 23:59 前</span
-                  >完成補考,逾時將以0分計算。
-                </span>
-                <span
-                  class="warm-hint"
-                  v-if="this.$store.getters.getCurrentLaguage == 'en'"
-                >
-                  The exam task time has ended, please make up the exam
-                  <span class="retry-date">before 2020.02.13 23:59</span> or your
-                  score would be 0.
-                </span>
-                <span @click="hidehint()" class="close-hint-btn">
-                  <Icon type="md-close" class="close-icon" />
-                </span>
-              </div>
-            </div>-->
-            <div
-              class="title-rect-group"
-            >
-              <div class="title-rect" />
-              <h2 class="title-rect-name">试卷链接</h2>
+      v-if="  this.$store.getters.getItemTitle.isDone == false && this.$store.getters.getItemTitle.endTime <= '2020.02.10' && this.$store.getters.getItemTitle.allowRetryNow == true " >
+      <br v-if="!ishideHint" />
+      <div class="dec animate__animated animate__bounceInLeft" v-if="!ishideHint">
+        <svg-icon icon-class="handonHint" class="warm-icon" />
+        <span
+          class="warm-hint"
+          v-if="this.$store.getters.getCurrentLaguage == 'tw'"
+        >
+          評量活動時間已結束,請於
+          <span class="retry-date">2020.02.13 23:59 前</span
+          >完成補考,逾時將以0分計算。
+        </span>
+        <span
+          class="warm-hint"
+          v-if="this.$store.getters.getCurrentLaguage == 'en'"
+        >
+          The exam task time has ended, please make up the exam
+          <span class="retry-date">before 2020.02.13 23:59</span> or your
+          score would be 0.
+        </span>
+        <span @click="hidehint()" class="close-hint-btn">
+          <Icon type="md-close" class="close-icon" />
+        </span>
+      </div>
+    </div>-->
+            <div class="title-rect-group">
+                <div class="title-rect" />
+                <h2 class="title-rect-name">试卷链接</h2>
             </div>
             <!--單一學科試卷-->
             <!--<div
-              v-if="(
-                 this.$store.getters.getItemTitle.isDone == false &&
-                 this.$store.getters.getItemTitle.endTime > '2020.02.10' &&
-                  this.$store.getters.getItemTitle.eventSubject != '綜合學科') ||
-                (this.$store.getters.getItemTitle.isDone == false &&
-                  this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
-                  this.$store.getters.getItemTitle.allowRetryNow == true &&
-                  this.$store.getters.getItemTitle.eventSubject != '綜合學科')
-              "
-              class="tasks"
-              @click="opentest()"
-            >
-              <div class="title" v-if="getCurrentLang() == 'tw'">
-                <span style="position: relative; top: 1px">
-                  <svg-icon icon-class="test" class="title-icon" />
-                </span>
-                {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
-              </div>
-              <div class="title" v-if="getCurrentLang() == 'en'">
-                <span style="position: relative; top: 1px">
-                  <svg-icon icon-class="test" class="title-icon" />
-                </span>
-                {{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}
-                Exam
-              </div>-->
+      v-if="(
+         this.$store.getters.getItemTitle.isDone == false &&
+         this.$store.getters.getItemTitle.endTime > '2020.02.10' &&
+          this.$store.getters.getItemTitle.eventSubject != '綜合學科') ||
+        (this.$store.getters.getItemTitle.isDone == false &&
+          this.$store.getters.getItemTitle.endTime <= '2020.02.10' &&
+          this.$store.getters.getItemTitle.allowRetryNow == true &&
+          this.$store.getters.getItemTitle.eventSubject != '綜合學科')
+      "
+      class="tasks"
+      @click="opentest()"
+    >
+      <div class="title" v-if="getCurrentLang() == 'tw'">
+        <span style="position: relative; top: 1px">
+          <svg-icon icon-class="test" class="title-icon" />
+        </span>
+        {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
+      </div>
+      <div class="title" v-if="getCurrentLang() == 'en'">
+        <span style="position: relative; top: 1px">
+          <svg-icon icon-class="test" class="title-icon" />
+        </span>
+        {{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject) }}
+        Exam
+      </div>-->
             <!--依試卷是否完成顯示打勾狀態-->
             <!--<li
-                :class="{
-                  finished: finishedfromTestPop() == true,
-                  unfinished: finishedfromTestPop() == false,
-                }"
-              >
-                <Icon class="doneicon" type="ios-checkmark" size="36" />
-              </li>
-            </div>-->
+        :class="{
+          finished: finishedfromTestPop() == true,
+          unfinished: finishedfromTestPop() == false,
+        }"
+      >
+        <Icon class="doneicon" type="ios-checkmark" size="36" />
+      </li>
+    </div>-->
             <!----->
             <!--多學科試卷-->
             <div v-if="paperData.length > 0 ">
@@ -128,6 +126,14 @@
                     </li>
                 </ul>
             </div>
+            <div class="title-rect-group" v-if="chooseData.subject !== undefined">
+                <div class="title-rect" />
+                <h2 class="title-rect-name">当前科目:{{chooseData.subject.name}}</h2>
+                <span @click="showTest" style="margin-left: 25px;color: #03966a;cursor:pointer">试卷详情</span>
+                <div>
+                    <LessonTestReport :examInfo="chooseData" />
+                </div>
+            </div>
 
 
             <!--多學科試卷-->
@@ -138,68 +144,65 @@
                   :animated="false">
                 <TabPane :label="$t('studentWeb.exam.contentPage')" name="tab1">
                     <!--<br />
-                    <div class="dec animate__animated animate__headShake">
-                        <span class="warm-hint">{{ $t("studentWeb.exam.practiceHint") }}</span>
-                    </div>-->
+            <div class="dec animate__animated animate__headShake">
+                <span class="warm-hint">{{ $t("studentWeb.exam.practiceHint") }}</span>
+            </div>-->
                     <!--單一學科試卷-->
                     <!--<div class="title-rect-group">
-                        <div class="title-rect" />
-                        <h2 class="title-rect-name">{{ $t("studentWeb.exam.examLink") }}</h2>
-                    </div>
-                    <div v-if="this.$store.getters.getItemTitle.eventSubject != '綜合學科'"
-                         class="tasks"
-                         @click="opentest()">
-                        <div class="title" v-if="getCurrentLang() == 'tw'">
-                            <span style="position: relative; top: 1px">
-                                <svg-icon icon-class="test" class="title-icon" />
-                            </span>
-                            {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
-                        </div>
-                        <div class="title" v-if="getCurrentLang() == 'en'">
-                            <span style="position: relative; top: 1px">
-                                <svg-icon icon-class="test" class="title-icon" />
-                            </span>
-                            {{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject)}}
-                            Exam
-                        </div>-->
-                        <!--依試卷是否完成顯示打勾狀態-->
-                        <!--li :class="{
-                            finished: true,
-                          }">
-                          <Icon class="doneicon" type="ios-checkmark" size="36" />
-                        </li-->
+                <div class="title-rect" />
+                <h2 class="title-rect-name">{{ $t("studentWeb.exam.examLink") }}</h2>
+            </div>
+            <div v-if="this.$store.getters.getItemTitle.eventSubject != '綜合學科'"
+                 class="tasks"
+                 @click="opentest()">
+                <div class="title" v-if="getCurrentLang() == 'tw'">
+                    <span style="position: relative; top: 1px">
+                        <svg-icon icon-class="test" class="title-icon" />
+                    </span>
+                    {{ this.$store.getters.getItemTitle.eventSubject }}科試卷
+                </div>
+                <div class="title" v-if="getCurrentLang() == 'en'">
+                    <span style="position: relative; top: 1px">
+                        <svg-icon icon-class="test" class="title-icon" />
+                    </span>
+                    {{ transSubjecttoEn(this.$store.getters.getItemTitle.eventSubject)}}
+                    Exam
+                </div>-->
+                    <!--依試卷是否完成顯示打勾狀態-->
+                    <!--li :class="{
+                finished: true,
+              }">
+              <Icon class="doneicon" type="ios-checkmark" size="36" />
+            </li-->
                     <!--</div>-->
-
                     <!----->
                     <!--多學科試卷-->
                     <!--<div v-if="paperData.length >1">
-                        <ul v-for="(item, index) in multiSubject"
-                            :key="index"
-                            class="tasks"
-                            @click="opentest()">
-                            <li class="title" v-if="getCurrentLang() == 'tw'">
-                                <span style="position: relative; top: 1px">
-                                    <svg-icon icon-class="test" class="title-icon" />
-                                </span>
-                                {{ item }}科試卷
-                            </li>
-                            <li class="title" v-if="getCurrentLang() == 'en'">
-                                <span style="position: relative; top: 1px">
-                                    <svg-icon icon-class="test" class="title-icon" />
-                                </span>
-                                {{ transSubjecttoEn(item) }} Exam
-                            </li>-->
-                            <!--依試卷是否完成顯示打勾狀態-->
-                        <!--</ul>
-                    </div>-->
-
+            <ul v-for="(item, index) in multiSubject"
+                :key="index"
+                class="tasks"
+                @click="opentest()">
+                <li class="title" v-if="getCurrentLang() == 'tw'">
+                    <span style="position: relative; top: 1px">
+                        <svg-icon icon-class="test" class="title-icon" />
+                    </span>
+                    {{ item }}科試卷
+                </li>
+                <li class="title" v-if="getCurrentLang() == 'en'">
+                    <span style="position: relative; top: 1px">
+                        <svg-icon icon-class="test" class="title-icon" />
+                    </span>
+                    {{ transSubjecttoEn(item) }} Exam
+                </li>-->
+                    <!--依試卷是否完成顯示打勾狀態-->
+                    <!--</ul>
+            </div>-->
                     <!----->
-
                 </TabPane>
                 <!--评量分析数据返回-->
                 <!--<TabPane :label="$t('studentWeb.exam.scorePage')" name="tab2">
-                    <LessonTestReport />
-                </TabPane>-->
+            <LessonTestReport />
+        </TabPane>-->
             </Tabs>
         </div>
     </div>
@@ -243,12 +246,16 @@
                 showHint: false,
                 paperData: [],
                 openEva: false,
-                selectData: {}
+                selectData: {},
+                isExam: false,
+                isExamDown: false, 
+                chooseData: {}
             };
         },
         methods: {
             getPaperData() {
                 this.paperData = []
+                this.chooseData = {}
                 if (this.$store.getters.getItemTitle.name !== undefined) {
                     let paper = this.$store.getters.getItemTitle
                     let req = {
@@ -270,7 +277,11 @@
                         for (let i = 0; i < this.paperData.length; i++) {
                             this.paperData[i].subject = sub.subjects[i]
                             this.paperData[i].stuAns = res.stuAns[i]
+                            this.paperData[i].stuScore = res.stuScore[i]
                         }
+                        this.getPaper(this.paperData[0])
+                        //this.chooseData = this.paperData[0]
+                        //console.log(this.chooseData)
                     })
                 }
             },
@@ -357,8 +368,10 @@
                 }
             },
             async getPaper(data) {
-
+                this.isExam = false
+                this.isExamDown = false
                 this.selectData = {}
+                this.chooseData = {}
                 if (data.blob !== undefined && data.blob !== "") {
                     let key = data.code.split('-')
                     let code = {
@@ -366,15 +379,32 @@
                         code: key[(key.length - 1)],
                         blob: data.blob
                     }
+                    this.chooseData = data
                     this.selectData = await this.$evTools.getStuPaper(code)
-                    console.log(this.selectData)
                     if (this.selectData.item.length > 0) {
-                        this.$store.commit("ToggleLessonTestPopWithSubject", data)
+                        let k = false
+                        for (let item of data.stuScore) {
+                            if (item == -1) {
+                                this.isExam = true
+                                break;
+                            }
+                        }
+                        if (this.isExam) {
+                            //this.$store.commit("ToggleLessonTestPopWithSubject", data)
+                        } else {
+                            this.isExamDown = true
+                        }
                         this.$store.commit("SetPaperInfo", this.selectData)
                         this.$store.commit("SetExamInfo", data)
+                        //console.log(this.chooseData)
                     }
                 }
             },
+            showTest() {
+                if (this.chooseData.subject !== undefined) {
+                    this.$store.commit("ToggleLessonTestPopWithSubject", this.chooseData)
+                }
+            },
             transSubjecttoEn(type) {
                 if (type == "國文") return "Chinese";
                 else if (type == "英文") return "English";
@@ -390,6 +420,8 @@
         watch: {
             $route: {
                 handler(val, oldval) {
+                    this.isExamDown = false
+                    this.isExam = false
                     this.getPaperData()
                 },
                 // 深度观察监听

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 611 - 521
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue


+ 4 - 4
TEAMModelOS/ClientApp/src/store/module/studentWeb.js

@@ -139,13 +139,13 @@ export default {
             state.currentQuestionNo = no;
         },
         SetPaperInfo(state, data) {
-            console.log('存入数据')
-            console.log(data)
+            //console.log('存入数据')
+            //console.log(data)
             state.paperInfo = data
         },
         SetExamInfo(state, data) {
-            console.log('存入数据')
-            console.log(data)
+            //console.log('存入数据')
+            //console.log(data)
             state.examInfo = data
         },
         SetTrytestCount(state, nowCountArray) {

+ 0 - 1
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -59,7 +59,6 @@
                                             <p class="semester-name-label" @click.stop>
                                                 <Input v-model="item.name" :disabled="editSemIndex !== index" placeholder="设置学期..." style="width: 180px" />
                                             </p>
-                                            <p>{{item.month}}</p>
                                             <div class="term-item-start" @click.stop>
                                                 <span>{{$t('schoolBaseInfo.startDate')}}</span>
                                                 <Select v-model="item.month" style="width:50px" placeholder="月" :disabled="editSemIndex !== index">

+ 6 - 6
TEAMModelOS/Controllers/Import/ImportController.cs

@@ -238,11 +238,11 @@ namespace TEAMModelOS.Controllers
             List<Sld> slds = new List<Sld>();
             foreach (var key in blobslidenames)
             {
-                slds.Add(new Sld { type = "normal", url = $"{FileName}/{key.Key}.json", scoring = null }); ;
+                slds.Add(new Sld { type = "normal", url = $"{key.Key}.json", scoring = null }); ;
                 tasks.Add(_azureStorage.UploadFileByContainer(id, key.Value, "res", $"{FileName}/{key.Key}.json" ,  false));
             }
             await Task.WhenAll(tasks);
-            Dictionary<string, Store> dict = new Dictionary<string, Store>();
+           // Dictionary<string, Store> dict = new Dictionary<string, Store>();
             List<Task> tasksFiles = new List<Task>();
             foreach (var key in htex.stores.Keys)
             {
@@ -259,17 +259,17 @@ namespace TEAMModelOS.Controllers
                     Stream stream = new MemoryStream(Convert.FromBase64String(strs[1]));
                     var urlstrs = key.Split("/");
                     var name = urlstrs[urlstrs.Length - 1];
-                    str.url = $"{FileName}/{name}";
+                    str.url = $"{name}";
                     tasksFiles.Add(_azureStorage.UploadFileByContainer(id, stream, "res", $"{FileName}/{name}", false));
                 }
                 else
                 {
                     str.url = System.Web.HttpUtility.UrlDecode(store.url, Encoding.UTF8);
                 }
-                dict.TryAdd(key, str);
+               // dict.TryAdd(key, str);
             }
             await Task.WhenAll(tasksFiles);
-            index.stores = dict;
+           // index.stores = dict;
             index.slides = slds;
             var BlobUrl = await _azureStorage.UploadFileByContainer(id, JsonHelper.ToJson(index, ignoreNullValue: false), "res", FileName + "/" + "index.json", false);
             return System.Web.HttpUtility.UrlDecode(BlobUrl, Encoding.UTF8);
@@ -286,7 +286,7 @@ namespace TEAMModelOS.Controllers
         //缩略图
         public string thumbnail { get; set; }
         //  public int page { get; set; }
-        public Dictionary<string, Store> stores { get; set; }
+       // public Dictionary<string, Store> stores { get; set; }
         public List<string> points { get; set; }
         public string periodId { get; set; }
         public List<string> gradeIds { get; set; }

+ 1 - 2
TEAMModelOS/TEAMModelOS.csproj

@@ -6,7 +6,7 @@
   <ItemGroup>
     <PackageReference Include="Caching.CSRedis" Version="3.6.50" />
     <PackageReference Include="CSRedisCore" Version="3.6.5" />
-    <PackageReference Include="HTEXLib" Version="2.0.2" />
+    <PackageReference Include="HTEXLib" Version="2.0.3" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.6" />
       <PackageReference Include="VueCliMiddleware" Version="3.1.2" />  </ItemGroup>
   <PropertyGroup>
@@ -43,7 +43,6 @@
   </ItemGroup>
 
   <ItemGroup>
-    <Folder Include="Controllers\Task\" />
     <Folder Include="JwtRsaFile\" />
     <Folder Include="Services\Evaluation\" />
     <Folder Include="wwwroot\" />