|
@@ -429,7 +429,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
int fno = 0;
|
|
|
try
|
|
|
{
|
|
|
- SetLearnRecordContent(info, data, _azureStorage, _azureCosmos);
|
|
|
+ //await SetLearnRecordContent(info, data, _azureStorage, _azureCosmos);
|
|
|
//用来判定是否完成评分
|
|
|
//bool isScore = true;
|
|
|
await resultStatus(client, examClassResults);
|
|
@@ -540,7 +540,7 @@ namespace TEAMModelOS.FunctionV4
|
|
|
|
|
|
await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ExamInfo>(info, info.id, new Azure.Cosmos.PartitionKey(info.code));
|
|
|
}
|
|
|
- //SetLearnRecordContent(info, data, _azureStorage);
|
|
|
+ await SetLearnRecordContent(info, data, _azureStorage, _azureCosmos);
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
@@ -641,13 +641,13 @@ namespace TEAMModelOS.FunctionV4
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Common).GetItemQueryIterator<StudentAnswers>(queryText: sbsql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{rootName}") }))
|
|
|
{
|
|
|
studentAnswersList.Add(item);
|
|
|
- stuListForSql.Union(item.studentIds);
|
|
|
+ stuListForSql = stuListForSql.Union(item.studentIds).ToList();
|
|
|
}
|
|
|
//取得學校的學生名單
|
|
|
if(!string.IsNullOrWhiteSpace(info.school))
|
|
|
{
|
|
|
- StringBuilder stusql = new StringBuilder($" SELECT c.id FROM c WHERE c.pk = 'Base' AND ARRAY_CONTAINS({System.Text.Json.JsonSerializer.Serialize(stuListForSql)}, c.id)");
|
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryIterator<string>(queryText: stusql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{info.school}") }))
|
|
|
+ StringBuilder stusql = new StringBuilder($"SELECT VALUE c.id FROM c WHERE c.pk = 'Base' AND ARRAY_CONTAINS({System.Text.Json.JsonSerializer.Serialize(stuListForSql)}, c.id)");
|
|
|
+ await foreach (string item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryIterator<string>(queryText: stusql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{info.school}") }))
|
|
|
{
|
|
|
stuDic[info.school].Add(item);
|
|
|
}
|