Ver Fonte

Merge branch 'develop5.0-tmd' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

chenmy há 3 anos atrás
pai
commit
4f2cabd0c8

+ 125 - 0
TEAMModeBI/Controllers/Activity/ActivitySticsController.cs

@@ -0,0 +1,125 @@
+using Azure.Cosmos;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.Models;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Models;
+using System.Text.Json;
+
+namespace TEAMModeBI.Controllers.Activity
+{
+    [Route("activity")]
+    [ApiController]
+    public class ActivitySticsController : ControllerBase
+    {
+        private readonly AzureCosmosFactory _azureCosmos;
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly DingDing _dingDing;
+        private readonly Option _option;
+        public readonly List<string> types = new List<string> { "Exam", "Survey", "Vote", "Homework" };
+
+        public ActivitySticsController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, DingDing dingDing, IOptionsSnapshot<Option> option)
+        {
+            _azureCosmos = azureCosmos;
+            _dingDing = dingDing;
+            _azureStorage = azureStorage;
+            _option = option?.Value;
+        }
+
+        /// <summary>
+        /// 统计所有的评量活动,问卷调查,投票活动,作业
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost("get-allactivity")]
+        public async Task<IActionResult> GetAllActivity() 
+        {
+            try
+            {
+                var cosmosClient = _azureCosmos.GetCosmosClient();
+                List<KeyValuePair<string, int>> typeCount = new List<KeyValuePair<string, int>>();
+                foreach (var type in types)
+                {
+                    int acount = 0;
+                    string querySql = $"SELECT distinct c.id,c.code,c.name,c.pk FROM c where c.pk='{type}'  ";
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(queryText: querySql, requestOptions: new QueryRequestOptions() { }))
+                    {
+                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0) 
+                        {
+                            acount += count.GetInt32();
+                            //foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                            //{
+                            //    acount += 1;
+                            //}
+                        }
+                    }
+
+                    KeyValuePair<string, int> valuePair = new KeyValuePair<string, int>(type, acount);
+                    typeCount.Add(valuePair);
+                }
+
+                return Ok(new { state = 200, typeCount });
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"BI,{_option.Location} /activity/get-allactivity  \n {ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
+                return BadRequest();
+            }
+        }
+
+        /// <summary>
+        /// 统计顾问关联的学校活动数量:评测、问卷、投票
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [HttpPost("get-assistactivity")]
+        public async Task<IActionResult> GetAssistSchoolActivity(JsonElement jsonElement) 
+        {
+            if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+            List<string> schoolIds = new List<string>();
+
+            string schoolSql = $"SELECT DISTINCT REPLACE(c.code,'Teacher-','') AS schoolId,c.code,c.roles,c.id,c.name From c where ARRAY_CONTAINS(c.roles,'assist',true) AND c.pk = 'Teacher' AND c.status = 'join' AND c.id='{tmdId}'";
+
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText:schoolSql,requestOptions:new QueryRequestOptions() { }))
+            {
+                using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray()) 
+                {
+                    schoolIds.Add(obj.GetProperty("schoolId").GetString());
+                }
+            }
+            List<KeyValuePair<string, int>> typeCount = new List<KeyValuePair<string, int>>();
+            foreach (var type in types)
+            {
+                int acount = 0;
+                foreach (var itemId in schoolIds)
+                {
+                    string activitySql = $"SELECT DISTINCT c.id,c.code,c.name FROM c WHERE c.pk='{type}' AND c.school='{itemId}'";
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(queryText: activitySql, requestOptions: new QueryRequestOptions() { }))
+                    {
+                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                        {
+                            acount += count.GetInt32();
+                            //foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                            //{
+                            //    acount += 1;
+                            //}
+                        }
+                    }
+                }
+
+                KeyValuePair<string, int> valuePair = new KeyValuePair<string, int>(type, acount);
+                typeCount.Add(valuePair);
+            }
+
+            return Ok(new { state = 200, typeCount });
+        }
+    }
+}

+ 2 - 5
TEAMModeBI/Controllers/BISchool/BatchAreaController.cs

@@ -507,12 +507,9 @@ namespace TEAMModeBI.Controllers.BISchool
                 }
 
                 List<string> abilityTaskIds = new List<string>();  //章节ID集合
-                foreach (var abilityId in abilityIds)
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
                 {
-                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c where c.abilityId='{abilityId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
-                    {
-                        abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
-                    }
+                    abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
                 }
                 //删除章节
                 if (abilityTaskIds.IsNotEmpty())

