|
@@ -1691,7 +1691,7 @@ namespace TEAMModelOS.Controllers
|
|
|
Random random = new Random();
|
|
|
SDK.Models.Cosmos.Common.Scoring item = new();
|
|
|
List<SDK.Models.Cosmos.Common.Scoring> notYet = new();
|
|
|
- notYet = all.Where(x => x.tIds.Count < x.marks.Count * x.modle - 1).ToList();
|
|
|
+ notYet = all.Where(x => x.tIds.Count < x.marks.Count * x.modle - 1).ToList();
|
|
|
if (notYet.Count > 0)
|
|
|
{
|
|
|
item = notYet[random.Next(notYet.Count)];
|
|
@@ -1842,32 +1842,37 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
foreach (SDK.Models.Cosmos.Common.Scoring scoring in attr)
|
|
|
{
|
|
|
- foreach (Item item in scoring.items) {
|
|
|
+ foreach (Item item in scoring.items)
|
|
|
+ {
|
|
|
bool flag = false;
|
|
|
int index = 0;
|
|
|
- if (item.scores.Count > 0) {
|
|
|
- foreach (Info info in item.scores) {
|
|
|
+ if (item.scores.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (Info info in item.scores)
|
|
|
+ {
|
|
|
if (!info.tmdId.Equals(tId.GetString()))
|
|
|
{
|
|
|
index++;
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
scoring.marks[index] = builder.ToString();
|
|
|
flag = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (flag) {
|
|
|
+ if (flag)
|
|
|
+ {
|
|
|
break;
|
|
|
}
|
|
|
- //List<Info> info = item.scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
|
|
|
+ //List<Info> info = item.scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
|
|
|
}
|
|
|
- /* int index = scoring.tIds.IndexOf(tId.GetString());
|
|
|
- if (index != -1)
|
|
|
- {
|
|
|
- scoring.marks[index] = builder.ToString();
|
|
|
- }*/
|
|
|
+ /* int index = scoring.tIds.IndexOf(tId.GetString());
|
|
|
+ if (index != -1)
|
|
|
+ {
|
|
|
+ scoring.marks[index] = builder.ToString();
|
|
|
+ }*/
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -1878,24 +1883,53 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
int itemIndex = 0;
|
|
|
//int tIdIndex = scoring.tIds.IndexOf(tId.GetString());
|
|
|
- foreach (Item item in scoring.items)
|
|
|
+ if (requert.TryGetProperty("qu", out JsonElement qu))
|
|
|
{
|
|
|
- List<Info> items = item.scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
|
|
|
- if (items.Count > 0)
|
|
|
+ List<int> nos = qu.ToObject<List<int>>();
|
|
|
+ foreach (int number in nos)
|
|
|
{
|
|
|
- foreach (Info info in items)
|
|
|
+ List<Info> items = scoring.items[number - 1].scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
|
|
|
+
|
|
|
+ if (items.Count > 0)
|
|
|
{
|
|
|
- info.sc = ssc[itemIndex];
|
|
|
+ foreach (Info info in items)
|
|
|
+ {
|
|
|
+ info.sc = ssc[number - 1];
|
|
|
+ }
|
|
|
}
|
|
|
+ else {
|
|
|
+ Info info = new();
|
|
|
+ info.sc = ssc[number - 1];
|
|
|
+ info.tmdId = tId.GetString();
|
|
|
+ info.index = number - 1;
|
|
|
+ scoring.items[number - 1].scores.Add(info);
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
- Info info = new();
|
|
|
- info.sc = ssc[itemIndex];
|
|
|
- info.tmdId = tId.GetString();
|
|
|
- info.index = itemIndex;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ foreach (Item item in scoring.items)
|
|
|
+ {
|
|
|
+ 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;
|
|
|
+ item.scores.Add(info);
|
|
|
+ }
|
|
|
+ itemIndex++;
|
|
|
}
|
|
|
- itemIndex++;
|
|
|
}
|
|
|
+
|
|
|
await client.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync(scoring, scoring.id, new PartitionKey(scoring.code));
|
|
|
|
|
|
}
|
|
@@ -1919,8 +1953,9 @@ 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) {
|
|
|
+ var ace = item.scores.Where(x => string.IsNullOrEmpty(x.tmdId)).ToList();
|
|
|
+ if (ace.Count > 0)
|
|
|
+ {
|
|
|
return Ok(new { code = 200 });
|
|
|
}
|
|
|
//判定是否仲裁卷
|