瀏覽代碼

后端——作答

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

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

@@ -629,7 +629,7 @@ namespace TEAMModelOS.Controllers
                 List<string> ids = new List<string>();
                 ids = classId.ToObject<List<string>>();
                 var client = _azureCosmos.GetCosmosClient();
-                ExamInfo info = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<ExamInfo>(id.GetString(), new PartitionKey($"Exam-{code}"));
+                ExamInfo info = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(id.GetString(), new PartitionKey($"{scode}"));
                 //确定当前学生所在班级且该班级参与该活动
                 List<string> cIds = new();
                 foreach (string cId in ids)
@@ -637,7 +637,7 @@ namespace TEAMModelOS.Controllers
                     List<string> stus = new List<string>();
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(
                     queryText: $"select c.classId as id from c where c.classId = '{cId}' and c.id = '{studentId}'",
-                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{info.school}") }))
+                    requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{info.school}") }))
                     {
                         using var json = await JsonDocument.ParseAsync(item.ContentStream);
                         if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)