+ 62 - 40
TEAMModeBI/Controllers/BITest/TestController.cs

@@ -21,6 +21,7 @@ using TEAMModelOS.Models;
 using TEAMModelOS.SDK;//引用创建学校Code
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Helper.Common.DateTimeHelper;
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
@@ -53,6 +54,66 @@ namespace TEAMModeBI.Controllers.BITest
             _configuration = configuration;
         }
 
+        /// <summary>
+        /// 删除册别,删除章节  创区
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [HttpPost("del-standard")]
+        public async Task<IActionResult> DelStandard(JsonElement jsonElement)
+        {
+            if (!jsonElement.TryGetProperty("oldStandard", out JsonElement _oldStandard)) return BadRequest();
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+
+            List<string> abilityIds = new List<string>();  //册别的ID集合
+
+            //查询册别信息
+            await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_oldStandard}") }))
+            {
+                abilityIds.Add(tempAbility.id);  //查询出来册别ID添加册别ID集合
+            }
+            //删除册别
+            if (abilityIds.IsNotEmpty())
+            {
+                var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityIds, $"Ability-{_oldStandard}");
+            }
+
+            List<string> abilityTaskIds = new List<string>();  //章节ID集合
+
+            await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
+            {
+                abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
+            }
+            //删除章节
+            if (abilityTaskIds.IsNotEmpty())
+            {
+                var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityTaskIds, $"AbilityTask-{_oldStandard}");
+            }
+
+            return Ok(new { state = 200 });
+        }
+
+
+        public async Task<IActionResult> DelSchool(JsonElement jsonElement)
+        {
+            if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
+
+            List<string> ids = schoolId.ToObject<List<string>>();
+
+            var cosmosClient = _azureCosmos.GetCosmosClient();
+
+            string sql = $"select value(v) from c";
+
+            return Ok(new { state = 200 });
+
+        }
+
+
+
+
+
+
+
         /// <summary>
         /// 查询学校
         /// </summary>
@@ -598,46 +659,7 @@ namespace TEAMModeBI.Controllers.BITest
             return Ok(new {  pageTests1 });
         }
 
