|
@@ -1867,7 +1867,7 @@ namespace TEAMModelOS.Controllers
|
|
//if (!requert.TryGetProperty("mark", out JsonElement mark)) return BadRequest();
|
|
//if (!requert.TryGetProperty("mark", out JsonElement mark)) return BadRequest();
|
|
//requert.TryGetProperty("mark", out JsonElement mark);
|
|
//requert.TryGetProperty("mark", out JsonElement mark);
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
- var redisClient = _azureRedis.GetRedisClient(8);
|
|
|
|
|
|
+ //var redisClient = _azureRedis.GetRedisClient(8);
|
|
List<ExamClassResult> classResults = new();
|
|
List<ExamClassResult> classResults = new();
|
|
List<SDK.Models.Cosmos.Common.Scoring> attr = new();
|
|
List<SDK.Models.Cosmos.Common.Scoring> attr = new();
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
|
|
@@ -2035,6 +2035,8 @@ namespace TEAMModelOS.Controllers
|
|
//判定是否仲裁卷
|
|
//判定是否仲裁卷
|
|
if (!item.flag)
|
|
if (!item.flag)
|
|
{
|
|
{
|
|
|
|
+ scoring.type = 3;
|
|
|
|
+ await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(scoring, scoring.id, new PartitionKey(scoring.code));
|
|
return Ok(new { msg = "试题分数差异过大" });
|
|
return Ok(new { msg = "试题分数差异过大" });
|
|
}
|
|
}
|
|
double sc = item.scores.Select(x => x.sc).ToList().Aggregate((i, j) => (i + j) / item.scores.Count);
|
|
double sc = item.scores.Select(x => x.sc).ToList().Aggregate((i, j) => (i + j) / item.scores.Count);
|
|
@@ -2062,6 +2064,53 @@ namespace TEAMModelOS.Controllers
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //查询阅卷类型数据
|
|
|
|
+ [ProducesDefaultResponseType]
|
|
|
|
+ //[AuthToken(Roles = "Student")]
|
|
|
|
+ [HttpPost("find-scoring")]
|
|
|
|
+ public async Task<IActionResult> findScoring(JsonElement requert)
|
|
|
|
+ {
|
|
|
|
+ if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
|
|
|
|
+ if (!requert.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
|
|
|
|
+ if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
|
|
|
|
+ if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
|
|
|
|
+ if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
|
|
|
|
+ if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
|
+ var client = _azureCosmos.GetCosmosClient();
|
|
|
|
+ List<SDK.Models.Cosmos.Common.Scoring> attr = new();
|
|
|
|
+ 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.stuId = '{sId}' and c.type = '{type}' and array_contains(c.tIds,'{tId}') ",
|
|
|
|
+ requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Scoring-{code}") }))
|
|
|
|
+ {
|
|
|
|
+ attr.Add(item);
|
|
|
|
+ }
|
|
|
|
+ return Ok(attr);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //查询阅卷类型数据
|
|
|
|
+ [ProducesDefaultResponseType]
|
|
|
|
+ //[AuthToken(Roles = "Student")]
|
|
|
|
+ [HttpPost("save-err")]
|
|
|
|
+ public async Task<IActionResult> saveErr(JsonElement requert)
|
|
|
|
+ {
|
|
|
|
+ if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
|
|
|
|
+ if (!requert.TryGetProperty("err", out JsonElement err)) return BadRequest();
|
|
|
|
+ if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
|
+ var client = _azureCosmos.GetCosmosClient();
|
|
|
|
+ SDK.Models.Cosmos.Common.Scoring scoring = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<SDK.Models.Cosmos.Common.Scoring>(id.GetString(), new PartitionKey($"Scoring-{code}"));
|
|
|
|
+ if (null != scoring)
|
|
|
|
+ {
|
|
|
|
+ scoring.type = 2;
|
|
|
|
+ scoring.err = err.GetString();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ return Ok(new { code = 404 });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return Ok( new { code = 200 });
|
|
|
|
+ }
|
|
|
|
+
|
|
//阅卷信息统计
|
|
//阅卷信息统计
|
|
[ProducesDefaultResponseType]
|
|
[ProducesDefaultResponseType]
|
|
//[AuthToken(Roles = "Student")]
|
|
//[AuthToken(Roles = "Student")]
|