瀏覽代碼

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

zhousheng 4 年之前
父節點
當前提交
da4ea8ba4d
共有 32 個文件被更改,包括 623 次插入351 次删除
  1. 218 0
      TEAMModelFunction/ExamTrigger.cs
  2. 4 303
      TEAMModelFunction/MonitorCosmosDB.cs
  3. 79 0
      TEAMModelFunction/SurveyTrigger.cs
  4. 79 0
      TEAMModelFunction/VoteTrigger.cs
  5. 21 0
      TEAMModelOS.SDK/Models/Cosmos/Common/CommonData.cs
  6. 23 0
      TEAMModelOS/ClientApp/src/assets/iconfont/demo_index.html
  7. 10 6
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.css
  8. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.eot
  9. 1 1
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.js
  10. 7 0
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.json
  11. 3 0
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.svg
  12. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.ttf
  13. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff
  14. 二進制
      TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff2
  15. 12 4
      TEAMModelOS/ClientApp/src/common/BaseCanvas.vue
  16. 2 0
      TEAMModelOS/ClientApp/src/common/BaseMyCanvas.vue
  17. 5 9
      TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.vue
  18. 2 3
      TEAMModelOS/ClientApp/src/utils/editorTools.js
  19. 9 0
      TEAMModelOS/ClientApp/src/utils/evTools.js
  20. 0 4
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseCompletion.vue
  21. 2 2
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseMultiple.vue
  22. 3 3
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue
  23. 0 4
      TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue
  24. 12 3
      TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreateNew.vue
  25. 35 0
      TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.less
  26. 49 0
      TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue
  27. 7 1
      TEAMModelOS/ClientApp/src/view/learnactivity/ManualCreate.vue
  28. 6 0
      TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue
  29. 29 6
      TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue
  30. 1 1
      TEAMModelOS/Controllers/Common/ExamController.cs
  31. 3 0
      TEAMModelOS/Controllers/Common/VoteController.cs
  32. 1 1
      TEAMModelOS/TEAMModelOS.csproj

+ 218 - 0
TEAMModelFunction/ExamTrigger.cs

@@ -0,0 +1,218 @@
+using Azure.Cosmos;
+using Azure.Messaging.ServiceBus;
+using Microsoft.Azure.Documents;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Models;
+
+namespace TEAMModelFunction
+{
+    public class ExamTrigger
+    {
+        public static async void Trigger(AzureCosmosFactory _azureCosmos, AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, DingDing _dingDing, 
+            CosmosClient client, Document input ,string code,long stime,long etime, string school)
+        {
+            ExamInfo info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(input.Id, new Azure.Cosmos.PartitionKey($"{code}"));
+            List<ExamClassResult> examClassResults = new List<ExamClassResult>();
+            List<ExamSubject> examSubjects = new List<ExamSubject>();
+            await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.examId = '{info.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.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())
+                    {
+                        examClassResults.Add(obj.ToObject<ExamClassResult>());
+                    }
+                }
+            }
+
+            List<ChangeRecord> records = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", info.progress } });
+            //ChangeRecord record = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ChangeRecord>(input.Id, new Azure.Cosmos.PartitionKey($"{info.progress}"));
+            switch (info.progress)
+            {
+                case "pending":
+                    var message = new ServiceBusMessage(new { id = input.Id, progress = "going", code = code }.ToJsonString());
+                    message.ApplicationProperties.Add("name", "Exam");
+                    if (records.Count > 0)
+                    {
+                        await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        records[0].sequenceNumber = start;
+                        await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
+                        //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(record, record.id, new Azure.Cosmos.PartitionKey($"{record.code}"));
+                    }
+                    else
+                    {
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        ChangeRecord changeRecord = new ChangeRecord
+                        {
+                            RowKey = input.Id,
+                            PartitionKey = "pending",
+                            sequenceNumber = start,
+                            msgId = message.MessageId
+                        };
+                        await _azureStorage.Save<ChangeRecord>(changeRecord);
+                        //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
+                    }
+                    break;
+                case "going":
+                    if (examClassResults.Count == 0)
+                    {
+                        foreach (string cla in info.targetClassIds)
+                        {
+                            int m = 0;
+                            foreach (ExamSubject subject in info.subjects)
+                            {
+                                ExamClassResult result = new ExamClassResult
+                                {
+                                    code = "ExamClassResult-" + info.school,
+                                    examId = info.id,
+                                    id = Guid.NewGuid().ToString(),
+                                    subjectId = subject.id,
+                                    year = info.year,
+                                    scope = info.scope
+                                };
+                                result.info.id = cla;
+                                var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(cla, new Azure.Cosmos.PartitionKey($"Class-{info.school}"));
+                                if (sresponse.Status == 200)
+                                {
+                                    using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
+                                    Class classroom = json.ToObject<Class>();
+                                    result.info.name = classroom.name;
+                                    List<string> ans = new List<string>();
+                                    List<double> ansPoint = new List<double>();
+                                    foreach (double p in info.papers[m].point)
+                                    {
+                                        //ans.Add(new List<string>());
+                                        ansPoint.Add(-1);
+                                    }
+                                    foreach (StudentSimple stu in classroom.students)
+                                    {
+                                        result.studentIds.Add(stu.id);
+                                        result.studentAnswers.Add(ans);
+                                        result.studentScores.Add(ansPoint);
+                                        result.sum.Add(0);
+                                    }
+                                }
+                                //result.progress = info.progress;
+                                result.school = info.school;
+                                m++;
+                                await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(result, new Azure.Cosmos.PartitionKey($"{result.code}"));
+                            }
+                        }
+                        // 发送信息通知
+                        var messageEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = code }.ToJsonString());
+                        messageEnd.ApplicationProperties.Add("name", "Exam");
+                        if (records.Count > 0)
+                        {
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
+                            records[0].sequenceNumber = end;
+                            await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
+                            //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(record, record.id, new Azure.Cosmos.PartitionKey($"{record.code}"));
+                        }
+                        else
+                        {
+                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                            ChangeRecord changeRecord = new ChangeRecord
+                            {
+                                RowKey = input.Id,
+                                PartitionKey = "going",
+                                sequenceNumber = end,
+                                msgId = messageEnd.MessageId
+                            };
+                            await _azureStorage.Save<ChangeRecord>(changeRecord);
+                            //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
+                        }
+                    }
+                    else
+                    {
+                        //处理单科结算时科目与试卷信息匹配的问题
+                        int gno = 0;
+                        foreach (ExamSubject subject in info.subjects)
+                        {
+                            if (subject.classCount == info.targetClassIds.Count)
+                            {
+                                await createClassResultAsync(info, examClassResults, subject, gno,_azureCosmos);
+                            }
+                            gno++;
+                        }
+                    }
+                    break;
+                case "finish":
+                    int fno = 0;
+                    foreach (ExamSubject subject in info.subjects)
+                    {
+                        await createClassResultAsync(info, examClassResults, subject, fno, _azureCosmos);
+                        fno++;
+                    }
+
+                    break;
+            }
+        }
+        public static async Task createClassResultAsync(ExamInfo info, List<ExamClassResult> examClassResults, ExamSubject subject, int no, AzureCosmosFactory _azureCosmos)
+        {
+            //保证试卷信息与科目信息同步
+            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(subject.id))
+                {
+                    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.classes = classRanges;
+            result.code = "ExamResult-" + info.id;
+            result.school = info.school;
+            result.id = subject.id;
+            result.examId = info.id;
+            result.subjectId = subject.id;
+            result.year = info.year;
+            result.paper = info.papers[no];
+            //result.point = info.papers[j].point;
+            result.scope = info.scope;
+            result.name = info.name;
+            result.time = info.startTime;
+            await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Common").UpsertItemAsync(result, new Azure.Cosmos.PartitionKey($"ExamResult-{info.id}"));
+
+        }
+    }
+}