-        /// <summary>
-        /// 删除册别,删除章节
-        /// </summary>
-        /// <param name="jsonElement"></param>
-        /// <returns></returns>
-        [HttpPost("del-standard")]
-        public async Task<IActionResult> DelStandard(JsonElement jsonElement) 
-        {
-            if (!jsonElement.TryGetProperty("oldStandard", out JsonElement _oldStandard)) return BadRequest();
-            var cosmosClient = _azureCosmos.GetCosmosClient();
-
-            List<string> abilityIds = new List<string>();  //册别的ID集合
-
-            //查询册别信息
-            await foreach (var tempAbility in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<Ability>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Ability-{_oldStandard}") }))
-            {
-                abilityIds.Add(tempAbility.id);  //查询出来册别ID添加册别ID集合
-            }
-            //删除册别
-            if (abilityIds.IsNotEmpty())
-            {
-                //var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityIds, $"Ability-{_oldStandard}");
-            }
-
-            List<string> abilityTaskIds = new List<string>();  //章节ID集合
-            foreach (var abilityId in abilityIds)
-            {
-                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").GetItemQueryIterator<AbilityTask>(queryText: $"select value(c) from c where c.abilityId='{abilityId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilityTask-{_oldStandard}") }))
-                {
-                    abilityTaskIds.Add(item.id);   //查询出来的章节信息ID添加到战绩集合
-                }
-            }
-            //删除章节
-            if (abilityTaskIds.IsNotEmpty())
-            {
-                //var sresponse = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").DeleteItemsStreamAsync(abilityTaskIds, $"AbilityTask-{_oldStandard}");
-            }
-
-            return Ok(new { state = 200 });
-        }
+        
 
         /// <summary>
         /// 保存日志文件

+ 141 - 0
TEAMModeBI/Controllers/Lesson/LessonSticsController.cs

@@ -0,0 +1,141 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.Models;
+using TEAMModelOS.SDK.DI;
+using Microsoft.Extensions.Options;
+using Azure.Cosmos;
+using System.Text.Json;
+using TEAMModelOS.SDK.Models.Cosmos.Common;
+using TEAMModelOS.SDK.Models;
+
+namespace TEAMModeBI.Controllers.Lesson
+{
+    [Route("lesson")]
+    [ApiController]
+    public class LessonSticsController : ControllerBase
+    {
+
+        private readonly AzureCosmosFactory _azureCosmos;
+        private readonly AzureStorageFactory _azureStorage;
+        private readonly DingDing _dingDing;
+        private readonly Option _option;
+
+        public LessonSticsController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureFactory, DingDing dingDing, IOptionsSnapshot<Option> option) 
+        {
+            _azureCosmos = azureCosmos;
+            _azureStorage = azureFactory;
+            _dingDing = dingDing;
+            _option = option?.Value;        
+        }
+
+        /// <summary>
+        /// 统计课例数量
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost("get-total")]
+        public async Task<IActionResult> GetCount()
+        {
+            try
+            {
+                List<string> schoolIds = new List<string>();
+                var cosmosClient = _azureCosmos.GetCosmosClient();
+                string lessonSql = $"select c.id,c.tmid,c.scope from c where c.pk='LessonRecord'";
+                int total = 0;
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: lessonSql, requestOptions: new QueryRequestOptions() { }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
+                    {
+                        total = count.GetInt32();
+                    }
+                }
+
+                return Ok(new { state = 200, total });
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"BI,{_option.Location}  /lesson/get-total  {ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
+                return BadRequest();
+            }
+        }
+
+        /// <summary>
+        /// 管家所关联的课例数据
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [ProducesDefaultResponseType]
+        [HttpPost("get-assiist")]
+        public async Task<IActionResult> GetAssiist(JsonElement jsonElement) 
+        {
+            try
+            {
+                if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
+                var cosmosClient = _azureCosmos.GetCosmosClient();
+                List<SchoolLen> schoolLens = new List<SchoolLen>();
+
+                List<string> schoolIds = new List<string>();
+
+                string schoolSql = $"SELECT DISTINCT REPLACE(c.code,'Teacher-','') AS schoolId,c.code,c.roles,c.id,c.name From c where ARRAY_CONTAINS(c.roles,'assist',true) AND c.pk = 'Teacher' AND c.status = 'join' AND c.id='{tmdId}'";
+
+                await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: schoolSql, requestOptions: new QueryRequestOptions() { }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                    {
+                        schoolIds.Add(obj.GetProperty("schoolId").GetString());
+                    }
+                }
+
+                foreach (var itemId in schoolIds)
+                {
+                    SchoolLen schoolLen = new SchoolLen() { id = itemId };
+                    School school = new();
+                    try
+                    {
+                        school = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(itemId, new PartitionKey("Base"));
+                    }
+                    catch
+                    {
+                    }
+                    schoolLen.name = school != null ? school.name : itemId;
+
+                    await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: "SELECT DISTINCT c.id,c.code,c.name FROM c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{itemId}") }))
+                    {
+                        using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                        if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt32() > 0)
+                        {
+                            schoolLen.total = count.GetInt32();
+                        }
+                    }
+
+                    schoolLens.Add(schoolLen);
+                }
+
+                return Ok(new { state = 200, schoolLens });
+
+            }
+            catch (Exception ex)
+            {
+                await _dingDing.SendBotMsg($"BI, {_option.Location}  /lesson/get-assiist  {ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
+                return BadRequest();
+            }
+        }
+
+        public record SchoolLen 
+        {
+            public string id { get; set; }
+
+            public string name { get; set;}
+
+            public int total { get; set; }
+        }
+
+    }
+}
+
+

+ 13 - 9
TEAMModelFunction/TriggerExam.cs

@@ -102,7 +102,7 @@ namespace TEAMModelFunction
                             try
                             {
                                 //处理活动中间件
-                                (List<string> classes, List<RMember> members) = await Activity(info, client, _dingDing, sub);
+                                (List<string> classes, List<RGroupList> members) = await Activity(info, client, _dingDing, sub);
                                 //向学生或醍摩豆账号发起通知
                                 #region
                                 //Notice notice = new Notice()
@@ -133,15 +133,19 @@ namespace TEAMModelFunction
                                         int m = 0;
                                         foreach (ExamSubject subject in info.subjects)
                                         {
-                                            string classCode = "";
+                                            string classCode = string.Empty;
+                                            string cname = string.Empty;
                                             if (string.IsNullOrEmpty(info.school) || !info.scope.Equals("school", StringComparison.OrdinalIgnoreCase))
                                             {
-                                                classCode = "ExamClassResult-" + info.creatorId;
+                                                classCode = "ExamClassResult-" + info.creatorId;                                               
+                                                //cname = members.Select(m => m.members.Where(c => c.groupId.Equals(cla)).Select(g => g.groupName)).ToString();
                                             }
                                             else
                                             {
                                                 classCode = "ExamClassResult-" + info.school;
+                                                //cname = members.Select(m => m.members.Where(c => c.classId.Equals(cla)).Select(g => g.groupName)).ToString();
                                             }
+                                            cname = members.Where(m => m.id.Equals(cla)).FirstOrDefault()?.name;
                                             ExamClassResult result = new ExamClassResult
                                             {
                                                 code = classCode,
@@ -149,8 +153,9 @@ namespace TEAMModelFunction
                                                 id = Guid.NewGuid().ToString(),
                                                 subjectId = subject.id,
                                                 year = info.year,
-                                                scope = info.scope
+                                                scope = info.scope,
                                             };
+                                            result.info.name = cname;
                                             result.info.id = cla;
                                             List<string> ans = new List<string>();
                                             List<List<string>> anses = new List<List<string>>();
@@ -198,8 +203,7 @@ namespace TEAMModelFunction
                                                         }
                                                     }
                                                 }
