|
@@ -1450,6 +1450,61 @@ namespace TEAMModelOS.FunctionV4
|
|
|
urls.Add(ne["url"].ToString());
|
|
|
}
|
|
|
}
|
|
|
+ string code = string.Empty;
|
|
|
+ string pk = string.Empty;
|
|
|
+ string table = "School";
|
|
|
+ if (info.scope.Equals("school"))
|
|
|
+ {
|
|
|
+ code = $"ErrorItems-{info.school}";
|
|
|
+ pk = $"Item-{info.school}";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ code = "ErrorItems";
|
|
|
+ pk = $"Item-{info.creatorId}";
|
|
|
+ table = "Teacher";
|
|
|
+ }
|
|
|
+ // 获取整体的题目ID集合
|
|
|
+ /* List<string> ids = new();
|
|
|
+ List<(string id, string pid, int level, string type)> itemInfos = new();
|
|
|
+ foreach (string url in urls) {
|
|
|
+ string id = url.Replace(".json", "");
|
|
|
+ BlobDownloadResult index_item_json;
|
|
|
+ if (info.scope.Equals("school"))
|
|
|
+ {
|
|
|
+ index_item_json = await _azureStorage.GetBlobContainerClient($"{info.school}").GetBlobClient($"{info.papers[no].blob}/{url}").DownloadContentAsync();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ index_item_json = await _azureStorage.GetBlobContainerClient($"{info.creatorId}").GetBlobClient($"{info.papers[no].blob}/{url}").DownloadContentAsync();
|
|
|
+ }
|
|
|
+ JObject keys = JObject.Parse(index_item_json.Content.ToString());
|
|
|
+ string type = keys["exercise"].Value<string>("type");
|
|
|
+ int level = keys["exercise"].Value<int>("level");
|
|
|
+ string pid = keys.Value<string>("pid");
|
|
|
+ itemInfos.Add((id,pid,level,type));
|
|
|
+ }*/
|
|
|
+
|
|
|
+
|
|
|
+ /*await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, table).GetItemQueryStreamIterator(
|
|
|
+ queryText: $"select c.id,c.pid,c.level,c.type from c where c.id in ({string.Join(",", ids.Select(o => $"'{o}'"))})", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{pk}") }))
|
|
|
+ {
|
|
|
+ using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
+ if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
|
+ {
|
|
|
+ var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
|
|
|
+ while (accounts.MoveNext())
|
|
|
+ {
|
|
|
+ JsonElement account = accounts.Current;
|
|
|
+ string pid = "";
|
|
|
+ if (account.TryGetProperty("pid",out JsonElement element)) {
|
|
|
+ pid = element.GetString();
|
|
|
+ }
|
|
|
+ itemInfos.Add((account.GetProperty("id").GetString(), pid, account.GetProperty("level").GetInt32(), account.GetProperty("type").GetString()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
double[] point = StringHelper.ListTodouble(result.paper.point);
|
|
|
double[,] res = StringHelper.ListToDouble(result.studentScores);
|
|
|
var cdm = new ClouDASMatrix(res, point);
|
|
@@ -1457,12 +1512,13 @@ namespace TEAMModelOS.FunctionV4
|
|
|
var ss = cdm.StriveTopic;
|
|
|
int n = 0;
|
|
|
List<Task<ItemResponse<ErrorItems>>> task_error = new();
|
|
|
+
|
|
|
foreach (var sIds in result.studentIds)
|
|
|
{
|
|
|
ErrorItems error = new()
|
|
|
{
|
|
|
ttl = -1,
|
|
|
- code = "ErrorItems",
|
|
|
+ code = code,
|
|
|
id = Guid.NewGuid().ToString(),
|
|
|
stuId = sIds,
|
|
|
school = info.school,
|
|
@@ -1475,9 +1531,13 @@ namespace TEAMModelOS.FunctionV4
|
|
|
{
|
|
|
Items items = new()
|
|
|
{
|
|
|
- id = urls[item-1].Replace(".json", ""),
|
|
|
+ id = urls[item - 1].Replace(".json", ""),
|
|
|
blob = info.papers[no].blob
|
|
|
+
|
|
|
};
|
|
|
+ /* items.level = itemInfos.Where(c => c.id.Equals(items.id)).FirstOrDefault().level;
|
|
|
+ items.type = itemInfos.Where(c => c.id.Equals(items.id)).FirstOrDefault().type;
|
|
|
+ items.pId = itemInfos.Where(c => c.id.Equals(items.id)).FirstOrDefault().pid;*/
|
|
|
error.its.Add(items);
|
|
|
}
|
|
|
n++;
|