+ 4 - 303
TEAMModelFunction/MonitorCosmosDB.cs

@@ -60,256 +60,13 @@ namespace TEAMModelFunction
                         switch (pk)
                         {
                             case "Exam":
-                                ExamInfo info = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ExamInfo>(input.Id, new Azure.Cosmos.PartitionKey($"{code}"));
-                                List<ExamClassResult> examClassResults = new List<ExamClassResult>();
-                                List<ExamSubject> examSubjects = new List<ExamSubject>();
-                                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c where c.examId = '{info.id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.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())
-                                        {
-                                            examClassResults.Add(obj.ToObject<ExamClassResult>());
-                                        }
-                                    }
-                                }
-
-                                List<ChangeRecord> records = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", info.progress } });
-                                //ChangeRecord record = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ChangeRecord>(input.Id, new Azure.Cosmos.PartitionKey($"{info.progress}"));
-                                switch (info.progress)
-                                {
-                                    case "pending":
-                                        var message = new ServiceBusMessage(new { id = input.Id, progress = "going", code = code }.ToJsonString());
-                                        message.ApplicationProperties.Add("name", "Exam");
-                                        if (records.Count > 0)
-                                        {
-                                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
-                                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                            records[0].sequenceNumber = start;
-                                            await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
-                                            //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(record, record.id, new Azure.Cosmos.PartitionKey($"{record.code}"));
-                                        }
-                                        else
-                                        {
-                                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", message, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                            ChangeRecord changeRecord = new ChangeRecord
-                                            {
-                                                RowKey = input.Id,
-                                                PartitionKey = "pending",
-                                                sequenceNumber = start,
-                                                msgId = message.MessageId
-                                            };
-                                            await _azureStorage.Save<ChangeRecord>(changeRecord);
-                                            //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
-                                        }
-                                        break;
-                                    case "going":
-                                        if (examClassResults.Count == 0)
-                                        {
-                                            foreach (string cla in info.targetClassIds) {
-                                                int m = 0;
-                                                foreach (ExamSubject subject in info.subjects) {
-                                                    ExamClassResult result = new ExamClassResult
-                                                    {
-                                                        code = "ExamClassResult-" + info.school,
-                                                        examId = info.id,
-                                                        id = Guid.NewGuid().ToString(),
-                                                        subjectId = subject.id,
-                                                        year = info.year,
-                                                        scope = info.scope
-                                                    };
-                                                    result.info.id = cla;
-                                                    var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(cla, new Azure.Cosmos.PartitionKey($"Class-{info.school}"));
-                                                    if (sresponse.Status == 200)
-                                                    {
-                                                        using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
-                                                        Class classroom = json.ToObject<Class>();
-                                                        result.info.name = classroom.name;
-                                                        List<string> ans = new List<string>();
-                                                        List<double> ansPoint = new List<double>();
-                                                        foreach (double p in info.papers[m].point)
-                                                        {
-                                                            //ans.Add(new List<string>());
-                                                            ansPoint.Add(-1);
-                                                        }
-                                                        foreach (StudentSimple stu in classroom.students)
-                                                        {
-                                                            result.studentIds.Add(stu.id);
-                                                            result.studentAnswers.Add(ans);
-                                                            result.studentScores.Add(ansPoint);
-                                                            result.sum.Add(0);
-                                                        }
-                                                    }
-                                                    //result.progress = info.progress;
-                                                    result.school = info.school;
-                                                    m++;
-                                                    await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(result, new Azure.Cosmos.PartitionKey($"{result.code}"));
-                                                }
-                                            }
-                                            // 发送信息通知
-                                            var messageEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = code }.ToJsonString());
-                                            messageEnd.ApplicationProperties.Add("name", "Exam");
-                                            if (records.Count > 0)
-                                            {
-                                                long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                                await _serviceBus.GetServiceBusClient().cancelMessage("active-task", records[0].sequenceNumber);
-                                                records[0].sequenceNumber = end;
-                                                await _azureStorage.SaveOrUpdate<ChangeRecord>(records[0]);
-                                                //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(record, record.id, new Azure.Cosmos.PartitionKey($"{record.code}"));
-                                            }
-                                            else
-                                            {
-                                                long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                                ChangeRecord changeRecord = new ChangeRecord
-                                                {
-                                                    RowKey = input.Id,
-                                                    PartitionKey = "going",
-                                                    sequenceNumber = end,
-                                                    msgId = messageEnd.MessageId
-                                                };
-                                                await _azureStorage.Save<ChangeRecord>(changeRecord);
-                                                //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
-                                            }
-                                        }
-                                        else
-                                        {
-                                            //处理单科结算时科目与试卷信息匹配的问题
-                                            int gno = 0;
-                                            foreach (ExamSubject subject in info.subjects) {
-                                                if (subject.classCount == info.targetClassIds.Count) {
-                                                    await createClassResultAsync(info, examClassResults, subject, gno);
-                                                }
-                                                gno++;
-                                            }                                           
-                                        }
-                                        break;
-                                    case "finish":
-                                        int fno = 0;
-                                        foreach (ExamSubject subject in info.subjects) {
-                                            await createClassResultAsync(info, examClassResults, subject, fno);
-                                            fno++;
-                                        }
-                                       
-                                        break;
-                                }
+                                ExamTrigger.Trigger(_azureCosmos, _serviceBus, _azureStorage, _dingDing, client,input,code,stime,etime,school);
                                 break;
                             case "Vote":