-                                                //result.info.id = classroom.id;
-                                                result.info.name = classroom.name;
+                                                //result.info.id = classroom.id;                                               
                                                 //result.gradeId = classroom.year.ToString();
                                                 //处理班级人数
                                                /* await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.classId = '{classroom.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{info.school}") }))
@@ -256,7 +260,7 @@ namespace TEAMModelFunction
                                                     }
                                                 }
                                             }*/
-                                            ids = members.Select(m => m.id).ToList();
+                                            ids = members.Where(c => c.id.Equals(cla)).SelectMany( m => m.members).Select(g => g.id).ToList();
                                             foreach (string stu in ids)
                                             {
                                                 result.mark.Add(marks);
@@ -530,7 +534,7 @@ namespace TEAMModelFunction
                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-{info.id}-评测作答记录结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
             }
         }
-        public static async Task<(List<string> classes,List<RMember> members)> Activity(ExamInfo info, CosmosClient client, DingDing _dingDing, List<string> sub) {
+        public static async Task<(List<string> classes, List<RGroupList> members)> Activity(ExamInfo info, CosmosClient client, DingDing _dingDing, List<string> sub) {
             List<(string pId, List<string> gid)> ps = new List<(string pId, List<string> gid)>();
             if (info.groupLists.Count > 0)
             {
@@ -605,7 +609,7 @@ namespace TEAMModelFunction
                 });
             }
             await ActivityService.SaveStuActivity(client, _dingDing, stuActivities, tmdActivities, null);
-            return (classes, tchList);
+            return (classes, classLists);
         }
 
         public static async Task knowledgeCount(ExamInfo info, ExamSubject subject, DingDing _dingDing, int no, List<ExamClassResult> classResults,

+ 36 - 2
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/WrongQues.less

@@ -6,10 +6,10 @@
 
     & > div {
         background-color: #FFFFFF;
-        padding: 1%;
     }
 
     .filter-type{
+        padding: 1%;
         margin-bottom: 20px;
 
         & > div{
@@ -59,6 +59,40 @@
         }
     }
     
-    .topic-list{}
+    .topic-list{
+
+        & > div:first-child {
+            border-bottom: 1px solid #ccc;
+            padding: 10px 1%;
+        }
+
+        .start-btn-primary {
+            border: 1px solid #ccc;
+            margin-left: 30px;
+            padding: 3px 5px;
+            border-radius: 5px;
+            cursor: pointer;
+        }
+
+        .start-btn{
+            border-color: @primary;
+            background-color: @primary;
+            color: #fff;
+        }
+
+        .ivu-checkbox-group-item{
+            display: flex;
+            margin-right: 0;
+
+            & > div{
+            }
+        }
+
+        .topic-box {
+            border-bottom: 1px solid #ccc;
+            // margin-bottom: 10px;
+            padding: 10px 1%;
+        }
+    }
 
 }

+ 43 - 19
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/WrongQues.vue

@@ -53,17 +53,20 @@
         <div class="topic-list">
             <div>
                 <Checkbox v-model="checkAll">选择所有题目</Checkbox>
-                <span>
+                <span style="float: right">
                     已选:
-                    <span>{{ checkNum }}</span>
-                    <Button>开始练习</Button>
+                    <span style="font-size: 18px; font-weight: bold;">{{ checkNum }}</span>
+                    <span :class="['start-btn-primary', {'start-btn': checkNum}]">开始练习</span>
                 </span>
             </div>
             <template v-if="topicList.length">
                 <vuescroll>
                     <CheckboxGroup v-model="checkTopicArr">
