|
@@ -91,11 +91,44 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
"knowledge",
|
|
|
"examScoreRate"
|
|
|
};
|
|
|
+ List<string> knowkey = new List<string>
|
|
|
+ {
|
|
|
+ "id",
|
|
|
+ "className",
|
|
|
+ "seatNO",
|
|
|
+ "point",
|
|
|
+ "anwPoint",
|
|
|
+ "persent"
|
|
|
+ };
|
|
|
+ List<string> keynowWrong = new List<string>
|
|
|
+ {
|
|
|
+ "name",
|
|
|
+ "point",
|
|
|
+ "itemNO",
|
|
|
+ "persent",
|
|
|
+ "wrong",
|
|
|
+ "rhw",
|
|
|
+ "rlw"
|
|
|
+ };
|
|
|
ExamInfo info = null;
|
|
|
double ipoint = 0;
|
|
|
List<KeyValuePair<string, List<List<string>>>> subjectPaperDatas = new List<KeyValuePair<string, List<List<string>>>>();
|
|
|
List<Dictionary<string, object>> valuePairs = new List<Dictionary<string, object>>();
|
|
|
List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>> classSubjectPaperDatas = new List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>>();
|
|
|
+ List<KeyValuePair<string, List<string>>> knowNameDatas = new List<KeyValuePair<string, List<string>>>();
|
|
|
+ List<KeyValuePair<string, List<string>>> knowPerDatas = new List<KeyValuePair<string, List<string>>>();
|
|
|
+ List<KeyValuePair<string, List<double>>> knowAllPerDatas = new List<KeyValuePair<string, List<double>>>();
|
|
|
+ List<KeyValuePair<string, List<double>>> knowScoreDatas = new List<KeyValuePair<string, List<double>>>();
|
|
|
+ List<KeyValuePair<string, List<List<string>>>> wrongDatas = new List<KeyValuePair<string, List<List<string>>>>();
|
|
|
+ List<KeyValuePair<string, List<KeyValuePair<string, List<double> >>>> stuPerDatas = new List<KeyValuePair<string, List<KeyValuePair<string, List<double >>>>>();
|
|
|
+ //声明认知层次变量
|
|
|
+ List<KeyValuePair<string, List<int>>> fieldNameDatas = new List<KeyValuePair<string, List<int>>>();
|
|
|
+ List<KeyValuePair<string, List<string>>> fieldPerDatas = new List<KeyValuePair<string, List<string>>>();
|
|
|
+ List<KeyValuePair<string, List<double>>> fieldAllPerDatas = new List<KeyValuePair<string, List<double>>>();
|
|
|
+ List<KeyValuePair<string, List<double>>> fieldScoreDatas = new List<KeyValuePair<string, List<double>>>();
|
|
|
+ List<KeyValuePair<string, List<List<string>>>> fieldwrongDatas = new List<KeyValuePair<string, List<List<string>>>>();
|
|
|
+ List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>> fieldStuPerDatas = new List<KeyValuePair<string, List<KeyValuePair<string, List<double>>>>>();
|
|
|
+
|
|
|
//获取进线标准以及踩线分数
|
|
|
int touch = 0;
|
|
|
int income = 0;
|
|
@@ -177,6 +210,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
foreach (ExamResult examResult in examResults)
|
|
|
{
|
|
|
(KeyValuePair<string, List<List<string>>> subjectData, KeyValuePair<string, List<KeyValuePair<string, List<double>>>> classSubjectData , Dictionary<string, List<double>> gscore) =DoExerciseScatteres(examResult, paperKey);
|
|
|
+ (KeyValuePair<string, List<string>> knowName , KeyValuePair<string, List<string>> knowPer, KeyValuePair<string, List<double>> knowAllPer, KeyValuePair<string, List<double>> kScore, KeyValuePair<string, List<List<string>>> wrong, KeyValuePair<string, List<KeyValuePair<string, List<double>>>> stuPer) = DoKnowledgePoint(examResult, info, keynowWrong);
|
|
|
+ (KeyValuePair<string, List<int>> fieldName, KeyValuePair<string, List<string>> fieldPer, KeyValuePair<string, List<double>> fieldAllPer, KeyValuePair<string, List<double>> fScore, KeyValuePair<string, List<List<string>>> fieldWrong, KeyValuePair<string, List<KeyValuePair<string, List<double>>>> fieldStuPer) = DoLevel(examResult, info, keynowWrong);
|
|
|
gscores.Add(new KeyValuePair<string, Dictionary<string, List<double>>>(examResult.subjectId, gscore));
|
|
|
/* Dictionary<string, dynamic> gpoint = new Dictionary<string, dynamic>();
|
|
|
Dictionary<string, dynamic> glevel = new Dictionary<string, dynamic>();*/
|
|
@@ -184,9 +219,22 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
subjectPaperDatas.Add(subjectData);
|
|
|
classSubjectPaperDatas.Add(classSubjectData);
|
|
|
subjectScatter.Add(DoSubjectScatter(examResult));
|
|
|
- gpointList.Add("subjectId", examResult.subjectId);
|
|
|
- gpointList.Add("pointKey", DoKnowledgePoint(examResult, info));
|
|
|
- gpointList.Add("levelKey", DoLevel(examResult, info));
|
|
|
+ knowNameDatas.Add(knowName);
|
|
|
+ knowPerDatas.Add(knowPer);
|
|
|
+ knowAllPerDatas.Add(knowAllPer);
|
|
|
+ knowScoreDatas.Add(kScore);
|
|
|
+ wrongDatas.Add(wrong);
|
|
|
+ stuPerDatas.Add(stuPer);
|
|
|
+
|
|
|
+ fieldNameDatas.Add(fieldName);
|
|
|
+ fieldPerDatas.Add(fieldPer);
|
|
|
+ fieldAllPerDatas.Add(fieldAllPer);
|
|
|
+ fieldScoreDatas.Add(fScore);
|
|
|
+ fieldwrongDatas.Add(fieldWrong);
|
|
|
+ fieldStuPerDatas.Add(fieldStuPer);
|
|
|
+ //gpointList.Add("subjectId", examResult.subjectId);
|
|
|
+ //gpointList.Add("pointKey", DoKnowledgePoint(examResult, info));
|
|
|
+ //gpointList.Add("levelKey", DoLevel(examResult, info));
|
|
|
valuePairs.Add(gpointList);
|
|
|
//获取一张试卷的满分
|
|
|
paperScore.Add(examResult.subjectId, examResult.paper.point.Sum());
|
|
@@ -224,7 +272,9 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
StudentSubject subject = new StudentSubject
|
|
|
{
|
|
|
id = examResult.subjectId,
|
|
|
- name = info.subjects.Where(x => x.id == examResult.subjectId).FirstOrDefault().name
|
|
|
+ name = info.subjects.Where(x => x.id == examResult.subjectId).FirstOrDefault().name,
|
|
|
+ point = stuPerDatas.Where(x => x.Key == examResult.subjectId).SelectMany(va=>va.Value).Where(stu=>stu.Key==stuid).Select(pi => pi.Value).First(),
|
|
|
+ fieldPoint = fieldStuPerDatas.Where(x => x.Key == examResult.subjectId).SelectMany(va => va.Value).Where(stu => stu.Key == stuid).Select(pi => pi.Value).First()
|
|
|
};
|
|
|
subject.score = score;
|
|
|
student.subjects.Add(subject);
|
|
@@ -273,10 +323,22 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
//计算标准差
|
|
|
//总平均分
|
|
|
double totalAverage = 0;
|
|
|
- totalAverage = classTotal / stuCount;
|
|
|
+ totalAverage = stuCount > 0 ? classTotal*1.0 / stuCount : 0;
|
|
|
+ //totalAverage = classTotal / stuCount;
|
|
|
//获取整个班级 科目的分数情况
|
|
|
List<KeyValuePair<string, double>> keyValues = new List<KeyValuePair<string, double>>();
|
|
|
List<string> studentIds = new List<string>();
|
|
|
+ List<KeyValuePair<string, List<double>>> pointClassTotal = new List<KeyValuePair<string, List<double>>>();
|
|
|
+ List<KeyValuePair<string, List<double>>> fieldClassTotal = new List<KeyValuePair<string, List<double>>>();
|
|
|
+ subjectTotal.Keys.ToList().ForEach(sub => {
|
|
|
+ var points = new List<double>();
|
|
|
+ var fields = new List<double>();
|
|
|
+ knowNameDatas.Where(su => su.Key == sub).First().Value.ForEach(x => { points.Add(0); });
|
|
|
+ fieldNameDatas.Where(su => su.Key == sub).First().Value.ForEach(x => { fields.Add(0); });
|
|
|
+ pointClassTotal.Add(new KeyValuePair<string, List<double>>(sub, points));
|
|
|
+ fieldClassTotal.Add(new KeyValuePair<string, List<double>>(sub, fields));
|
|
|
+
|
|
|
+ });
|
|
|
classStudents.ForEach(x => {
|
|
|
studentIds.Add(x.id);
|
|
|
x.classId = classId;
|
|
@@ -293,22 +355,37 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
//班级全科的pr
|
|
|
int index = stuTotals.IndexOf(x.total);
|
|
|
- double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
+ double CPR = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
|
|
|
+ //double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
x.cpr = CPR;
|
|
|
x.csort = index + 1;
|
|
|
//班级单科的pr
|
|
|
x.subjects.ForEach(y=> {
|
|
|
+ //y.point
|
|
|
+
|
|
|
var subjectT= classStudents.SelectMany(s=>s.subjects).Where(sub=>sub.id==y.id).Select(scr=>scr.score).ToList();
|
|
|
subjectT.Sort( ( s1, s2) =>{ return s2.CompareTo(s1); });
|
|
|
int index = subjectT.IndexOf(y.score);
|
|
|
- double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
+ double CPR = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
|
|
|
+ //double CPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
y.cpr = CPR;
|
|
|
y.csort = index + 1;
|
|
|
//按科目获取一个班的分数
|
|
|
- keyValues.Add(new KeyValuePair<string, double>(y.id, y.score));
|
|
|
+ keyValues.Add(new KeyValuePair<string, double>(y.id, y.score));
|
|
|
+ var pintTalt= pointClassTotal.Where(su => su.Key == y.id).Select(pint=> pint.Value).First();
|
|
|
+ for (int i = 0; i < y.point.Count; i++) {
|
|
|
+ pintTalt[i] = pintTalt[i] + y.point[i];
|
|
|
+ }
|
|
|
+ var fieldTalt = fieldClassTotal.Where(su => su.Key == y.id).Select(pint => pint.Value).First();
|
|
|
+ for (int i = 0; i < y.fieldPoint.Count; i++)
|
|
|
+ {
|
|
|
+ fieldTalt[i] = fieldTalt[i] + y.fieldPoint[i];
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
- });
|
|
|
- var pow = Math.Pow(powSum / stuCount, 0.5);
|
|
|
+ });
|
|
|
+ var pow = stuCount > 0 ? Math.Pow(powSum / stuCount, 0.5) : 0;
|
|
|
+ //var pow = Math.Pow(powSum / stuCount, 0.5);
|
|
|
ClassAys classAys = new ClassAys
|
|
|
{
|
|
|
gradeId = classroom.gradeId,
|
|
@@ -330,9 +407,24 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
passCount += 1;
|
|
|
}
|
|
|
});
|
|
|
- double passPercent = Math.Round(passCount * 1.0 / stuCount,2) ;
|
|
|
- double average = Math.Round(subScore.Sum() * 1.0 / stuCount,2) ;
|
|
|
- classAys.subjects.Add(new AysSubject {
|
|
|
+ double passPercent = stuCount > 0 ? Math.Round(passCount * 1.0 / stuCount, 2) : 0;
|
|
|
+ //double passPercent = Math.Round(passCount * 1.0 / stuCount,2) ;
|
|
|
+ double average = stuCount > 0 ? Math.Round(subScore.Sum() * 1.0 / stuCount, 2) : 0;
|
|
|
+ //double average = Math.Round(subScore.Sum() * 1.0 / stuCount,2) ;
|
|
|
+ List<double> tt = new List<double>();
|
|
|
+ List<double> fieldPoints = new List<double>();
|
|
|
+ var pp = pointClassTotal.Where(su => su.Key == key).Select(pint => pint.Value).First();
|
|
|
+ pp.ForEach(s => {
|
|
|
+
|
|
|
+ tt.Add(stuCount > 0 ? Math.Round(s* 1.0 / stuCount, 2) : 0) ;
|
|
|
+ });
|
|
|
+ var ff = fieldClassTotal.Where(su => su.Key == key).Select(pint => pint.Value).First();
|
|
|
+ ff.ForEach(s => {
|
|
|
+ fieldPoints.Add(stuCount > 0 ? Math.Round(s * 1.0 / stuCount, 2) : 0);
|
|
|
+ });
|
|
|
+ classAys.subjects.Add(new AysSubject {
|
|
|
+ point = tt,
|
|
|
+ field = fieldPoints,
|
|
|
id = key,
|
|
|
passPercent= passPercent,
|
|
|
passCount= passCount,
|
|
@@ -365,7 +457,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
var AysSubject = clases.SelectMany(c=>c.subjects).Where(x => x.id.Equals(key)).Select(x => x).ToList();
|
|
|
var passCount= AysSubject.Select(x => x.passCount).Sum();
|
|
|
var average =Math.Round(AysSubject.Select(x => x.average).Sum() * 1.0 / classCount);
|
|
|
- var passPercent = Math.Round(passCount * 1.0 / stu.Count,2);
|
|
|
+ var passPercent = stu.Count > 0 ? Math.Round(passCount * 1.0 / stu.Count, 2) : 0;
|
|
|
+ //var passPercent = Math.Round(passCount * 1.0 / stu.Count,2);
|
|
|
AysSubject subject = new AysSubject {
|
|
|
id=key,
|
|
|
passCount= passCount,
|
|
@@ -385,7 +478,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
studentAys.ForEach(x => {
|
|
|
//年级全科的pr
|
|
|
int index = stuGradeTotal.IndexOf(x.total);
|
|
|
- double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
+ double GPR = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
|
|
|
+ //double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
x.gpr = GPR;
|
|
|
x.gsort = index + 1;
|
|
|
//年级单科的pr
|
|
@@ -393,7 +487,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
var subjectT = studentAys.SelectMany(s => s.subjects).Where(sub => sub.id == y.id).Select(scr => scr.score).ToList(); ;
|
|
|
subjectT.Sort((s1, s2) => { return s2.CompareTo(s1); });
|
|
|
int index = subjectT.IndexOf(y.score);
|
|
|
- double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
+ double GPR = stuCount > 0 ? 100 - (100 * (index + 1) - 50) / stuCount : 0;
|
|
|
+ //double GPR = 100 - (100 * (index + 1) - 50) / stuCount;
|
|
|
y.gpr = GPR;
|
|
|
y.gsort = index + 1;
|
|
|
});
|
|
@@ -413,11 +508,34 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
- catch (Exception ex) {
|
|
|
-
|
|
|
+ catch (Exception ex) {
|
|
|
+ BadRequest(ex.StackTrace);
|
|
|
}
|
|
|
var sub = info.subjects.Select(x => new { id = x.id, name = x.name });
|
|
|
- return Ok(new { students, classes, grades , paper= subjectPaperDatas, subjects=sub, scatterKey = scatterKey,paperKey=paperKey, pointLevelKey = valuePairs, ipoint = ipoint,touchScore = touch});
|
|
|
+ return Ok(new { students,
|
|
|
+ classes,
|
|
|
+ grades,
|
|
|
+ paper = subjectPaperDatas,
|
|
|
+ subjects = sub,
|
|
|
+ scatterKey = scatterKey,
|
|
|
+ paperKey = paperKey,
|
|
|
+ pointLevelKey = valuePairs,
|
|
|
+ ipoint = ipoint,
|
|
|
+ touchScore = touch,
|
|
|
+ knowKey = knowkey,
|
|
|
+ wrongKey = keynowWrong,
|
|
|
+ wrong = wrongDatas,
|
|
|
+ knowName = knowNameDatas,
|
|
|
+ knowPer = knowPerDatas,
|
|
|
+ knowAllper = knowAllPerDatas,
|
|
|
+ fieldwrong = fieldwrongDatas,
|
|
|
+ fieldName = fieldNameDatas,
|
|
|
+ fieldPer = fieldPerDatas,
|
|
|
+ fieldAllPer = fieldAllPerDatas,
|
|
|
+ kScores = knowScoreDatas,
|
|
|
+ fScores = fieldScoreDatas
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private static (KeyValuePair<string,List<List<string>>>, KeyValuePair<string, List<KeyValuePair<string, List<double>>>>, Dictionary<string, List<double>>) DoExerciseScatteres(ExamResult e, List<string > paperKey)
|
|
@@ -479,7 +597,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
foreach (int p in answerCount)
|
|
|
{
|
|
|
- var t = Math.Round(p * 1.0 / peopleCount * 100,2);
|
|
|
+ var t = peopleCount > 0 ? Math.Round(p * 1.0 / peopleCount * 100, 2) : 0;
|
|
|
+ //var t = Math.Round(p * 1.0 / peopleCount * 100,2);
|
|
|
persent.Add(t);
|
|
|
}
|
|
|
classdatas.Add(new KeyValuePair<string, List<double>>(c.id, persent));
|
|
@@ -523,7 +642,8 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
foreach (int p in examAnswer)
|
|
|
{
|
|
|
- var t = Math.Round(p * 1.0 / Qnum * 100,2);
|
|
|
+ var t = Qnum > 0 ? Math.Round(p * 1.0 / Qnum * 100, 2) : 0;
|
|
|
+ //var t = Math.Round(p * 1.0 / Qnum * 100,2);
|
|
|
examPersent.Add(t.ToString());
|
|
|
}
|
|
|
for (int k = 0; k < e.paper.point.Count; k++)
|
|
@@ -711,7 +831,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
}
|
|
|
return default;
|
|
|
}
|
|
|
- private Dictionary<string, dynamic> DoKnowledgePoint(ExamResult exam, ExamInfo info)
|
|
|
+ private static (KeyValuePair<string, List<string>>, KeyValuePair<string, List<string>> , KeyValuePair<string, List<double>>, KeyValuePair<string, List<double>>, KeyValuePair<string, List<List<string>>>, KeyValuePair<string, List<KeyValuePair<string, List<double >>>>) DoKnowledgePoint(ExamResult exam, ExamInfo info,List<string> keynowWrong)
|
|
|
{
|
|
|
HashSet<string> knowledge = new HashSet<string>();
|
|
|
HashSet<string> area = new HashSet<string>();
|
|
@@ -720,36 +840,15 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
List<ClassRange> classes = new List<ClassRange>();
|
|
|
List<string> ids = new List<string>();
|
|
|
|
|
|
+ List < KeyValuePair<string, List<double> > >datas = new List<KeyValuePair<string, List<double >>>();
|
|
|
//求单个知识点所占分数
|
|
|
List<string> per = new List<string>();
|
|
|
List<string> gper = new List<string>();
|
|
|
List<string> knowPer = new List<string>();
|
|
|
- List<Dictionary<string, double>> eper = new List<Dictionary<string, double>>();
|
|
|
- Dictionary<string, object> knowledgeALL = new Dictionary<string, object>();
|
|
|
- Dictionary<string, object> knowledgeMap = new Dictionary<string, object>();
|
|
|
- Dictionary<string, object> classMap = new Dictionary<string, object>();
|
|
|
+
|
|
|
Dictionary<string, object> wrongMap = new Dictionary<string, object>();
|
|
|
- HashSet<string> className = new HashSet<string>();
|
|
|
List<List<string>> wrongPersent = new List<List<string>>();
|
|
|
- List<string> key = new List<string>
|
|
|
- {
|
|
|
- "id",
|
|
|
- "className",
|
|
|
- "seatNO",
|
|
|
- "point",
|
|
|
- "anwPoint",
|
|
|
- "persent"
|
|
|
- };
|
|
|
- List<string> keyWrong = new List<string>
|
|
|
- {
|
|
|
- "name",
|
|
|
- "point",
|
|
|
- "itemNO",
|
|
|
- "persent",
|
|
|
- "wrong",
|
|
|
- "rhw",
|
|
|
- "rlw"
|
|
|
- };
|
|
|
+
|
|
|
//定位试卷信息
|
|
|
int index = 0;
|
|
|
foreach (ExamSubject subject in info.subjects)
|
|
@@ -774,7 +873,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
- return knowledgeALL;
|
|
|
+ return (default, default, default,default, default,default);
|
|
|
}
|
|
|
if (info.papers[index].field != null && info.papers[index].field.Count > 0)
|
|
|
{
|
|
@@ -784,7 +883,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
});
|
|
|
}
|
|
|
else {
|
|
|
- return knowledgeALL;
|
|
|
+ return (default, default, default, default, default, default);
|
|
|
}
|
|
|
|
|
|
double Qnum = 0;
|
|
@@ -847,13 +946,13 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
{
|
|
|
total += grade.Sum();
|
|
|
}
|
|
|
- foreach (string id in ids)
|
|
|
+ /* foreach (string id in ids)
|
|
|
{
|
|
|
if (!id.Equals("0"))
|
|
|
{
|
|
|
Qnum++;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
//试卷总分
|
|
|
double TotalPoint = point.Sum();
|
|
|
//计算认知层次占比
|
|
@@ -877,33 +976,61 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
double fieldPersent = fieldPoint / TotalPoint;
|
|
|
fper.Add(fieldPersent.ToString("0.00"));
|
|
|
}
|
|
|
-
|
|
|
- for (int k = 0; k < knowledgeName.Count; k++)
|
|
|
- {
|
|
|
- List<string> knowledgeClass = new List<string>();
|
|
|
- List<List<string>> stuPersent = new List<List<string>>();
|
|
|
+ List<double> knowScore = new List<double>();
|
|
|
+ //得分率
|
|
|
+ List<double> Score = new List<double>();
|
|
|
+ //分值
|
|
|
+ List<double> kScore = new List<double>();
|
|
|
+ for (int k = 0; k < knowledgeName.Count; k++)
|
|
|
+ {
|
|
|
double OnePoint = 0;
|
|
|
- //获取每个知识点占有多少分值
|
|
|
- double ePoint = 0;
|
|
|
- double anwGPoint = 0;
|
|
|
- double poG = 0;
|
|
|
- int m = 0;
|
|
|
List<string> valuew = new List<string>();
|
|
|
List<string> itemNo = new List<string>();
|
|
|
- keyWrong.ForEach(x =>
|
|
|
- {
|
|
|
- valuew.Add("-");
|
|
|
- });
|
|
|
- int wrongCount = 0;
|
|
|
- valuew[0] = knowledgeName[k];
|
|
|
- int n = 0;
|
|
|
- info.papers[index].knowledge.ForEach(kno =>
|
|
|
+ keynowWrong.ForEach(x =>
|
|
|
+ {
|
|
|
+ valuew.Add("-");
|
|
|
+ });
|
|
|
+ valuew[0] = knowledgeName[k];
|
|
|
+ int n = 0;
|
|
|
+ int wrong = 0;
|
|
|
+ int rhwC = 0;
|
|
|
+ int rhlC = 0;
|
|
|
+ int scoreCount = 0;
|
|
|
+ //所有学生该知识点得分
|
|
|
+ double anwGPoint = 0;
|
|
|
+ //知识点分值
|
|
|
+ double gPoint = 0;
|
|
|
+ info.papers[index].knowledge.ForEach(kno =>
|
|
|
{
|
|
|
if (kno.Contains(knowledgeName[k]))
|
|
|
{
|
|
|
OnePoint += point[n];
|
|
|
itemNo.Add((n + 1).ToString());
|
|
|
-
|
|
|
+ //处理单个知识点错题人数
|
|
|
+ foreach (string id in exam.studentIds) {
|
|
|
+ int index = exam.studentIds.IndexOf(id);
|
|
|
+ if (exam.studentScores[index][n] == 0)
|
|
|
+ {
|
|
|
+ wrong++;
|
|
|
+ if (exam.studentScores[index].Sum() >= rhw)
|
|
|
+ {
|
|
|
+ rhwC++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (exam.studentScores[index].Sum() <= rhl)
|
|
|
+ {
|
|
|
+ rhlC++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ scoreCount++;
|
|
|
+ }
|
|
|
+ anwGPoint += exam.studentScores[index][n];
|
|
|
+ }
|
|
|
+ gPoint += point[n];
|
|
|
}
|
|
|
valuew[1] = OnePoint.ToString();
|
|
|
string itemNos = "";
|
|
@@ -920,159 +1047,63 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
valuew[2] = itemNos;
|
|
|
}
|
|
|
n++;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- int rhwC = 0;
|
|
|
- int rhlC = 0;
|
|
|
- foreach (string id in ids)
|
|
|
- {
|
|
|
- if (id.Equals("0") || result[m].Sum() == 0)
|
|
|
- {
|
|
|
- m++;
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<string> values = new List<string>();
|
|
|
- key.ForEach(x =>
|
|
|
- {
|
|
|
- values.Add("-");
|
|
|
- });
|
|
|
- /* foreach (OldStudent info in students)
|
|
|
- {
|
|
|
- if (info.studentId.Equals(id))
|
|
|
- {
|
|
|
- values[2] = info.seatNo.ToString();
|
|
|
- break;
|
|
|
- }
|
|
|
- }*/
|
|
|
- //List<string> stu = new List<string>();
|
|
|
- values[0] = id;
|
|
|
- values[1] = "-";
|
|
|
- //List<List<string>> stuItem = new List<List<string>>();
|
|
|
- int statuCount = 0;
|
|
|
- info.papers[index].knowledge.ForEach(kno => {
|
|
|
- int sno = 0;
|
|
|
- double anwPoint = 0;
|
|
|
- double po = 0;
|
|
|
- if (kno.Contains(knowledgeName[k]))
|
|
|
- {
|
|
|
- //当前认知层次在该题占比多少
|
|
|
- ePoint = 1;
|
|
|
- anwPoint += result[m][sno] * ePoint;
|
|
|
- //所有学生单个认知层次得分情况
|
|
|
- anwGPoint += result[m][sno] * ePoint;
|
|
|
- po += point[sno] * ePoint;
|
|
|
- //认知层次所占分数
|
|
|
- poG += point[sno] * ePoint;
|
|
|
- if (result[m][sno] == 0 && statuCount == 0)
|
|
|
- {
|
|
|
- statuCount++;
|
|
|
- wrongCount++;
|
|
|
- if (result[m].Sum() >= rhw)
|
|
|
- {
|
|
|
- rhwC++;
|
|
|
- }
|
|
|
- if (result[m].Sum() <= rhl)
|
|
|
- {
|
|
|
- rhlC++;
|
|
|
- }
|
|
|
- }
|
|
|
- if (po == 0)
|
|
|
- {
|
|
|
- values[3] = "0";
|
|
|
- values[4] = "0";
|
|
|
- values[5] = "0";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- double stuPser = anwPoint / po;
|
|
|
- values[3] = po.ToString();
|
|
|
- values[4] = anwPoint.ToString();
|
|
|
- values[5] = stuPser.ToString("0.00");
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- stuPersent.Add(values);
|
|
|
- m++;
|
|
|
- }
|
|
|
- //AchievementService.ReName(stuPersent, ids, classes, students);
|
|
|
- double knowPser = 0;
|
|
|
- if (poG == 0)
|
|
|
- {
|
|
|
- knowPer.Add("0");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- knowPser = anwGPoint / poG;
|
|
|
- knowPer.Add(knowPser.ToString("0.00"));
|
|
|
- }
|
|
|
-
|
|
|
+ });
|
|
|
+ kScore.Add(gPoint);
|
|
|
+ Score.Add(anwGPoint);
|
|
|
+ knowScore.Add(OnePoint);
|
|
|
//错题关系表
|
|
|
- valuew[3] = knowPser.ToString("0.00");
|
|
|
- valuew[4] = wrongCount.ToString();
|
|
|
+ valuew[3] = (exam.studentIds.Count > 0 ? Math.Round(scoreCount * 1.0 / exam.studentIds.Count, 2) : 0).ToString();
|
|
|
+ valuew[4] = wrong.ToString();
|
|
|
valuew[5] = rhwC.ToString();
|
|
|
valuew[6] = rhlC.ToString();
|
|
|
wrongPersent.Add(valuew);
|
|
|
- knowledgeMap.Add(knowledgeName[k], stuPersent);
|
|
|
-
|
|
|
- //知识点占比
|
|
|
- double persent = OnePoint / TotalPoint;
|
|
|
- foreach (ClassRange classRange in exam.classes)
|
|
|
- {
|
|
|
- List<string> classPoints = new List<string>();
|
|
|
- //初始化班级得分
|
|
|
- double anwCPoint = 0;
|
|
|
- double cpo = 0;
|
|
|
- for (int stuIndex = classRange.range[0]; stuIndex < classRange.range[1]; stuIndex++)
|
|
|
- {
|
|
|
-
|
|
|
- if (result[stuIndex].Sum() == 0) continue;
|
|
|
- info.papers[index].knowledge.ForEach(kno => {
|
|
|
- int x = 0;
|
|
|
- if (kno.Contains(knowledgeName[k]))
|
|
|
- {
|
|
|
- //当前认知层次在该题占比多少
|
|
|
- ePoint = 1;
|
|
|
- anwCPoint += result[stuIndex][x] * ePoint;
|
|
|
- cpo += point[x] * ePoint;
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
- if (cpo == 0)
|
|
|
- {
|
|
|
- //double classPser = anwCPoint / cpo;
|
|
|
- knowledgeClass.Add("0");
|
|
|
- }
|
|
|
- else
|
|
|
+ //知识点占比
|
|
|
+ double persent = OnePoint / TotalPoint;
|
|
|
+ per.Add(persent.ToString("0.00"));
|
|
|
+
|
|
|
+ }
|
|
|
+ //本次考试知识点占比
|
|
|
+ List<double> allPer = new List<double>();
|
|
|
+ foreach (double sc in Score)
|
|
|
+ {
|
|
|
+ allPer.Add(exam.studentIds.Count > 0 ? Math.Round(sc * 1.0 / exam.studentIds.Count,2) : 0);
|
|
|
+ }
|
|
|
+ int stuNo = 0;
|
|
|
+ exam.studentIds.ForEach(e => {
|
|
|
+
|
|
|
+ //values.Add(e);
|
|
|
+
|
|
|
+
|
|
|
+ List<double> valueKnow = new List<double>();
|
|
|
+ foreach (string know in knowledge) {
|
|
|
+ double anwPoint = 0;
|
|
|
+ double itemPersent = 0;
|
|
|
+ int sno = 0;
|
|
|
+ info.papers[index].knowledge.ForEach(kno => {
|
|
|
+ if (kno.Contains(know))
|
|
|
{
|
|
|
- double classPser = anwCPoint / cpo;
|
|
|
- knowledgeClass.Add(classPser.ToString("0.00"));
|
|
|
+ //当前知识点在该题占比多少
|
|
|
+ itemPersent = 1 / Convert.ToDouble(kno.Count);
|
|
|
+ anwPoint += result[stuNo][sno] * itemPersent;
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
- classMap.Add(knowledgeName[k], knowledgeClass);
|
|
|
- per.Add(persent.ToString("0.00"));
|
|
|
-
|
|
|
- }
|
|
|
- knowledgeMap.Add("grade", knowPer);
|
|
|
- knowledgeMap.Add("keys", key);
|
|
|
- classMap.Add("className", className);
|
|
|
- wrongMap.Add("keys", keyWrong);
|
|
|
- wrongMap.Add("datas", wrongPersent);
|
|
|
- knowledgeALL.Add("pointList", knowledgeName);
|
|
|
- knowledgeALL.Add("per", per);
|
|
|
- knowledgeALL.Add("level", areaName);
|
|
|
- knowledgeALL.Add("fper", fper);
|
|
|
- knowledgeALL.Add("stupercent", knowledgeMap);
|
|
|
- knowledgeALL.Add("classpercent", classMap);
|
|
|
- knowledgeALL.Add("wrong", wrongMap);
|
|
|
- //keyValues.Add(knowledgeALL);
|
|
|
- return knowledgeALL;
|
|
|
+ sno++;
|
|
|
+ });
|
|
|
+ valueKnow.Add(anwPoint);
|
|
|
+ }
|
|
|
+ KeyValuePair<string, List<double> > keyValue = new KeyValuePair<string, List<double> >(e, valueKnow);
|
|
|
+ datas.Add(keyValue);
|
|
|
+ stuNo++;
|
|
|
+ });
|
|
|
+ KeyValuePair<string, List<string>> key1 = new KeyValuePair<string, List<string>>(exam.subjectId,knowledgeName);
|
|
|
+ KeyValuePair<string, List<string>> key2 = new KeyValuePair<string, List<string>>(exam.subjectId,per);
|
|
|
+ KeyValuePair<string, List<double>> key3 = new KeyValuePair<string, List<double>>(exam.subjectId, allPer);
|
|
|
+ KeyValuePair<string, List<double>> key4 = new KeyValuePair<string, List<double>>(exam.subjectId, kScore);
|
|
|
+ KeyValuePair<string, List<List<string>>> keyValue = new KeyValuePair<string, List<List<string>>>(exam.subjectId, wrongPersent);
|
|
|
+ KeyValuePair<string, List<KeyValuePair<string, List<double>>>> valuePair = new KeyValuePair<string, List<KeyValuePair<string, List<double> >>>(exam.subjectId, datas);
|
|
|
+ return (key1,key2, key3, key4, keyValue, valuePair);
|
|
|
}
|
|
|
|
|
|
- private Dictionary<string, dynamic> DoLevel(ExamResult exam, ExamInfo info)
|
|
|
+ /*private Dictionary<string, dynamic> DoLevel(ExamResult exam, ExamInfo info)
|
|
|
{
|
|
|
HashSet<string> knowledge = new HashSet<string>();
|
|
|
HashSet<string> area = new HashSet<string>();
|
|
@@ -1092,25 +1123,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
Dictionary<string, object> wrongMap = new Dictionary<string, object>();
|
|
|
HashSet<string> className = new HashSet<string>();
|
|
|
List<List<string>> wrongPersent = new List<List<string>>();
|
|
|
- List<string> key = new List<string>
|
|
|
- {
|
|
|
- "id",
|
|
|
- "className",
|
|
|
- "seatNO",
|
|
|
- "point",
|
|
|
- "anwPoint",
|
|
|
- "persent"
|
|
|
- };
|
|
|
- List<string> keyWrong = new List<string>
|
|
|
- {
|
|
|
- "name",
|
|
|
- "point",
|
|
|
- "itemNO",
|
|
|
- "persent",
|
|
|
- "wrong",
|
|
|
- "rhw",
|
|
|
- "rlw"
|
|
|
- };
|
|
|
+
|
|
|
//定位试卷信息
|
|
|
int index = 0;
|
|
|
foreach (ExamSubject subject in info.subjects)
|
|
@@ -1270,14 +1283,14 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
{
|
|
|
values.Add("-");
|
|
|
});
|
|
|
- /* foreach (OldStudent info in students)
|
|
|
+ *//* foreach (OldStudent info in students)
|
|
|
{
|
|
|
if (info.studentId.Equals(id))
|
|
|
{
|
|
|
values[2] = info.seatNo.ToString();
|
|
|
break;
|
|
|
}
|
|
|
- }*/
|
|
|
+ }*//*
|
|
|
//List<string> stu = new List<string>();
|
|
|
values[0] = id;
|
|
|
values[1] = "-";
|
|
@@ -1388,19 +1401,247 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
per.Add(persent.ToString("0.00"));
|
|
|
|
|
|
}
|
|
|
- knowledgeMap.Add("grade", knowPer);
|
|
|
- knowledgeMap.Add("keys", key);
|
|
|
- classMap.Add("className", className);
|
|
|
- wrongMap.Add("keys", keyWrong);
|
|
|
- wrongMap.Add("datas", wrongPersent);
|
|
|
- knowledgeALL.Add("pointList", knowledgeName);
|
|
|
- knowledgeALL.Add("per", per);
|
|
|
- knowledgeALL.Add("level", areaName);
|
|
|
- knowledgeALL.Add("fper", fper);
|
|
|
- knowledgeALL.Add("stupercent", knowledgeMap);
|
|
|
- knowledgeALL.Add("classpercent", classMap);
|
|
|
- knowledgeALL.Add("wrong", wrongMap);
|
|
|
return knowledgeALL;
|
|
|
+ }*/
|
|
|
+
|
|
|
+ private static (KeyValuePair<string, List<int>>, KeyValuePair<string, List<string>>, KeyValuePair<string, List<double>>, KeyValuePair<string, List<double>>, KeyValuePair<string, List<List<string>>>, KeyValuePair<string, List<KeyValuePair<string, List<double>>>>) DoLevel(ExamResult exam, ExamInfo info, List<string> keynowWrong)
|
|
|
+ {
|
|
|
+/* HashSet<string> knowledge = new HashSet<string>();
|
|
|
+ HashSet<string> area = new HashSet<string>();*/
|
|
|
+ List<double> point = new List<double>();
|
|
|
+ List<List<double>> result = new List<List<double>>();
|
|
|
+ List<ClassRange> classes = new List<ClassRange>();
|
|
|
+ List<string> ids = new List<string>();
|
|
|
+
|
|
|
+ List<KeyValuePair<string, List<double>>> datas = new List<KeyValuePair<string, List<double>>>();
|
|
|
+ //求单个知识点所占分数
|
|
|
+ List<string> per = new List<string>();
|
|
|
+ List<string> gper = new List<string>();
|
|
|
+ List<string> knowPer = new List<string>();
|
|
|
+
|
|
|
+ //Dictionary<string, object> wrongMap = new Dictionary<string, object>();
|
|
|
+ List<List<string>> wrongPersent = new List<List<string>>();
|
|
|
+
|
|
|
+ List<int> knowledgeName = new List<int>();
|
|
|
+
|
|
|
+ List<int> areaName = new List<int>();
|
|
|
+
|
|
|
+ //定位试卷信息
|
|
|
+ int index = 0;
|
|
|
+ foreach (ExamSubject subject in info.subjects)
|
|
|
+ {
|
|
|
+ if (subject.id.Equals(exam.subjectId))
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ knowledgeName.Add(1);
|
|
|
+ knowledgeName.Add(2);
|
|
|
+ knowledgeName.Add(3);
|
|
|
+ knowledgeName.Add(4);
|
|
|
+ knowledgeName.Add(5);
|
|
|
+ knowledgeName.Add(6);
|
|
|
+ areaName.Add(1);
|
|
|
+ areaName.Add(2);
|
|
|
+ areaName.Add(3);
|
|
|
+ areaName.Add(4);
|
|
|
+ areaName.Add(5);
|
|
|
+ areaName.Add(6);
|
|
|
+
|
|
|
+ double Qnum = 0;
|
|
|
+ point = info.papers[index].point;
|
|
|
+ result = exam.studentScores;
|
|
|
+ classes = exam.classes;
|
|
|
+ ids = exam.studentIds;
|
|
|
+ //确定高分组 低分组人数
|
|
|
+ List<List<double>> re = exam.studentScores;
|
|
|
+ List<double> resultSum = new List<double>();
|
|
|
+ foreach (List<double> data in re)
|
|
|
+ {
|
|
|
+ resultSum.Add(data.Sum());
|
|
|
+ }
|
|
|
+ //确定高分组 最低分数
|
|
|
+ resultSum.Sort(delegate (double s1, double s2) { return s2.CompareTo(s1); });
|
|
|
+ for (int i = resultSum.Count - 1; i >= 0; i--)
|
|
|
+ {
|
|
|
+ if (resultSum[i] == 0)
|
|
|
+ {
|
|
|
+ resultSum.Remove(resultSum[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double rhwCount = resultSum.Count * 0.27;
|
|
|
+ double rhw = resultSum[int.Parse(rhwCount.ToString("0"))];
|
|
|
+ //确定低分组 最高分数
|
|
|
+ resultSum.Sort(delegate (double s1, double s2) { return s1.CompareTo(s2); });
|
|
|
+ double rhlCount = resultSum.Count * 0.27;
|
|
|
+ double rhl = resultSum[int.Parse(rhwCount.ToString("0"))];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //初始化年级总分
|
|
|
+ double total = 0;
|
|
|
+ //处理年级单个知识点得分率
|
|
|
+ foreach (List<double> grade in result)
|
|
|
+ {
|
|
|
+ total += grade.Sum();
|
|
|
+ }
|
|
|
+ foreach (string id in ids)
|
|
|
+ {
|
|
|
+ if (!id.Equals("0"))
|
|
|
+ {
|
|
|
+ Qnum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //试卷总分
|
|
|
+ double TotalPoint = point.Sum();
|
|
|
+ //计算认知层次占比
|
|
|
+
|
|
|
+ List<string> fper = new List<string>();
|
|
|
+ for (int a = 0; a < areaName.Count; a++)
|
|
|
+ {
|
|
|
+ double fieldPoint = 0;
|
|
|
+ int no = 0;
|
|
|
+ info.papers[index].field.ForEach(f =>
|
|
|
+ {
|
|
|
+ if (f == areaName[a])
|
|
|
+ {
|
|
|
+ fieldPoint += point[no];
|
|
|
+ }
|
|
|
+ no++;
|
|
|
+ });
|
|
|
+ double fieldPersent = fieldPoint / TotalPoint;
|
|
|
+ fper.Add(fieldPersent.ToString("0.00"));
|
|
|
+ }
|
|
|
+ List<double> knowScore = new List<double>();
|
|
|
+ //得分率
|
|
|
+ List<double> Score = new List<double>();
|
|
|
+ //分值
|
|
|
+ List<double> kScore = new List<double>();
|
|
|
+ for (int k = 0; k < knowledgeName.Count; k++)
|
|
|
+ {
|
|
|
+ double OnePoint = 0;
|
|
|
+ List<string> valuew = new List<string>();
|
|
|
+ List<string> itemNo = new List<string>();
|
|
|
+ keynowWrong.ForEach(x =>
|
|
|
+ {
|
|
|
+ valuew.Add("-");
|
|
|
+ });
|
|
|
+ valuew[0] = knowledgeName[k].ToString();
|
|
|
+ int n = 0;
|
|
|
+ int wrong = 0;
|
|
|
+ int rhwC = 0;
|
|
|
+ int rhlC = 0;
|
|
|
+ int scoreCount = 0;
|
|
|
+ //所有认知层次得分
|
|
|
+ double anwGPoint = 0;
|
|
|
+ double gPoint = 0;
|
|
|
+ info.papers[index].field.ForEach(kno =>
|
|
|
+ {
|
|
|
+ if (kno == knowledgeName[k])
|
|
|
+ {
|
|
|
+ OnePoint += point[n];
|
|
|
+ itemNo.Add((n + 1).ToString());
|
|
|
+ //处理单个知识点错题人数
|
|
|
+ foreach (string id in exam.studentIds)
|
|
|
+ {
|
|
|
+ int index = exam.studentIds.IndexOf(id);
|
|
|
+ if (exam.studentScores[index][n] == 0)
|
|
|
+ {
|
|
|
+ wrong++;
|
|
|
+ if (exam.studentScores[index].Sum() >= rhw)
|
|
|
+ {
|
|
|
+ rhwC++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (exam.studentScores[index].Sum() <= rhl)
|
|
|
+ {
|
|
|
+ rhlC++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ scoreCount++;
|
|
|
+ }
|
|
|
+ anwGPoint += exam.studentScores[index][n];
|
|
|
+ }
|
|
|
+ gPoint += point[n];
|
|
|
+ }
|
|
|
+ valuew[1] = OnePoint.ToString();
|
|
|
+ string itemNos = "";
|
|
|
+ if (itemNo.Count > 0)
|
|
|
+ {
|
|
|
+ foreach (string np in itemNo)
|
|
|
+ {
|
|
|
+ itemNos += np + ",";
|
|
|
+ }
|
|
|
+ valuew[2] = itemNos[0..^1];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ valuew[2] = itemNos;
|
|
|
+ }
|
|
|
+ n++;
|
|
|
+ });
|
|
|
+ Score.Add(anwGPoint);
|
|
|
+ kScore.Add(gPoint);
|
|
|
+ knowScore.Add(OnePoint);
|
|
|
+ //错题关系表
|
|
|
+
|
|
|
+ valuew[3] = (exam.studentIds.Count > 0 ? Math.Round(scoreCount * 1.0 / exam.studentIds.Count, 2) : 0).ToString() ;
|
|
|
+ valuew[4] = wrong.ToString();
|
|
|
+ valuew[5] = rhwC.ToString();
|
|
|
+ valuew[6] = rhlC.ToString();
|
|
|
+ wrongPersent.Add(valuew);
|
|
|
+ //认知层次占比
|
|
|
+ double persent = OnePoint / TotalPoint;
|
|
|
+ per.Add(persent.ToString("0.00"));
|
|
|
+ }
|
|
|
+ //本次考试知识点占比
|
|
|
+ List<double> allPer = new List<double>();
|
|
|
+ foreach (double sc in Score)
|
|
|
+ {
|
|
|
+ allPer.Add(exam.studentIds.Count > 0 ? Math.Round(sc * 1.0 / exam.studentIds.Count, 2) :0);
|
|
|
+ }
|
|
|
+ int stuNo = 0;
|
|
|
+ exam.studentIds.ForEach(e => {
|
|
|
+
|
|
|
+ //values.Add(e);
|
|
|
+
|
|
|
+
|
|
|
+ List<double> valueKnow = new List<double>();
|
|
|
+ foreach (int know in knowledgeName)
|
|
|
+ {
|
|
|
+ double anwPoint = 0;
|
|
|
+ double itemPersent = 0;
|
|
|
+ int sno = 0;
|
|
|
+ info.papers[index].field.ForEach(kno => {
|
|
|
+ if (kno == know)
|
|
|
+ {
|
|
|
+ //当前知识点在该题占比多少
|
|
|
+ itemPersent = 1;
|
|
|
+ anwPoint += result[stuNo][sno] * itemPersent;
|
|
|
+ }
|
|
|
+ sno++;
|
|
|
+ });
|
|
|
+ valueKnow.Add(anwPoint);
|
|
|
+ }
|
|
|
+ KeyValuePair<string, List<double>> keyValue = new KeyValuePair<string, List<double>>(e, valueKnow);
|
|
|
+ datas.Add(keyValue);
|
|
|
+ stuNo++;
|
|
|
+ });
|
|
|
+ KeyValuePair<string, List<int>> key1 = new KeyValuePair<string, List<int>>(exam.subjectId, knowledgeName);
|
|
|
+ KeyValuePair<string, List<string>> key2 = new KeyValuePair<string, List<string>>(exam.subjectId, per);
|
|
|
+ KeyValuePair<string, List<double>> key3 = new KeyValuePair<string, List<double>>(exam.subjectId, allPer);
|
|
|
+ KeyValuePair<string, List<double>> key4 = new KeyValuePair<string, List<double>>(exam.subjectId, kScore);
|
|
|
+ KeyValuePair<string, List<List<string>>> keyValue = new KeyValuePair<string, List<List<string>>>(exam.subjectId, wrongPersent);
|
|
|
+ KeyValuePair<string, List<KeyValuePair<string, List<double>>>> valuePair = new KeyValuePair<string, List<KeyValuePair<string, List<double>>>>(exam.subjectId, datas);
|
|
|
+ return (key1, key2, key3, key4,keyValue, valuePair);
|
|
|
}
|
|
|
|
|
|
}
|