-                                Vote vote = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(input.Id, new Azure.Cosmos.PartitionKey($"{code}"));
-                                List<ChangeRecord> voteRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", vote.progress } });
-                                //ChangeRecord voteRecord = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ChangeRecord>(input.Id, new Azure.Cosmos.PartitionKey($"{vote.progress}"));
-                                switch (vote.progress)
-                                {
-                                    case "pending":
-                                        var messageVote = new ServiceBusMessage(new { id = input.Id, progress = "going", code = code }.ToJsonString());
-                                        messageVote.ApplicationProperties.Add("name", "Vote");
-                                        if (voteRecords.Count > 0)
-                                        {
-                                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
-                                            voteRecords[0].sequenceNumber = start;
-                                            await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
-                                            //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(voteRecord, voteRecord.id, new Azure.Cosmos.PartitionKey($"{voteRecord.code}"));
-                                        }
-                                        else
-                                        {
-                                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                            ChangeRecord changeRecord = new ChangeRecord
-                                            {
-                                                RowKey = input.Id,
-                                                PartitionKey = "pending",
-                                                sequenceNumber = start,
-                                                msgId = messageVote.MessageId
-                                            };
-                                            await _azureStorage.Save<ChangeRecord>(changeRecord);
-                                            //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
-                                        }
-                                        break;
-                                    case "going":
-                                        var messageVoteEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = code }.ToJsonString());
-                                        messageVoteEnd.ApplicationProperties.Add("name", "Vote");
-                                        if (voteRecords.Count > 0)
-                                        {
-                                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
-                                            voteRecords[0].sequenceNumber = end;
-                                            await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
-                                            //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(voteRecord, voteRecord.id, new Azure.Cosmos.PartitionKey($"{voteRecord.code}"));
-                                        }
-                                        else
-                                        {
-                                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                            ChangeRecord changeRecord = new ChangeRecord
-                                            {
-                                                RowKey = input.Id,
-                                                PartitionKey = "going",
-                                                sequenceNumber = end,
-                                                msgId = messageVoteEnd.MessageId
-                                            };
-                                            await _azureStorage.Save<ChangeRecord>(changeRecord);
-                                            //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
-                                        }
-                                        break;
-                                }
+                                VoteTrigger.Trigger(_azureCosmos, _serviceBus, _azureStorage, _dingDing, client, input, code, stime, etime, school);
                                 break;
                             case "Survey":
-                                Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(input.Id, new Azure.Cosmos.PartitionKey($"{code}"));
-                                //messageSurvey.ScheduledEnqueueTime = DateTimeOffset.FromUnixTimeMilliseconds(stime);
-                                //string msgid = messageSurvey.MessageId;
-                                List<ChangeRecord> changeRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", survey.progress } });
-                                //ChangeRecord surveyRecord = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ChangeRecord>(input.Id, new Azure.Cosmos.PartitionKey($"{survey.progress}"));
-                                switch (survey.progress)
-                                {
-                                    case "pending":
-                                        var messageSurvey = new ServiceBusMessage(new { id = input.Id, progress = "going", code = code }.ToJsonString());
-                                        messageSurvey.ApplicationProperties.Add("name", "Survey");
-                                        if (changeRecords.Count > 0)
-                                        {
-                                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
-                                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                            changeRecords[0].sequenceNumber = start;
-                                            await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
-                                            //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(surveyRecord, surveyRecord.id, new Azure.Cosmos.PartitionKey($"{surveyRecord.code}"));
-                                        }
-                                        else
-                                        {
-                                            long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(stime));
-                                            ChangeRecord changeRecord = new ChangeRecord
-                                            {
-                                                RowKey = input.Id,
-                                                PartitionKey = "pending",
-                                                sequenceNumber = start,
-                                                msgId = messageSurvey.MessageId
-                                            };
-                                            await _azureStorage.Save<ChangeRecord>(changeRecord);
-                                            //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
-                                        }
-                                        break;
-                                    case "going":
-                                        var messageSurveyEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = code }.ToJsonString());
-                                        messageSurveyEnd.ApplicationProperties.Add("name", "Survey");
-                                        if (changeRecords.Count > 0)
-                                        {
-                                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                            await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
-                                            changeRecords[0].sequenceNumber = end;
-                                            await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
-                                        }
-                                        else
-                                        {
-                                            long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
-                                            ChangeRecord changeRecord = new ChangeRecord
-                                            {
-                                                RowKey = input.Id,
-                                                PartitionKey = "going",
-                                                sequenceNumber = end,
-                                                msgId = messageSurveyEnd.MessageId
-                                            };
-                                            await _azureStorage.Save<ChangeRecord>(changeRecord);
-                                            //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
-                                        }
-                                        break;
-                                }
+                                SurveyTrigger.Trigger(_azureCosmos, _serviceBus, _azureStorage, _dingDing, client, input, code, stime, etime, school);
                                 break;
 
                         }
