|
@@ -126,10 +126,11 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
//计算每个年级参考人数并计算进线分数
|
|
|
List<KeyValuePair<string, double>> keys = new List<KeyValuePair<string, double>>();
|
|
|
- foreach (Grade grade in info.grades) {
|
|
|
+ List<double> gradeTotal = new List<double>();
|
|
|
+ /*foreach (Grade grade in info.grades) {
|
|
|
double ipoint = 0;
|
|
|
int gradeCount = 0;
|
|
|
- List<double> gradeTotal = new List<double>();
|
|
|
+ //List<double> gradeTotal = new List<double>();
|
|
|
HashSet<string> sno = new HashSet<string>();
|
|
|
foreach (ExamClassResult examClassResult in examClassResults) {
|
|
|
if (grade.id.Equals(examClassResult.gradeId)) {
|
|
@@ -156,9 +157,9 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
int personCount = (int)System.Math.Round(gradeCount / info.subjects.Count * (touch / 100.0), MidpointRounding.AwayFromZero);
|
|
|
ipoint = gradeTotal[personCount];
|
|
|
keys.Add(new KeyValuePair<string, double>(grade.id, ipoint));
|
|
|
- }
|
|
|
+ }*/
|
|
|
//获取进线人数
|
|
|
- //int personCount = (int)System.Math.Round(info.stuCount * (touch / 100.0), MidpointRounding.AwayFromZero);
|
|
|
+ int personCount = (int)System.Math.Round(info.stuCount * (touch / 100.0), MidpointRounding.AwayFromZero);
|
|
|
|
|
|
/* //声明年级所有科目总分
|
|
|
List<double> total = new List<double>();*/
|
|
@@ -221,7 +222,12 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
subjectTotal.Add(examResult.subjectId, StuSubjectTotals);
|
|
|
}
|
|
|
-
|
|
|
+ foreach (StudentAys student1 in students) {
|
|
|
+ gradeTotal.Add(student1.total);
|
|
|
+ }
|
|
|
+ //处理进线分数
|
|
|
+ gradeTotal.Sort((s1, s2) => { return s2.CompareTo(s1); });
|
|
|
+ double ipoint = gradeTotal[personCount];
|
|
|
//以班级为单位
|
|
|
foreach (string classId in info.targetClassIds)
|
|
|
{
|
|
@@ -239,14 +245,14 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
var classStudents = students.GetRange(classRes.range[0], classRes.range[1] - classRes.range[0] + 1);
|
|
|
List<double> stuTotals = classStudents.Select(x=>x.total).ToList();
|
|
|
stuTotals.Sort( ( s1, s2) =>{ return s2.CompareTo(s1); });
|
|
|
- double ipoint = 0;
|
|
|
- foreach (KeyValuePair<string, double> key1 in keys)
|
|
|
+
|
|
|
+/* foreach (KeyValuePair<string, double> key1 in keys)
|
|
|
{
|
|
|
if (classroom.gradeId.Equals(key1.Key))
|
|
|
{
|
|
|
ipoint = key1.Value;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
//double ipoint = stuTotals[personCount];
|
|
|
//初始化进线人数
|
|
|
int lineCount = 0;
|