瀏覽代碼

调整异常和仲裁返回结果

liqk 3 年之前
父節點
當前提交
12eb13bcb8
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      TEAMModelOS/Controllers/Common/ExamController.cs

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

@@ -1512,6 +1512,7 @@ namespace TEAMModelOS.Controllers
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
                 if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
                 if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var client = _azureCosmos.GetCosmosClient();
                 var redisClient = _azureRedis.GetRedisClient(8);
                 var redisClient = _azureRedis.GetRedisClient(8);
@@ -1519,7 +1520,7 @@ namespace TEAMModelOS.Controllers
                 List<ExamClassResult> classResults = new();
                 List<ExamClassResult> classResults = new();
                 List<SDK.Models.Cosmos.Common.Scoring> attr = new List<SDK.Models.Cosmos.Common.Scoring>();
                 List<SDK.Models.Cosmos.Common.Scoring> attr = new List<SDK.Models.Cosmos.Common.Scoring>();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
-                                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and array_contains(c.tIds,'{tId}') ",
+                                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.type = {type} and array_contains(c.tIds,'{tId}') ",
                                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Scoring-{code}") }))
                                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Scoring-{code}") }))
                 {
                 {
                     attr.Add(item);
                     attr.Add(item);
@@ -1556,6 +1557,9 @@ namespace TEAMModelOS.Controllers
                     }
                     }
                 }
                 }
                 List<dynamic> objs = new List<dynamic>();
                 List<dynamic> objs = new List<dynamic>();
+                if (type.GetInt32() != 1) {
+                    return Ok(new { attr, paper = info.papers[index].blob });
+                }
                 foreach (SDK.Models.Cosmos.Common.Scoring ss in attr)
                 foreach (SDK.Models.Cosmos.Common.Scoring ss in attr)
                 {
                 {
                     //var obj = new { stuId = ss.stuId, examId = ss.examId, subjectId = ss.subjectId, };
                     //var obj = new { stuId = ss.stuId, examId = ss.examId, subjectId = ss.subjectId, };