@@ -317,62 +74,6 @@ namespace TEAMModelFunction
                 }
             }
         }
-        public async Task createClassResultAsync(ExamInfo info,List<ExamClassResult> examClassResults,ExamSubject subject,int no) {
-            //保证试卷信息与科目信息同步
-                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(subject.id))
-                    {
-                        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.classes = classRanges;
-                result.code = "ExamResult-" + info.id;
-                result.school = info.school;
-                result.id = subject.id;
-                result.examId = info.id;
-                result.subjectId = subject.id;
-                result.year = info.year;
-                result.paper = info.papers[no];
-                //result.point = info.papers[j].point;
-                result.scope = info.scope;
-                result.name = info.name;
-                result.time = info.startTime;
-                await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Common").UpsertItemAsync(result, new Azure.Cosmos.PartitionKey($"ExamResult-{info.id}"));
-            
-        }
+        
     }
 }

+ 79 - 0
TEAMModelFunction/SurveyTrigger.cs

@@ -0,0 +1,79 @@
+using Azure.Cosmos;
+using Azure.Messaging.ServiceBus;
+using Microsoft.Azure.Documents;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Models;
+
+namespace TEAMModelFunction
+{
+   public class SurveyTrigger
+    {
+        public static async void Trigger(AzureCosmosFactory _azureCosmos, AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, DingDing _dingDing,
+               CosmosClient client, Document input, string code, long stime, long etime, string school)
+        {
+            Survey survey = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Survey>(input.Id, new Azure.Cosmos.PartitionKey($"{code}"));
+            //messageSurvey.ScheduledEnqueueTime = DateTimeOffset.FromUnixTimeMilliseconds(stime);
+            //string msgid = messageSurvey.MessageId;
+            List<ChangeRecord> changeRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", survey.progress } });
+            //ChangeRecord surveyRecord = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ChangeRecord>(input.Id, new Azure.Cosmos.PartitionKey($"{survey.progress}"));
+            switch (survey.progress)
+            {
+                case "pending":
+                    var messageSurvey = new ServiceBusMessage(new { id = input.Id, progress = "going", code = code }.ToJsonString());
+                    messageSurvey.ApplicationProperties.Add("name", "Survey");
+                    if (changeRecords.Count > 0)
+                    {
+                        await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        changeRecords[0].sequenceNumber = start;
+                        await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
+                        //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(surveyRecord, surveyRecord.id, new Azure.Cosmos.PartitionKey($"{surveyRecord.code}"));
+                    }
+                    else
+                    {
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurvey, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        ChangeRecord changeRecord = new ChangeRecord
+                        {
+                            RowKey = input.Id,
+                            PartitionKey = "pending",
+                            sequenceNumber = start,
+                            msgId = messageSurvey.MessageId
+                        };
+                        await _azureStorage.Save<ChangeRecord>(changeRecord);
+                        //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
+                    }
+                    break;
+                case "going":
+                    var messageSurveyEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = code }.ToJsonString());
+                    messageSurveyEnd.ApplicationProperties.Add("name", "Survey");
+                    if (changeRecords.Count > 0)
+                    {
+                        long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                        await _serviceBus.GetServiceBusClient().cancelMessage("active-task", changeRecords[0].sequenceNumber);
+                        changeRecords[0].sequenceNumber = end;
+                        await _azureStorage.SaveOrUpdate<ChangeRecord>(changeRecords[0]);
+                    }
+                    else
+                    {
+                        long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageSurveyEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                        ChangeRecord changeRecord = new ChangeRecord
+                        {
+                            RowKey = input.Id,
+                            PartitionKey = "going",
+                            sequenceNumber = end,
+                            msgId = messageSurveyEnd.MessageId
+                        };
+                        await _azureStorage.Save<ChangeRecord>(changeRecord);
+                        //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
+                    }
+                    break;
+            }
+        }
+    }
+}

+ 79 - 0
TEAMModelFunction/VoteTrigger.cs

