|
@@ -106,7 +106,11 @@ namespace TEAMModelOS.FunctionV4
|
|
|
List<ChangeRecord> records = await table.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", data.id }, { "PartitionKey", PartitionKey } });
|
|
|
//处理科目信息
|
|
|
List<string> sub = new List<string>();
|
|
|
- School sc = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(info.school, new Azure.Cosmos.PartitionKey("Base"));
|
|
|
+ School sc = new();
|
|
|
+ if (!string.IsNullOrEmpty(info.school)) {
|
|
|
+ sc = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>(info.school, new Azure.Cosmos.PartitionKey("Base"));
|
|
|
+ }
|
|
|
+
|
|
|
foreach (ExamSubject subject in info.subjects)
|
|
|
{
|
|
|
sub.Add(subject.id);
|
|
@@ -358,7 +362,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
{
|
|
|
newStatus = 1;
|
|
|
}
|
|
|
- Settlement settlement = await getMore(client, info, examClassResults);
|
|
|
+ Settlement settlement = await getMore(client, info);
|
|
|
long nowTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
//判断评分状态是否发生变化,便于实时的更新评测基本信息
|
|
|
if (info.average != settlement.score || info.sStatus != newStatus)
|
|
@@ -417,19 +421,20 @@ namespace TEAMModelOS.FunctionV4
|
|
|
//用来判定是否完成评分
|
|
|
//bool isScore = true;
|
|
|
await resultStatus(client, examClassResults);
|
|
|
- Settlement settlement = await getMore(client, info, examClassResults);
|
|
|
- var isScore = examClassResults.SelectMany(e => e.studentScores).ToList().Exists(c => c.Contains(-1));
|
|
|
- int newStatus = 0;
|
|
|
- if (!isScore)
|
|
|
- {
|
|
|
- newStatus = 1;
|
|
|
- }
|
|
|
+
|
|
|
await Activity(_coreAPIHttpService, info, classes, client, _dingDing, sub, examClassResults);
|
|
|
foreach (ExamSubject subject in info.subjects)
|
|
|
{
|
|
|
await createClassResultAsync(info, examClassResults, subject, fno, _azureCosmos, _dingDing, _azureStorage, _httpClient, _configuration);
|
|
|
fno++;
|
|
|
}
|
|
|
+ Settlement settlement = await getMore(client, info);
|
|
|
+ var isScore = examClassResults.SelectMany(e => e.studentScores).ToList().Exists(c => c.Contains(-1));
|
|
|
+ int newStatus = 0;
|
|
|
+ if (!isScore)
|
|
|
+ {
|
|
|
+ newStatus = 1;
|
|
|
+ }
|
|
|
//判断均分是否发生变化,便于实时的更新评测基本信息
|
|
|
if (info.sRate != settlement.rate || info.average != settlement.score || info.sStatus != newStatus || info.qRate != settlement.qrate)
|
|
|
{
|
|
@@ -637,7 +642,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
await Task.WhenAll(tasks);
|
|
|
}
|
|
|
- public static async Task<Settlement> getMore(CosmosClient client, ExamInfo info, List<ExamClassResult> examClassResults)
|
|
|
+ public static async Task<Settlement> getMore(CosmosClient client, ExamInfo info)
|
|
|
{
|
|
|
//计算单次考试简易统计信息
|
|
|
Settlement settlement = new();
|