|
@@ -865,7 +865,7 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
}
|
|
|
//取得有作答的評測班級
|
|
|
Dictionary<string, List<string>> examClassFinDic = new Dictionary<string, List<string>>();
|
|
|
- await foreach (var exam in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(queryText: $"SELECT c.examId, c.info.id as classId FROM c WHERE ARRAY_CONTAINS({JsonSerializer.Serialize(examIdList)}, c.examId) AND c.progress=true", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school_code}") }))
|
|
|
+ await foreach (var exam in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(queryText: $"SELECT c.examId, c.info.id as classId FROM c WHERE ARRAY_CONTAINS({JsonSerializer.Serialize(examIdList)}, c.examId) AND c.progress=true", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school_code}") }))
|
|
|
{
|
|
|
var jsonecr = await JsonDocument.ParseAsync(exam.ContentStream);
|
|
|
if (jsonecr.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
@@ -874,9 +874,12 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
{
|
|
|
string examId = obj.GetProperty("examId").ToString();
|
|
|
string classId = obj.GetProperty("classId").ToString();
|
|
|
- if (examClassFinDic.ContainsKey(examId) && !examClassFinDic[examId].Contains(classId))
|
|
|
+ if (examClassFinDic.ContainsKey(examId))
|
|
|
{
|
|
|
- examClassFinDic[examId].Add(classId);
|
|
|
+ if(!examClassFinDic[examId].Contains(classId))
|
|
|
+ {
|
|
|
+ examClassFinDic[examId].Add(classId);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1987,6 +1990,12 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
public string id { get; set; }
|
|
|
public string name { get; set; }
|
|
|
}
|
|
|
+ //get-school-info輸出 exams.finishClassesSub(各班級已完成評測的科目列表)
|
|
|
+ private class GetSchInfoExamFinishClassesSub
|
|
|
+ {
|
|
|
+ public string classId { get; set; }
|
|
|
+ public List<string> subjectIds { get; set; }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|