@@ -0,0 +1,79 @@
+using Azure.Cosmos;
+using Azure.Messaging.ServiceBus;
+using Microsoft.Azure.Documents;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+using TEAMModelOS.SDK.DI;
+using TEAMModelOS.SDK.Extension;
+using TEAMModelOS.SDK.Models;
+
+namespace TEAMModelFunction
+{
+  public static  class VoteTrigger
+    {
+
+        public static async void Trigger(AzureCosmosFactory _azureCosmos, AzureServiceBusFactory _serviceBus, AzureStorageFactory _azureStorage, DingDing _dingDing,
+            CosmosClient client, Document input, string code, long stime, long etime, string school)
+        {
+            Vote vote = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Vote>(input.Id, new Azure.Cosmos.PartitionKey($"{code}"));
+            List<ChangeRecord> voteRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", vote.progress } });
+            //ChangeRecord voteRecord = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<ChangeRecord>(input.Id, new Azure.Cosmos.PartitionKey($"{vote.progress}"));
+            switch (vote.progress)
+            {
+                case "pending":
+                    var messageVote = new ServiceBusMessage(new { id = input.Id, progress = "going", code = code }.ToJsonString());
+                    messageVote.ApplicationProperties.Add("name", "Vote");
+                    if (voteRecords.Count > 0)
+                    {
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
+                        voteRecords[0].sequenceNumber = start;
+                        await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
+                        //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(voteRecord, voteRecord.id, new Azure.Cosmos.PartitionKey($"{voteRecord.code}"));
+                    }
+                    else
+                    {
+                        long start = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVote, DateTimeOffset.FromUnixTimeMilliseconds(stime));
+                        ChangeRecord changeRecord = new ChangeRecord
+                        {
+                            RowKey = input.Id,
+                            PartitionKey = "pending",
+                            sequenceNumber = start,
+                            msgId = messageVote.MessageId
+                        };
+                        await _azureStorage.Save<ChangeRecord>(changeRecord);
+                        //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
+                    }
+                    break;
+                case "going":
+                    var messageVoteEnd = new ServiceBusMessage(new { id = input.Id, progress = "finish", code = code }.ToJsonString());
+                    messageVoteEnd.ApplicationProperties.Add("name", "Vote");
+                    if (voteRecords.Count > 0)
+                    {
+                        long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                        await _serviceBus.GetServiceBusClient().cancelMessage("active-task", voteRecords[0].sequenceNumber);
+                        voteRecords[0].sequenceNumber = end;
+                        await _azureStorage.SaveOrUpdate<ChangeRecord>(voteRecords[0]);
+                        //await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(voteRecord, voteRecord.id, new Azure.Cosmos.PartitionKey($"{voteRecord.code}"));
+                    }
+                    else
+                    {
+                        long end = await _serviceBus.GetServiceBusClient().SendScheduleMessageAsync("active-task", messageVoteEnd, DateTimeOffset.FromUnixTimeMilliseconds(etime));
+                        ChangeRecord changeRecord = new ChangeRecord
+                        {
+                            RowKey = input.Id,
+                            PartitionKey = "going",
+                            sequenceNumber = end,
+                            msgId = messageVoteEnd.MessageId
+                        };
+                        await _azureStorage.Save<ChangeRecord>(changeRecord);
+                        //await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(changeRecord, new Azure.Cosmos.PartitionKey($"{changeRecord.code}"));
+                    }
+                    break;
+            }
+        }
+    }
+}

+ 21 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/CommonData.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.SDK.Models.Cosmos.Student
+{
+    public class CommonData : CosmosEntity
+    {
+        public CommonData() {
+            pk = "Common";
+        }
+        /// <summary>
+        /// 业务类型  vote投票 survey问卷 exam评测 learn学习活动 homework作业活动
+        /// </summary>
+        public string type { get; set; }
+        public string name { get; set; }
+        public string startTime { get; set; }
+        public string endTime { get; set; }
+        public string scode { get; set; }
+    }
+}

+ 23 - 0
TEAMModelOS/ClientApp/src/assets/iconfont/demo_index.html

@@ -30,6 +30,12 @@
       <div class="content unicode" style="display: block;">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+              <span class="icon iconfont">&#xe640;</span>
+                <div class="name">半对</div>
+                <div class="code-name">&amp;#xe640;</div>
+              </li>
+          
             <li class="dib">
               <span class="icon iconfont">&#xe99d;</span>
                 <div class="name">完成</div>
@@ -458,6 +464,15 @@
       <div class="content font-class">
         <ul class="icon_lists dib-box">
           
+          <li class="dib">
+            <span class="icon iconfont icon-half-right"></span>
+            <div class="name">
+              半对
+            </div>
+            <div class="code-name">.icon-half-right
+            </div>
+          </li>
+          
           <li class="dib">
             <span class="icon iconfont icon-complete"></span>
             <div class="name">
@@ -1054,6 +1069,14 @@
       <div class="content symbol">
           <ul class="icon_lists dib-box">
           
+            <li class="dib">
+                <svg class="icon svg-icon" aria-hidden="true">
+                  <use xlink:href="#icon-half-right"></use>
+                </svg>
+                <div class="name">半对</div>
+                <div class="code-name">#icon-half-right</div>
+            </li>
+          
             <li class="dib">
                 <svg class="icon svg-icon" aria-hidden="true">
                   <use xlink:href="#icon-complete"></use>

File diff suppressed because it is too large
+ 10 - 6
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.css


二進制
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.eot


File diff suppressed because it is too large
+ 1 - 1
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.js


+ 7 - 0
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.json

