|
@@ -3147,12 +3147,12 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<(string id, string name, SDK.Models.Custom eType, string scope, string owner, long ctime, List<PaperSimple> points, List<ExamSubject> subject)> exam = new();
|
|
|
+ List<(string id, string name, SDK.Models.Custom eType, string scope, string owner, long ctime, List<PaperSimple> points, List<ExamSubject> subject,string source)> exam = new();
|
|
|
if (eIds.Count == 0) {
|
|
|
return Ok(new {code = 404});
|
|
|
}
|
|
|
await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(
|
|
|
- queryText: $"select c.id,c.name,c.examType,c.scope,c.owner,c.createTime,c.papers ,c.subjects from c where c.id in ({string.Join(",", eIds.Select(o => $"'{o}'"))})"))
|
|
|
+ queryText: $"select c.id,c.name,c.examType,c.scope,c.owner,c.createTime,c.papers ,c.subjects,c.source from c where c.id in ({string.Join(",", eIds.Select(o => $"'{o}'"))})"))
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
@@ -3177,7 +3177,7 @@ namespace TEAMModelOS.Controllers
|
|
|
subs = subject.ToObject<List<ExamSubject>>();
|
|
|
}
|
|
|
exam.Add((account.GetProperty("id").GetString(), account.GetProperty("name").GetString(), eType, account.GetProperty("scope").GetString(),
|
|
|
- account.GetProperty("owner").GetString(), account.GetProperty("createTime").GetInt64(), ps, subs));
|
|
|
+ account.GetProperty("owner").GetString(), account.GetProperty("createTime").GetInt64(), ps, subs, account.GetProperty("source").GetString()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3190,6 +3190,7 @@ namespace TEAMModelOS.Controllers
|
|
|
classId = x.cId,
|
|
|
cname = x.cname,
|
|
|
studentIds = x.sIds,
|
|
|
+ source = exam.Where(e => e.id.Equals(x.eId)).FirstOrDefault().source,
|
|
|
owner = exam.Where(e => e.id.Equals(x.eId)).FirstOrDefault().owner,
|
|
|
createTime = exam.Where(e => e.id.Equals(x.eId)).FirstOrDefault().ctime,
|
|
|
subject = exam.Where(e => e.id.Equals(x.eId)).FirstOrDefault().subject,
|
|
@@ -3206,7 +3207,10 @@ namespace TEAMModelOS.Controllers
|
|
|
studentId = stuId.GetString(),
|
|
|
x.owner,
|
|
|
x.createTime,
|
|
|
- point = x.papers.ToList()[x.subject.Select(s => s.id).ToList().IndexOf(x.owner.Equals("teacher") ? soc : sub)].point.Sum(),
|
|
|
+ x.eType,
|
|
|
+ x.source,
|
|
|
+ point = x.papers.Select(p => p.point),
|
|
|
+ x.subject,
|
|
|
sum = x.sum.ToList()[x.studentIds.IndexOf(stuId.GetString())]
|
|
|
});
|
|
|
return Ok(new { info });
|
|
@@ -3220,7 +3224,10 @@ namespace TEAMModelOS.Controllers
|
|
|
x.studentIds,
|
|
|
x.owner,
|
|
|
x.createTime,
|
|
|
- point = x.papers.ToList()[x.subject.Select(s => s.id).ToList().IndexOf(x.owner.Equals("teacher") ? soc : sub)].point.Sum(),
|
|
|
+ x.eType,
|
|
|
+ x.source,
|
|
|
+ point = x.papers.Select(p => p.point),
|
|
|
+ x.subject,
|
|
|
x.sum
|
|
|
});
|
|
|
return Ok(new { info });
|