|
@@ -1780,8 +1780,24 @@ namespace TEAMModelOS.Controllers
|
|
|
its.scores = its.scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
|
|
|
}*/
|
|
|
//List<double> sc = new List<double>();
|
|
|
- var scc = item.items.SelectMany(p => p.scores, (p, d) => new { p.ssc, d.sc, d.tmdId }).Where(x => x.tmdId.Equals(tId.GetString())).Select(m => new { m.sc, m.ssc });
|
|
|
- var obj = new { item.stuId, item.examId, item.subjectId, item = scc, item.blob, item.tIds, item.marks, item.scores, item.model, item.mode };
|
|
|
+ // var scc = item.items.SelectMany(p => p.scores, (p, d) => new { p.ssc, d.sc, d.tmdId }).Where(x => x.tmdId.Equals(tId.GetString())).Select(m => new { m.sc, m.ssc });
|
|
|
+ List<dynamic> sc = new List<dynamic>();
|
|
|
+ foreach (Item its in item.items)
|
|
|
+ {
|
|
|
+ List<double> ssc = its.scores.Where(x => x.tmdId.Equals(tId.GetString())).Select(c => c.sc).ToList();
|
|
|
+ //item.scores.Where(x => x.tmdId.Equals(tId.GetString())).SelectMany(p => p.sc, (p, d) => new { });
|
|
|
+ if (ssc.Count > 0)
|
|
|
+ {
|
|
|
+ sc.Add(new { sc = ssc.FirstOrDefault(), its.ssc });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sc.Add(new { sc = -1, its.ssc });
|
|
|
+ }
|
|
|
+ //sc.Add(item.scores.Where(x => x.tmdId.Equals(tId.GetString())).Select(c => c.sc).FirstOrDefault());
|
|
|
+ //item.scores = item.scores.Where(x => x.tmdId.Equals(tId.GetString())).ToList();
|
|
|
+ }
|
|
|
+ var obj = new { item.stuId, item.examId, item.subjectId, item = sc, item.blob, item.tIds, item.marks, item.scores, item.model, item.mode };
|
|
|
return Ok(obj);
|
|
|
}
|
|
|
|