@@ -5,6 +5,13 @@
   "css_prefix_text": "icon-",
   "description": "",
   "glyphs": [
+    {
+      "icon_id": "5831259",
+      "name": "半对",
+      "font_class": "half-right",
+      "unicode": "e640",
+      "unicode_decimal": 58944
+    },
     {
       "icon_id": "7674533",
       "name": "完成",

File diff suppressed because it is too large
+ 3 - 0
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.svg


二進制
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.ttf


二進制
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff


二進制
TEAMModelOS/ClientApp/src/assets/iconfont/iconfont.woff2


+ 12 - 4
TEAMModelOS/ClientApp/src/common/BaseCanvas.vue

@@ -66,12 +66,20 @@ export default {
     },
 
     watch:{
-        options:{
-            handler(){
-                this.init();
+        'options.writeWidth':{
+            handler(n){
+				this.context.lineWidth = n
+				this.config.writeWidth = n
             },
             deep: true
-        }
+        },
+		'options.writeColor':{
+		    handler(n){
+				this.context.strokeStyle = n
+				this.config.writeColor = n
+		    },
+		    deep: true
+		}
     },
 
     methods: {

+ 2 - 0
TEAMModelOS/ClientApp/src/common/BaseMyCanvas.vue

@@ -84,6 +84,7 @@ export default {
 		},
 		
 		onSelectWriteColor(val){
+			console.log(val)
 			this.options.writeColor = val
 			this.activeColor = val
 		},
@@ -93,6 +94,7 @@ export default {
 		},
 		
 		onSelectWriteWidth(val){
+			console.log(val)
 			this.options.writeWidth = val
 			this.activeDot = val
 		},

+ 5 - 9
TEAMModelOS/ClientApp/src/components/evaluation/ExerciseList.vue

@@ -278,17 +278,13 @@
 			// console.log('拿到已选',this.selQue)
 			this.selectList = this.selQue
 			
-			this.$EventBus.$off('onPaperItemChange')
-			this.$EventBus.$on('onPaperItemChange', data => {
-				this.selectList = data
-			})
+			// this.$EventBus.$off('onPaperItemChange')
+			// this.$EventBus.$on('onPaperItemChange', data => {
+			// 	console.log('EventBus',data)
+			// 	this.selectList = data
+			// })
 		},
 		computed: {
-			headers() {
-				let hd = {};
-				hd["Authorization"] = "Bearer " + localStorage.getItem("token");
-				return hd;
-			},
 			curScope() {
 				return this.filterOrigin === this.$store.state.userInfo.schoolCode ?
 					"school" :

+ 2 - 3
TEAMModelOS/ClientApp/src/utils/editorTools.js

@@ -297,11 +297,10 @@ export default {
 	
 			clickHandler() {
 				console.log(Modal)
-				Modal.props.fullscreen.default = true
-				Modal.props.footerHide.default = true
+				// Modal.props.fullscreen.default = true
 				Modal.info({
 					width:1300,
-					footerHide:true,
+					okText:'取消',
 					render: (h) => {
 						return h('div',{
 							style:{

+ 9 - 0
TEAMModelOS/ClientApp/src/utils/evTools.js

@@ -239,6 +239,7 @@ export default {
 							itemJson.exercise.id = itemJson.id 
 							itemJson.exercise.pid = itemJson.pid 
 							itemJson.exercise.score = item.scoring ? item.scoring.score : 0,
+							console.log(this.getImgSrc(itemJson.exercise.question))
 							resolve(itemJson.exercise)
 						}))
 					})
@@ -340,4 +341,12 @@ export default {
 		var r = /<[^>]*>|/g;
 		return html.replace(r, '')
 	},
+	
+	getImgSrc(richtext) {
+	    let imgList = [];
+	    richtext.replace(/<video [^>]*src=['"]([^'"]+)[^>]*>/g, (match, capture) => {
+	          imgList.push(capture);
+	    });
+	    return imgList;
+	}
 }

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

@@ -24,10 +24,6 @@
 		props: ['editInfo'],
 		data() {
 			return {
-				defaultConfig: {
-					uploadImgShowBase64: true,
-					menus: this.$tools.wangEditorMenu
-				},
 				stemContent: '',
 				stemEditor: null,
 				answerContent: '',

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

@@ -167,7 +167,7 @@
 			
 			/* 根据index获取对应选项字母的值 */
 			getOrderCode(index){
-				let wraps = Array.from(document.getElementsByClassName('option-order'))
+				let wraps = Array.from(this.$refs.optionRefs.getElementsByClassName('option-order'))
 				for(let i=0;i<wraps.length;i++){
 					let item = wraps[i]
 					if(+index === +item.dataset.index){
@@ -232,7 +232,7 @@
 			/* 保存试题 获取最新选项数据 */
 			doSave() {
 				// 拿到当前还剩的选项DOM
-				let wraps = Array.from(document.getElementsByClassName('option-editor'))
+				let wraps = Array.from(this.$refs.optionRefs.getElementsByClassName('option-editor'))
 				let arr = []
 				wraps.forEach((item, index) => {
 					// 遍历选项 找到对应的 Editor 然后获取编辑器里面的内容

+ 3 - 3
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSingle.vue

@@ -138,7 +138,7 @@
 			/* 设置正确答案 */
 			settingAnswer(index) {
 				this.optionTrueIndex = index
-				let wraps = Array.from(document.getElementsByClassName('option-order'))
+				let wraps = Array.from(this.$refs.optionRefs.getElementsByClassName('option-order'))
 				for (let i = 0; i < wraps.length; i++) {
 					let item = wraps[i]
 					if (+index === +item.dataset.index) {
@@ -197,7 +197,7 @@
 			/* 保存试题 获取最新选项数据 */
 			doSave() {
 				// 拿到当前还剩的选项DOM
-				let wraps = Array.from(document.getElementsByClassName('option-editor'))
+				let wraps = Array.from(this.$refs.optionRefs.getElementsByClassName('option-editor'))
 				let arr = []
 				console.log(wraps)
 				wraps.forEach((item, index) => {
@@ -241,7 +241,7 @@
 			stemEditor.config.uploadImgShowBase64 = true;
 			this.$editorTools.addVideoUpload(this, stemEditor)
 			this.$editorTools.addAudio(this, stemEditor)
-			// this.$editorTools.addCanvas(this, stemEditor)
+			this.$editorTools.addCanvas(this, stemEditor)
 			this.$editorTools.initMyEditor(stemEditor)
 
 			stemEditor.create()

+ 0 - 4
TEAMModelOS/ClientApp/src/view/evaluation/types/BaseSubjective.vue

@@ -24,10 +24,6 @@
 		props: ['editInfo'],
 		data() {
 			return {
-				defaultConfig: {
-					uploadImgShowBase64: true,
-					menus: this.$tools.wangEditorMenu
-				},
 				stemContent: '',
 				stemEditor: null,
 				answerContent: '',

+ 12 - 3
TEAMModelOS/ClientApp/src/view/learnactivity/AutoCreateNew.vue

@@ -21,7 +21,7 @@
 			<div class="filter-wrap-item" v-if="includeSchool">
 				<span class="filter-title">选择学段 : </span>
 				<div class="filter-content">
-					<Select v-model="periodCode">
+					<Select v-model="periodCode" @on-change="onPeriodChange">
 						<Option v-for="item in periodList" :value="item.id" :key="item.id">{{ item.name }}</Option>
 					</Select>
 				</div>
@@ -160,11 +160,20 @@
 					});
 				})
 			},
+			
+			/* 学段切换 */
+			onPeriodChange(val){
+				let curPeriod = this.periodList.filter(i => i.id === val)[0]
+				this.subjectList = curPeriod.subjects
+				this.subjectCode = this.subjectList.length ? this.subjectList[0].id : ''
+			},
 
 			/* 开始组题 */
 			doAutoCreate() {
-				console.log(this.quInfos)
-				console.log(this.filterOrigin)
+				if(this.quInfos.map(i => i.count).filter(j => j === null).length){
+					this.$Message.warning('题目数量不能为空!')
+					return
+				}
 				this.isLoading = true
 				let params = []
 				let copyInfos = JSON.parse(JSON.stringify(this.quInfos))

+ 35 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.less

@@ -217,4 +217,39 @@
     margin-left: 2px;
     border-radius: 5px;
     font-size:12px;
+}
+.overview-box{
+    width: 100%;
+    // min-height: 400px;
+    padding: 10px 20px 10px 10px;
+    display: flex;
+    justify-content: space-between;
+    background: #404040;
+    // margin-top: 5px;
+    .count-box{
+        width: 120px;
+        height: fit-content;
+        text-align: center;
+        background: #404040;
+        padding: 10px 0px;
+        .count-icon{
+            color: white;
+            font-size: 18px;
+            margin-right: 5px;
+            vertical-align: sub;
+            // display: block;
+        }
+        .count-subject-text{
+            display: block;
+            color: white;
+            font-size: 12px;
+        }
+        .count-subject-num{
+            display: block;
+            color: white;
+            font-size: 35px;
+            font-weight: 800;
+        }
+    }
+    
 }

+ 49 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/ManageEvaluation.vue

@@ -73,6 +73,52 @@
                 </div>
                 <!-- 试卷评测打分 -->
                 <div :class="curBarIndex == 0 ? 'animated fadeIn evaluation-base-info':'evaluation-base-info animated fadeOutRight'" v-show="curBarIndex == 0">
+                    <div class="overview-box" style="display:none;">
+                        <div class="count-box">
+                            <span class="count-subject-num">1</span>
+                            <span class="count-subject-text">
+                                <Icon custom="iconfont icon-kecheng" class="count-icon" size="14" style="vertical-align: text-top;" />
+                                学科
+                            </span>
+                        </div>
+                        <div class="count-box">
+                            <span class="count-subject-num">2</span>
+                            <span class="count-subject-text">
+                                <Icon custom="iconfont icon-schedule" class="count-icon" size="14" style="vertical-align: text-top;" />
+                                年级
+                            </span>
+
+                        </div>
+                        <div class="count-box">
+                            <span class="count-subject-num">5</span>
+                            <span class="count-subject-text">
+                                <Icon custom="iconfont icon-class-self" class="count-icon" />
+                                班级
+                            </span>
+
+                        </div>
+                        <div class="count-box">
+                            <span class="count-subject-num">752</span>
+                            <span class="count-subject-text">
+                                <Icon type="ios-people" class="count-icon" />
+                                人数
+                            </span>
+                        </div>
+                        <div class="count-box">
+                            <span class="count-subject-num">602</span>
+                            <span class="count-subject-text">
+                                <Icon type="ios-paper" class="count-icon" />
+                                已作答
+                            </span>
+                        </div>
+                        <div class="count-box">
+                            <span class="count-subject-num">600</span>
+                            <span class="count-subject-text">
+                                <Icon type="md-star" class="count-icon" />
+                                已评分
+                            </span>
+                        </div>
+                    </div>
                     <Scoring :examInfo="examDetaiInfo"></Scoring>
                 </div>
                 <Loading :top="200" type="1" style="text-align:center" v-show="isLoading"></Loading>
@@ -264,6 +310,9 @@ export default {
             this.$api.learnActivity.FindExamInfo(requestData).then(
                 res => {
                     if (res.error == null) {
+                        res.examInfo = res.examInfo.sort((a, b) => {
+                            return a.createTime - b.createTime > 0 ? -1 : 1
+                        })
                         this.evaluationList = res.examInfo
                         this.filterByPeriod()
                         //如果当前学段没有评测则自动切换下一个学段

+ 7 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/ManualCreate.vue

@@ -103,7 +103,7 @@
             </div>
             <div class="question-list-wrap">
                 <!-- <Loading :top="100" v-show="isLoading"></Loading> -->
-                <ExerciseList :selQue="selQue" :propsList="questionList" @pageScroll="doScroll"
+                <ExerciseList ref="exList" :selQue="selQue" :propsList="questionList" @pageScroll="doScroll"
 				 @on-question-change="selectQuestion"></ExerciseList>
                 <EmptyData style="margin-top:120px;" v-if="!isLoading && questionList.length == 0" textContent="没有查询到题目"></EmptyData>
                 <!-- <div class="page-wrap">
@@ -375,7 +375,13 @@
 			
 			this.$EventBus.$off('onPaperItemChange')
 		    this.$EventBus.$on('onPaperItemChange', data => {
+				console.log('eventBus', data)
 		        this.shoppingQuestionList = JSON.parse(JSON.stringify(data))
+				this.$nextTick(() => {
+					if(this.$refs.exList){
+						this.$refs.exList.selectList = JSON.parse(JSON.stringify(data))
+					}
+				})
 		        let groupResult = this.$jsFn.groupBy(data, 'type')
 		        this.groupList = { ...this.groupQuestion }
 		        for (let i = 0; i < groupResult.length; i++) {

+ 6 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/PaperScore.vue

@@ -87,6 +87,9 @@
                                     <p class="answer-title">
                                         <span v-show="!showQu" class="item-question-order">题号 {{ index + 1 }} .</span>
                                         【学 生 作 答】
+                                        <Icon type="md-checkmark" v-if="studentAnswer.scores[typeIndex + index] == item.score" />
+                                        <Icon type="md-close" color="#ed4014" v-else-if="studentAnswer.scores[typeIndex + index] == 0" />
+                                        <Icon custom="iconfont icon-half-right" color="#ff9900" v-else-if="studentAnswer.scores[typeIndex + index] != -1" />
                                     </p>
                                     <!--学生作答答案显示区域-->
                                     <div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">
@@ -202,6 +205,9 @@
                                         <p class="answer-title">
                                             <span class="child-item-question-order" v-show="!showQu">【题号 {{(index + 1)+'-'+ (childIndex + 1) }}】</span>
                                             【学 生 作 答】
+                                            <Icon type="md-checkmark" v-if="studentAnswer.scores[typeIndex + index + childIndex] == childItem.score" />
+                                            <Icon type="md-close" color="#ed4014" v-else-if="studentAnswer.scores[typeIndex + index + childIndex] == 0" />
+                                            <Icon custom="iconfont icon-half-right" color="#ff9900" v-else-if="studentAnswer.scores[typeIndex + index + childIndex] != -1" />
                                         </p>
                                         <!--学生作答答案显示区域-->
                                         <div class="stu-answer-box item-explain-details" v-if="studentAnswer.answers && studentAnswer.answers.length">

+ 29 - 6
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue

@@ -13,8 +13,8 @@
             <Select filterable v-model="chooseClass" class="filter-select" style="width:140px;" @on-change="getClassStudent" size="small">
                 <Option v-for="(item,index) in classList" v-show="item.gradeId == chooseGrade" :value="item.id" :key="index">{{ item.name }}</Option>
             </Select>
-            <span style="margin-left:5px">学生:</span>
-            <Select filterable v-model="chooseStudent.id" label-in-value class="filter-select" style="width:140px;" size="small" clearable @on-change="setStuInfo">
+            <span style="margin-left:5px" v-show="showTest">学生:</span>
+            <Select filterable v-model="chooseStudent.id" label-in-value class="filter-select" style="width:140px;" size="small" clearable @on-change="setStuInfo" v-show="showTest">
                 <Option v-for="(item,index) in students" :value="item.id" :key="index">
                     <span class="select-status-tag" :style="{'background':item.status == 1 ? '#ed4014' : item.status == 2 ? '#ff9900' : '#19be6b'}"></span>
                     {{ item.name }}
@@ -113,8 +113,31 @@ export default {
         };
     },
     methods: {
-        getNextStu(){
-            
+        getNextStu() {
+            console.log('批改下一位学生')
+            console.log(this.paperInfo)
+            let flag = false
+            for (let index in this.paperInfo[this.chooseClass].studentScores) {
+                if (this.paperInfo[this.chooseClass].studentScores[index].indexOf(-1) >= 0) {
+                    if (this.paperInfo[this.chooseClass].studentAnswers[index].length) {
+                        flag = true
+                        this.chooseStudent.id = this.paperInfo[this.chooseClass].studentIds[index]
+                        let curStu = students.find(item => {
+                            return item.id == this.chooseStudent.id
+                        })
+                        if (curStu) this.chooseStudent.name = curStu.name
+                        this.chooseStudent.answers = this.paperInfo[this.chooseClass].studentAnswers[index]
+                        this.chooseStudent.scores = this.paperInfo[this.chooseClass].studentScores[index]
+                        this.chooseStudent.classId = this.chooseClass
+                        this.chooseStudent.status = false
+                        break
+                    }
+                }
+            }
+            if(!flag){
+                this.showTest = false
+                this.$Message.warning('已完成所有学生作答的评分!')
+            }
         },
         //学生未作答提示
         noAnswer() {
@@ -390,14 +413,14 @@ export default {
 </style>
 <style lang="less">
 .scoring-main-wrap .ivu-table-fixed-body {
-    background: #353535;
+    background: #2B2B2E;
 }
 .scoring-main-wrap .ivu-table-fixed-right::before,
 .scoring-main-wrap .ivu-table-fixed::before {
     display: none;
 }
 .scoring-main-wrap .ivu-table-fixed-header thead tr th {
-    background: #404040;
+    background: #2B2B2E;
     border-color: #606060;
     color: white;
 }

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

@@ -201,7 +201,7 @@ namespace TEAMModelOS.Controllers
                 //var id = jwt.Payload.Sub;
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamInfo> examInfo = new List<ExamInfo>();
-                var query = $"select c.id,c.name,c.code,c.period,c.startTime,c.stuCount,c.type,c.progress,c.examType from c ";
+                var query = $"select c.id,c.name,c.code,c.period,c.startTime,c.stuCount,c.type,c.progress,c.examType,c.createTime from c ";
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{school_code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);

+ 3 - 0
TEAMModelOS/Controllers/Common/VoteController.cs

@@ -150,6 +150,9 @@ namespace TEAMModelOS.Controllers.Learn
         /// <summary>
         /// 查询投票活动,用于学生可以投票的列表
         /// </summary>
+        /// <json>
+        /// 
+        /// </json>
         /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]

+ 1 - 1
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.1.4" />
+    <PackageReference Include="HTEXLib" Version="2.1.5" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.6" />
       <PackageReference Include="VueCliMiddleware" Version="3.1.2" />  </ItemGroup>
   <PropertyGroup>