|
@@ -1829,7 +1829,7 @@ namespace TEAMModelOS.Controllers
|
|
|
value.RootElement.TryGetProperty("info", out JsonElement element);
|
|
|
List<tmdInfo> tmds = element.ToObject<List<tmdInfo>>();*/
|
|
|
List<double> ssc = score.ToObject<List<double>>();
|
|
|
- StringBuilder builder = new StringBuilder();
|
|
|
+ StringBuilder builder = new();
|
|
|
if (requert.TryGetProperty("mark", out JsonElement mark))
|
|
|
{
|
|
|
//存放老师批注信息到blob
|
|
@@ -1856,15 +1856,30 @@ namespace TEAMModelOS.Controllers
|
|
|
foreach (SDK.Models.Cosmos.Common.Scoring scoring in attr)
|
|
|
{
|
|
|
int itemIndex = 0;
|
|
|
- int tIdIndex = scoring.tIds.IndexOf(tId.GetString());
|
|
|
+ //int tIdIndex = scoring.tIds.IndexOf(tId.GetString());
|
|
|
foreach (Item item in scoring.items)
|
|
|
{
|
|
|
- if (tIdIndex > -1)
|
|
|
+ List<Info> items = item.scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
|
|
|
+ if (items.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (Info info in items)
|
|
|
+ {
|
|
|
+ info.sc = ssc[itemIndex];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Info info = new();
|
|
|
+ info.sc = ssc[itemIndex];
|
|
|
+ info.tmdId = tId.GetString();
|
|
|
+ info.index = itemIndex;
|
|
|
+ }
|
|
|
+ itemIndex++;
|
|
|
+ /*if (tIdIndex > -1)
|
|
|
{
|
|
|
item.scores[tIdIndex].sc = ssc[itemIndex];
|
|
|
item.scores[tIdIndex].tmdId = tId.GetString();
|
|
|
itemIndex++;
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
|
await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(scoring, scoring.id, new PartitionKey(scoring.code));
|
|
@@ -1874,6 +1889,7 @@ namespace TEAMModelOS.Controllers
|
|
|
//判定阅卷结算的条件
|
|
|
if (attr.Count == count.GetInt32())
|
|
|
{
|
|
|
+
|
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<ExamClassResult>(
|
|
|
queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}'",
|
|
|
requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{code}") }))
|
|
@@ -1889,10 +1905,14 @@ namespace TEAMModelOS.Controllers
|
|
|
int n = 0;
|
|
|
foreach (Item item in scoring.items)
|
|
|
{
|
|
|
+ var ace = item.scores.Where(x => string.IsNullOrEmpty(x.tmdId)).ToList();
|
|
|
+ if (ace.Count > 0) {
|
|
|
+ return Ok(new { code = 200 });
|
|
|
+ }
|
|
|
//判定是否仲裁卷
|
|
|
if (!item.flag)
|
|
|
{
|
|
|
- break;
|
|
|
+ return Ok(new { msg = "试题分数差异过大" });
|
|
|
}
|
|
|
double sc = item.scores.Select(x => x.sc).ToList().Aggregate((i, j) => (i + j) / item.scores.Count);
|
|
|
scoring.scores[n] = sc;
|