|
@@ -1512,7 +1512,7 @@ namespace TEAMModelOS.Controllers
|
|
|
if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
|
|
|
if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
|
|
|
- if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
|
|
|
+ //if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
|
|
|
if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
var redisClient = _azureRedis.GetRedisClient(8);
|
|
@@ -1520,7 +1520,7 @@ namespace TEAMModelOS.Controllers
|
|
|
List<ExamClassResult> classResults = new();
|
|
|
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>(
|
|
|
- queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.type = {type} and array_contains(c.tIds,'{tId}') ",
|
|
|
+ queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and array_contains(c.tIds,'{tId}') ",
|
|
|
requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Scoring-{code}") }))
|
|
|
{
|
|
|
attr.Add(item);
|
|
@@ -1557,11 +1557,22 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
}
|
|
|
List<dynamic> objs = new List<dynamic>();
|
|
|
- if (type.GetInt32() != 1) {
|
|
|
+ /*if (type.GetInt32() != 1) {
|
|
|
return Ok(new { attr, paper = info.papers[index].blob });
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ List<SDK.Models.Cosmos.Common.Scoring> errs = new();
|
|
|
+ List<SDK.Models.Cosmos.Common.Scoring> arbs = new();
|
|
|
foreach (SDK.Models.Cosmos.Common.Scoring ss in attr)
|
|
|
{
|
|
|
+ List<Qs> qs = ss.qs.Where(s => !string.IsNullOrEmpty(s.err)).ToList();
|
|
|
+ if (qs.Count > 0) {
|
|
|
+ errs.Add(ss);
|
|
|
+ }
|
|
|
+ List<Item> arb = ss.items.Where(s => s.flag == false).ToList();
|
|
|
+ if (arb.Count > 0)
|
|
|
+ {
|
|
|
+ arbs.Add(ss);
|
|
|
+ }
|
|
|
//var obj = new { stuId = ss.stuId, examId = ss.examId, subjectId = ss.subjectId, };
|
|
|
//ss.items.Add(ss.items.Where(x => x.scores.))
|
|
|
//var scc = ss.items.SelectMany(p => p.scores, (p, d) => new { p.ssc, d.sc, d.tmdId }).Where(x => x.tmdId.Equals(tId.GetString())).Select(m => new { m.sc ,m.ssc});
|
|
@@ -1586,7 +1597,7 @@ namespace TEAMModelOS.Controllers
|
|
|
var obj = new { ss.stuId, ss.examId, ss.subjectId, item = sc, ss.blob, ss.tIds, ss.marks, ss.scores, ss.model, ss.mode };
|
|
|
objs.Add(obj);
|
|
|
}
|
|
|
- return Ok(new { objs, paper = info.papers[index].blob });
|
|
|
+ return Ok(new { errs, arbs, objs, paper = info.papers[index].blob });
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|