-                        <Checkbox :label="index" v-for="(item, index) in topicList" :key="index">
-                            {{ item.title }}
+                        <Checkbox :label="index" v-for="(item, index) in topicList" :key="index" class="topic-box">
+                            <div>
+                                <span style="vertical-align: top;">{{ index + 1 }}. </span>
+                                <div v-html="item.question" style="width: 98%; display: inline-block;"></div>
+                            </div>
                         </Checkbox>
                     </CheckboxGroup>
                 </vuescroll>
@@ -129,7 +132,7 @@ export default {
                     return date && date.valueOf() > Date.now() - 86400000;
                 }
             },
-            topicTotal: "147",
+            topicTotal: 0,
             checkAll: false,
             allPoint: [], //所有知识点
             checkPointArr: [], //选择知识点
@@ -140,7 +143,7 @@ export default {
             pointField: "",
         }
     },
-    created () {
+    async created () {
         this.MyName = this.$t("studentWeb.type.wrongTopic");
         this.$emit("onNavNo", this.MyNo);
         this.$emit("onNavName", this.MyName);
@@ -149,18 +152,13 @@ export default {
             { name: "数学"},
             { name: "英语"}
         ]
-        this.topicList = [
-            { checked: false, title: "少时诵诗书三生三世试试"},
-            { checked: false, title: "少时诵诗书三生三世试试"},
-            { checked: false, title: "少时诵诗书三生三世试试"},
-            { checked: false, title: "少时诵诗书三生三世试试"}
-        ]
         this.allPoint = [
             { name: "字音"},
             { name: "字形"},
             { name: "文言文释义"},
             { name: "拟人"}
         ]
+        this.getTopicList()
     },
     methods: {
         dateChange(date) {
@@ -168,6 +166,29 @@ export default {
         },
         checkPoint() {
 
+        },
+        // 获取题目
+        getTopicList() {
+            var queryData = {
+                "@DESC": "createTime",
+                "code": "hbcn",
+                "periodId": [],
+                "gradeIds[*]": [],
+                "subjectId": ["8b94c6b6-2572-41e5-89b9-a82fcf13891e"],
+                "level": [],
+                "type": [],
+                "field": [],
+                "scope": "school",
+                "knowledge[*]": [],
+                "pid": null
+            }
+            this.$api.newEvaluation.FindExerciseList(queryData).then(res => {
+                if(res.items){
+                    this.topicList = res.items
+                    this.topicTotal = this.topicList.length
+                }
+            }).catch((e) => {
+            });
         },
         okPoint() {
             this.showPoint = []
@@ -183,9 +204,7 @@ export default {
         checkNum() {
             var num = 0
             if(this.topicList.length) {
-                this.topicList.forEach(item => {
-                    num += (item.checked ? 1 : 0)
-                });
+                num = this.checkTopicArr.length
             }
             return num
         },
@@ -194,9 +213,14 @@ export default {
         checkAll: {
             handler(n, o) {
                 if(this.topicList.length) {
-                    this.topicList.forEach((item, index) => {
-                        this.checkTopicArr.push(index)
-                    });
+                    if(n) {
+                        this.checkTopicArr = []
+                        this.topicList.forEach((item, index) => {
+                            this.checkTopicArr.push(index)
+                        });
+                    } else {
+                        this.checkTopicArr = []
+                    }
                 }
             }
         }

+ 10 - 0
TEAMModelOS/ClientApp/src/components/student-web/WrongQusetion/iViewStyle.less

@@ -70,6 +70,16 @@
     .ivu-date-picker-cells-cell-today em:after{
         background: @primary;
     }
+
+    .topic-list {
+        .ivu-checkbox{
+            margin-right: 8px;
+        }
+        .topic-box .ivu-checkbox{
+            margin-top: 2px;
+            margin-right: 10px;
+        }
+    }
 }
 
 

+ 5 - 1
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -782,7 +782,11 @@ namespace TEAMModelOS.Controllers
                     //}                  
                     //List<(int index ,string content, double count)> acount = new List<(int index,string content, double count)>();
                     for (int i = 0; i < ans.Count; i++)
-                    {                       
+                    {
+                        if (ans[i] == null)
+                        {
+                            continue;
+                        }
                         var ac = ans[i].Where(a => a.Trim().Length > 0).ToList().Count;
                         var sc = standard[i].Count;
                         //算分处理