|
@@ -459,7 +459,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
persent =
|
|
persent =
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) > 0 ?
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) > 0 ?
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.av) / blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) : 0
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.av) / blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) : 0
|
|
- }).Sum(o => o.persent), 4)
|
|
|
|
|
|
+ }).Sum(o => o.persent) / x.blocks.Count, 4)
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -528,46 +528,48 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
id = x.Key.classId,
|
|
id = x.Key.classId,
|
|
name = x.Key.className,
|
|
name = x.Key.className,
|
|
|
|
+ count = classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count,
|
|
max = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Max(s => Math.Abs((double)s)) : 0,
|
|
max = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Max(s => Math.Abs((double)s)) : 0,
|
|
min = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Min(s => Math.Abs((double)s)) : 0,
|
|
min = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Min(s => Math.Abs((double)s)) : 0,
|
|
- excellent = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 80).Count() * 1.0 / x.ToList().Count, 4) : 0,
|
|
|
|
- pass = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 60).Count() * 1.0 / x.ToList().Count, 4) : 0,
|
|
|
|
- score = x.ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / x.ToList().Count, 2) : 0,
|
|
|
|
- persent = x.ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / x.ToList().Count / key7.Value, 4) : 0,
|
|
|
|
|
|
+ excellent = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 80).Count() * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count, 4) : 0,
|
|
|
|
+ pass = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 60).Count() * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count, 4) : 0,
|
|
|
|
+ score = classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count, 2) : 0,
|
|
|
|
+ persent = classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count / key7.Value, 4) : 0,
|
|
kno = key5.Value.Where(c => c.cId.Equals(x.Key.classId)).Select(z => new
|
|
kno = key5.Value.Where(c => c.cId.Equals(x.Key.classId)).Select(z => new
|
|
{
|
|
{
|
|
z.name,
|
|
z.name,
|
|
- persent = Math.Round(z.point > 0 ? z.score / z.point / students.Count() : 0, 4),
|
|
|
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count : 0, 4),
|
|
block = knos.Where(v => null != v.kno && v.kno.Contains(z.name)).Select(x => x.name)
|
|
block = knos.Where(v => null != v.kno && v.kno.Contains(z.name)).Select(x => x.name)
|
|
}),
|
|
}),
|
|
block = claBlock.Count() > 0 ? claBlock.Where(c => c.Key.Equals(x.Key.classId))?.FirstOrDefault().block.Select(z => new
|
|
block = claBlock.Count() > 0 ? claBlock.Where(c => c.Key.Equals(x.Key.classId))?.FirstOrDefault().block.Select(z => new
|
|
{
|
|
{
|
|
name = z.Key,
|
|
name = z.Key,
|
|
- persent = Math.Round(z.point > 0 ? z.score / z.point / students.Count() : 0, 4)
|
|
|
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count : 0, 4)
|
|
}) : null,
|
|
}) : null,
|
|
dim = claDims.Where(c => c.claId.Equals(x.Key.classId)).Select(z => new
|
|
dim = claDims.Where(c => c.claId.Equals(x.Key.classId)).Select(z => new
|
|
{
|
|
{
|
|
name = z.dim,
|
|
name = z.dim,
|
|
- persent = Math.Round(z.point > 0 ? z.score / z.point / students.Count() : 0, 4)
|
|
|
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count : 0, 4)
|
|
}),
|
|
}),
|
|
examResults[0].classes.Where(c => c.id.Equals(x.Key.classId))?.FirstOrDefault().gradeId
|
|
examResults[0].classes.Where(c => c.id.Equals(x.Key.classId))?.FirstOrDefault().gradeId
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
//年级信息
|
|
//年级信息
|
|
|
|
+ var realCount = stus.Count - info.lostStu.Count;
|
|
var grades = students.GroupBy(c => c.gradeId).Select(x => new { gradeId = x.Key, list = x.ToList().Select(v => v.score).Where(c => c > 0) });
|
|
var grades = students.GroupBy(c => c.gradeId).Select(x => new { gradeId = x.Key, list = x.ToList().Select(v => v.score).Where(c => c > 0) });
|
|
var gscore = grades.Select(x => new
|
|
var gscore = grades.Select(x => new
|
|
{
|
|
{
|
|
id = x.gradeId,
|
|
id = x.gradeId,
|
|
name = perMore[int.Parse(x.gradeId)],
|
|
name = perMore[int.Parse(x.gradeId)],
|
|
- score = x.list.Any() ? Math.Round((double)(x.list.Sum() / x.list.Count()), 2) : 0,
|
|
|
|
- persent = x.list.Any() ? Math.Round((double)(x.list.Sum() / x.list.Count()) / key7.Value, 4) : 0,
|
|
|
|
|
|
+ score = x.list.Any() ? Math.Round((double)(x.list.Sum() / realCount), 2) : 0,
|
|
|
|
+ persent = x.list.Any() ? Math.Round((double)(x.list.Sum() / realCount) / key7.Value, 4) : 0,
|
|
max = x.list.Any() ? x.list.Max(s => Math.Abs((double)s)) : 0,
|
|
max = x.list.Any() ? x.list.Max(s => Math.Abs((double)s)) : 0,
|
|
min = x.list.Any() ? x.list.Min(s => Math.Abs((double)s)) : 0,
|
|
min = x.list.Any() ? x.list.Min(s => Math.Abs((double)s)) : 0,
|
|
- excellent = x.list.Any() ? Math.Round(x.list.Where(s => s >= 80).Count() * 1.0 / x.list.Count(), 4) : 0,
|
|
|
|
- pass = x.list.Any() ? Math.Round(x.list.Where(s => s >= 60).Count() * 1.0 / x.list.Count(), 4) : 0
|
|
|
|
|
|
+ excellent = x.list.Any() ? Math.Round(x.list.Where(s => s >= 80).Count() * 1.0 / realCount, 4) : 0,
|
|
|
|
+ pass = x.list.Any() ? Math.Round(x.list.Where(s => s >= 60).Count() * 1.0 / realCount, 4) : 0
|
|
});
|
|
});
|
|
//获奖次数
|
|
//获奖次数
|
|
List<ArtAttachment> artAttachments = new();
|
|
List<ArtAttachment> artAttachments = new();
|
|
@@ -599,7 +601,6 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
else {
|
|
else {
|
|
url = _azureStorage.GetBlobContainerClient($"{code}").GetBlobClient($"/art/{id}/{subjectId}.json").Uri.ToString();
|
|
url = _azureStorage.GetBlobContainerClient($"{code}").GetBlobClient($"/art/{id}/{subjectId}.json").Uri.ToString();
|
|
}*/
|
|
}*/
|
|
- var realCount = stus.Count - info.lostStu.Count;
|
|
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"ArtSchool:count:{code}", $"count:{subjectId}:{id}", tchList.Count.ToJsonString());
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"ArtSchool:count:{code}", $"count:{subjectId}:{id}", tchList.Count.ToJsonString());
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"ArtSchool:max:{code}", $"max:{subjectId}:{id}", max.ToJsonString());
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"ArtSchool:max:{code}", $"max:{subjectId}:{id}", max.ToJsonString());
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"ArtSchool:min:{code}", $"min:{subjectId}:{id}", min.ToJsonString());
|
|
await _azureRedis.GetRedisClient(8).HashSetAsync($"ArtSchool:min:{code}", $"min:{subjectId}:{id}", min.ToJsonString());
|
|
@@ -679,8 +680,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
[ProducesDefaultResponseType]
|
|
[HttpPost("oldStatistics")]
|
|
[HttpPost("oldStatistics")]
|
|
- [Authorize(Roles = "IES")]
|
|
|
|
- [AuthToken(Roles = "teacher,admin")]
|
|
|
|
|
|
+ //[Authorize(Roles = "IES")]
|
|
|
|
+ //[AuthToken(Roles = "teacher,admin")]
|
|
public async Task<IActionResult> getOldAnalysis(JsonElement request)
|
|
public async Task<IActionResult> getOldAnalysis(JsonElement request)
|
|
{
|
|
{
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
@@ -739,6 +740,16 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //获取本次评测所有科目结算结果
|
|
|
|
+ List<ExamResult> examResults = new();
|
|
|
|
+ List<ExamClassResult> classResults = [];
|
|
|
|
+ ExamInfo info = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(examId.ToString(), new PartitionKey($"Exam-{code}"));
|
|
|
|
+ var query = $"select value(c) from c where c.examId = '{examId}' and c.subjectId = '{subjectId}' ";
|
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIteratorSql<ExamClassResult>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{code}") }))
|
|
|
|
+ {
|
|
|
|
+ classResults.Add(item);
|
|
|
|
+ }
|
|
|
|
+ var realCount = stus.Count - info.lostStu.Count;
|
|
var subjectScore = new
|
|
var subjectScore = new
|
|
{
|
|
{
|
|
name = As.Where(a => a.subjectId.Equals(subjectId.GetString())).Select(x => x.score).Where(c => c > 0)
|
|
name = As.Where(a => a.subjectId.Equals(subjectId.GetString())).Select(x => x.score).Where(c => c > 0)
|
|
@@ -747,25 +758,17 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
double max = subjectScore.name.Max(s => Math.Abs(s));
|
|
double max = subjectScore.name.Max(s => Math.Abs(s));
|
|
double min = subjectScore.name.Min(s => Math.Abs(s));
|
|
double min = subjectScore.name.Min(s => Math.Abs(s));
|
|
double total = subjectScore.name.Sum();
|
|
double total = subjectScore.name.Sum();
|
|
- double average = Math.Round(total / stus.Count, 2);
|
|
|
|
- double excellent = Math.Round(subjectScore.name.Where(s => s >= 80).Count() * 1.0 / stus.Count, 4);
|
|
|
|
- double pass = Math.Round(subjectScore.name.Where(s => s >= 60).Count() * 1.0 / stus.Count, 4);
|
|
|
|
|
|
+ double average = Math.Round(total / realCount, 2);
|
|
|
|
+ double excellent = Math.Round(subjectScore.name.Where(s => s >= 80).Count() * 1.0 / realCount, 4);
|
|
|
|
+ double pass = Math.Round(subjectScore.name.Where(s => s >= 60).Count() * 1.0 / realCount, 4);
|
|
double powSum = 0;
|
|
double powSum = 0;
|
|
foreach (var sc in subjectScore.name)
|
|
foreach (var sc in subjectScore.name)
|
|
{
|
|
{
|
|
powSum += Math.Pow(sc - average, 2);
|
|
powSum += Math.Pow(sc - average, 2);
|
|
}
|
|
}
|
|
- var pow = Math.Round(stus.Count > 0 ? Math.Pow(powSum / stus.Count, 0.5) : 0, 2);
|
|
|
|
|
|
+ var pow = Math.Round(stus.Count > 0 ? Math.Pow(powSum / realCount, 0.5) : 0, 2);
|
|
|
|
|
|
- //获取本次评测所有科目结算结果
|
|
|
|
- List<ExamResult> examResults = new();
|
|
|
|
- List<ExamClassResult> classResults = [];
|
|
|
|
- ExamInfo info = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(examId.ToString(), new PartitionKey($"Exam-{code}"));
|
|
|
|
- var query = $"select value(c) from c where c.examId = '{examId}' and c.subjectId = '{subjectId}' ";
|
|
|
|
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIteratorSql<ExamClassResult>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{code}") }))
|
|
|
|
- {
|
|
|
|
- classResults.Add(item);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
(List<RMember> tchList, List<RGroupList> classLists) = await GroupListService.GetMemberByListids(_coreAPIHttpService, client, _dingDing, classIds, code.GetString(), null, -1, info.startTime);
|
|
(List<RMember> tchList, List<RGroupList> classLists) = await GroupListService.GetMemberByListids(_coreAPIHttpService, client, _dingDing, classIds, code.GetString(), null, -1, info.startTime);
|
|
//获取评测ID
|
|
//获取评测ID
|
|
//var examId = arts[0].settings.SelectMany(s => s.task).Where(a => a.type == 1 && a.subject.Equals(subjectId.GetString())).FirstOrDefault().acId;
|
|
//var examId = arts[0].settings.SelectMany(s => s.task).Where(a => a.type == 1 && a.subject.Equals(subjectId.GetString())).FirstOrDefault().acId;
|
|
@@ -920,7 +923,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
persent =
|
|
persent =
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) > 0 ?
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) > 0 ?
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.av) / blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) : 0
|
|
blockScore.Where(z => z.name.Equals(c)).Sum(v => v.av) / blockScore.Where(z => z.name.Equals(c)).Sum(v => v.score) : 0
|
|
- }).Sum(o => o.persent), 4)
|
|
|
|
|
|
+ }).Sum(o => o.persent) / x.blocks.Count , 4)
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -931,60 +934,51 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
block = knos.Where(v => null != v.kno && v.kno.Contains(x.name)).Select(x => x.name)
|
|
block = knos.Where(v => null != v.kno && v.kno.Contains(x.name)).Select(x => x.name)
|
|
});
|
|
});
|
|
//学生信息
|
|
//学生信息
|
|
- var students = stus.Select(s => new
|
|
|
|
|
|
+ List<(string id, double score, string name, string classId, string className, string gradeId, List<(string kname, double persent, List<string> blok)> kno,
|
|
|
|
+ List<(string kname, double persent)> block, List<(string kname, double persent)> dim)> stuAsync = [];
|
|
|
|
+ await foreach (var ss in stuTask(stus, tchList, examResults, subjectId.GetString(), key6, knos, stuBlockScore, stuDims))
|
|
{
|
|
{
|
|
- id = s.sIds,
|
|
|
|
- s.scs.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.subjectId) && x.subjectId.Equals(subjectId.GetString()))?.score,
|
|
|
|
- tchList.Where(t => t.id.Equals(s.sIds)).FirstOrDefault()?.name,
|
|
|
|
- classId = s.cd,
|
|
|
|
- className = examResults[0].classes.Where(c => c.id.Equals(s.cd)).FirstOrDefault()?.name,
|
|
|
|
- examResults[0].classes.Where(c => c.id.Equals(s.cd)).FirstOrDefault()?.gradeId,
|
|
|
|
- //key.Value.Where(c => c.id.Equals(s.sIds))?.FirstOrDefault().sta,
|
|
|
|
- //key.Value.Where(c => c.id.Equals(s.sIds))?.FirstOrDefault().pass,
|
|
|
|
- // key.Value.Where(c => c.id.Equals(s.sIds))?.FirstOrDefault().stu,
|
|
|
|
- kno = key6.Value.Where(c => c.sId.Equals(s.sIds))?.Select(z => new
|
|
|
|
- {
|
|
|
|
- z.name,
|
|
|
|
- persent = z.point > 0 ? Math.Round(z.score / z.point, 4) : 0,
|
|
|
|
- block = knos.Where(v => null != v.kno && v.kno.Contains(z.name))?.Select(x => x.name)
|
|
|
|
- }),
|
|
|
|
- block = stuBlock.Where(c => c.Key.Equals(s.sIds)).FirstOrDefault()?.block.Select(x => new
|
|
|
|
- {
|
|
|
|
- name = x.Key,
|
|
|
|
- persent = x.point > 0 ? Math.Round(x.score / x.point, 4) : 0
|
|
|
|
- }),
|
|
|
|
- dim = stuDims.Where(c => c.stuId.Equals(s.sIds))?.Select(z => new
|
|
|
|
- {
|
|
|
|
- name = z.dim,
|
|
|
|
- persent = z.point > 0 ? Math.Round(z.score / z.point, 4) : 0
|
|
|
|
- })
|
|
|
|
|
|
+ stuAsync = ss.students;
|
|
|
|
+ }
|
|
|
|
+ var students = stuAsync.Select(c => new {
|
|
|
|
+ c.id,
|
|
|
|
+ c.score,
|
|
|
|
+ c.name,
|
|
|
|
+ c.classId,
|
|
|
|
+ c.className,
|
|
|
|
+ c.gradeId,
|
|
|
|
+ kno = c.kno.Select(x => new { name = x.kname, x.persent, x.blok }),
|
|
|
|
+ block = c.block.Select(x => new { name = x.kname, x.persent }),
|
|
|
|
+ dim = c.dim.Select(x => new { name = x.kname, x.persent })
|
|
});
|
|
});
|
|
|
|
+
|
|
List<(string cId, double sc, double max, double min, double excellent, double pass, double count)> clsInfo = new();
|
|
List<(string cId, double sc, double max, double min, double excellent, double pass, double count)> clsInfo = new();
|
|
var cInfo = students.GroupBy(c => (c.classId, c.className)).Select(x => new
|
|
var cInfo = students.GroupBy(c => (c.classId, c.className)).Select(x => new
|
|
{
|
|
{
|
|
id = x.Key.classId,
|
|
id = x.Key.classId,
|
|
name = x.Key.className,
|
|
name = x.Key.className,
|
|
|
|
+ count = classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count,
|
|
max = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Max(s => Math.Abs((double)s)) : 0,
|
|
max = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Max(s => Math.Abs((double)s)) : 0,
|
|
min = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Min(s => Math.Abs((double)s)) : 0,
|
|
min = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Min(s => Math.Abs((double)s)) : 0,
|
|
- excellent = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 80).Count() * 1.0 / x.ToList().Count, 4) : 0,
|
|
|
|
- pass = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 60).Count() * 1.0 / x.ToList().Count, 4) : 0,
|
|
|
|
- score = x.ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / x.ToList().Count, 2) : 0,
|
|
|
|
- persent = x.ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / x.ToList().Count / key7.Value, 4) : 0,
|
|
|
|
|
|
+ excellent = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 80).Count() * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count, 4) : 0,
|
|
|
|
+ pass = x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Count > 0 ? Math.Round(x.ToList().Where(p => p.score > 0).Select(z => z.score).ToList().Where(s => s >= 60).Count() * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count, 4) : 0,
|
|
|
|
+ score = classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count, 2) : 0,
|
|
|
|
+ persent = classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count > 0 ? Math.Round((double)x.ToList().Sum(z => z.score) * 1.0 / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count / key7.Value, 4) : 0,
|
|
kno = key5.Value.Where(c => c.cId.Equals(x.Key.classId)).Select(z => new
|
|
kno = key5.Value.Where(c => c.cId.Equals(x.Key.classId)).Select(z => new
|
|
{
|
|
{
|
|
z.name,
|
|
z.name,
|
|
- persent = Math.Round(z.point > 0 ? z.score / z.point / students.Count() : 0, 4),
|
|
|
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count : 0, 4),
|
|
block = knos.Where(v => null != v.kno && v.kno.Contains(z.name)).Select(x => x.name)
|
|
block = knos.Where(v => null != v.kno && v.kno.Contains(z.name)).Select(x => x.name)
|
|
}),
|
|
}),
|
|
block = claBlock.Count() > 0 ? claBlock.Where(c => c.Key.Equals(x.Key.classId))?.FirstOrDefault().block.Select(z => new
|
|
block = claBlock.Count() > 0 ? claBlock.Where(c => c.Key.Equals(x.Key.classId))?.FirstOrDefault().block.Select(z => new
|
|
{
|
|
{
|
|
name = z.Key,
|
|
name = z.Key,
|
|
- persent = Math.Round(z.point > 0 ? z.score / z.point / students.Count() : 0, 4)
|
|
|
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count : 0, 4)
|
|
}) : null,
|
|
}) : null,
|
|
dim = claDims.Where(c => c.claId.Equals(x.Key.classId)).Select(z => new
|
|
dim = claDims.Where(c => c.claId.Equals(x.Key.classId)).Select(z => new
|
|
{
|
|
{
|
|
name = z.dim,
|
|
name = z.dim,
|
|
- persent = Math.Round(z.point > 0 ? z.score / z.point / students.Count() : 0, 4)
|
|
|
|
|
|
+ persent = Math.Round(z.point > 0 ? z.score / z.point / classResults.Where(k => k.info.id.Equals(x.Key.classId)).FirstOrDefault().status.Where(o => o == 0).ToList().Count : 0, 4)
|
|
}),
|
|
}),
|
|
examResults[0].classes.Where(c => c.id.Equals(x.Key.classId))?.FirstOrDefault().gradeId
|
|
examResults[0].classes.Where(c => c.id.Equals(x.Key.classId))?.FirstOrDefault().gradeId
|
|
});
|
|
});
|
|
@@ -994,12 +988,12 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
{
|
|
{
|
|
id = x.gradeId,
|
|
id = x.gradeId,
|
|
name = perMore[int.Parse(x.gradeId)],
|
|
name = perMore[int.Parse(x.gradeId)],
|
|
- score = x.list.Any() ? Math.Round((double)(x.list.Sum() / x.list.Count()), 2) : 0,
|
|
|
|
- persent = x.list.Any() ? Math.Round((double)(x.list.Sum() / x.list.Count()) / key7.Value, 4) : 0,
|
|
|
|
|
|
+ score = x.list.Any() ? Math.Round((double)(x.list.Sum() / realCount), 2) : 0,
|
|
|
|
+ persent = x.list.Any() ? Math.Round((double)(x.list.Sum() / realCount) / key7.Value, 4) : 0,
|
|
max = x.list.Any() ? x.list.Max(s => Math.Abs((double)s)) : 0,
|
|
max = x.list.Any() ? x.list.Max(s => Math.Abs((double)s)) : 0,
|
|
min = x.list.Any() ? x.list.Min(s => Math.Abs((double)s)) : 0,
|
|
min = x.list.Any() ? x.list.Min(s => Math.Abs((double)s)) : 0,
|
|
- excellent = x.list.Any() ? Math.Round(x.list.Where(s => s >= 80).Count() * 1.0 / x.list.Count(), 4) : 0,
|
|
|
|
- pass = x.list.Any() ? Math.Round(x.list.Where(s => s >= 60).Count() * 1.0 / x.list.Count(), 4) : 0
|
|
|
|
|
|
+ excellent = x.list.Any() ? Math.Round(x.list.Where(s => s >= 80).Count() * 1.0 / realCount, 4) : 0,
|
|
|
|
+ pass = x.list.Any() ? Math.Round(x.list.Where(s => s >= 60).Count() * 1.0 / realCount, 4) : 0
|
|
});
|
|
});
|
|
//获奖次数
|
|
//获奖次数
|
|
List<ArtAttachment> artAttachments = new();
|
|
List<ArtAttachment> artAttachments = new();
|
|
@@ -1031,7 +1025,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
else {
|
|
else {
|
|
url = _azureStorage.GetBlobContainerClient($"{code}").GetBlobClient($"/art/{id}/{subjectId}.json").Uri.ToString();
|
|
url = _azureStorage.GetBlobContainerClient($"{code}").GetBlobClient($"/art/{id}/{subjectId}.json").Uri.ToString();
|
|
}*/
|
|
}*/
|
|
- var realCount = stus.Count - info.lostStu.Count;
|
|
|
|
|
|
+
|
|
//var realClassCount = classResults.Where(c => c.info.id.Equals(classIds[0])).SelectMany(z => z.status).Count(k => k == 0);
|
|
//var realClassCount = classResults.Where(c => c.info.id.Equals(classIds[0])).SelectMany(z => z.status).Count(k => k == 0);
|
|
return Ok(new { count = tchList.Count, scount = realCount, max, min, average, excellent, pass, pow, blk, kno, dim, optCount, students, cInfo, gscore });
|
|
return Ok(new { count = tchList.Count, scount = realCount, max, min, average, excellent, pass, pow, blk, kno, dim, optCount, students, cInfo, gscore });
|
|
|
|
|
|
@@ -1324,7 +1318,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
Score.Add(scores);
|
|
Score.Add(scores);
|
|
|
|
|
|
//该知识点平均得分
|
|
//该知识点平均得分
|
|
- double sc = exam.studentIds.Count > 0 ? Math.Round(scores * 1.0 / exam.studentIds.Count, 2) : 0;
|
|
|
|
|
|
+ double sc = (exam.studentIds.Count - exam.lostStus.Count) > 0 ? Math.Round(scores * 1.0 / (exam.studentIds.Count - exam.lostStus.Count), 2) : 0;
|
|
//知识点占比 此处为了让结果更好看 乘以了系数1.5
|
|
//知识点占比 此处为了让结果更好看 乘以了系数1.5
|
|
double average = sc * 1.5;
|
|
double average = sc * 1.5;
|
|
if (average > OnePoint)
|
|
if (average > OnePoint)
|