|
@@ -65,7 +65,7 @@ namespace TEAMModelFunction
|
|
|
|
|
|
//await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(exams[i], exams[i].id.ToString(), new Azure.Cosmos.PartitionKey($"{exams[i].code}"));
|
|
|
for (int j = 0;i< exams[i].subjects.Count;j++) {
|
|
|
- for (int k = 0; k < exams[i].targetClasseIds.Count; k++) {
|
|
|
+ for (int k = 0; k < exams[i].targetClassIds.Count; k++) {
|
|
|
ExamClassResult result = new ExamClassResult();
|
|
|
result.code = "ExamClassResult-" + exams[i].school;
|
|
|
result.examId = exams[i].id;
|
|
@@ -73,17 +73,17 @@ namespace TEAMModelFunction
|
|
|
result.subjectId = exams[i].subjects[j].id;
|
|
|
result.year = exams[i].year;
|
|
|
result.ttl = -1;
|
|
|
- result.info.id = exams[i].targetClasseIds[k];
|
|
|
- var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(exams[i].targetClasseIds[k], new Azure.Cosmos.PartitionKey($"Class-{exams[i].school}"));
|
|
|
+ result.info.id = exams[i].targetClassIds[k];
|
|
|
+ var sresponse = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(exams[i].targetClassIds[k], new Azure.Cosmos.PartitionKey($"Class-{exams[i].school}"));
|
|
|
if (sresponse.Status == 200)
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
|
|
|
Classroom classroom = json.ToObject<Classroom>();
|
|
|
result.info.name = classroom.name;
|
|
|
- List<string> ans = new List<string>();
|
|
|
+ List<List<string>> ans = new List<List<string>>();
|
|
|
List<double> ansPoint = new List<double>();
|
|
|
foreach (double p in exams[i].papers[j].point) {
|
|
|
- ans.Add("");
|
|
|
+ ans.Add(new List<string>());
|
|
|
ansPoint.Add(0);
|
|
|
}
|
|
|
foreach (StudentSimple stu in classroom.students) {
|