|
@@ -418,7 +418,7 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
|
|
|
}
|
|
|
|
|
|
List<(string name, double score, string subject)> blockScore = new();
|
|
|
- List<(List<(string name, double score, string subject)> studentScore, string stuId)> studentScores = new();
|
|
|
+ List<(List<(string name, double score, double point, string subject)> studentScore, string stuId)> studentScores = new();
|
|
|
foreach (var exam in examResults)
|
|
|
{
|
|
|
HashSet<string> knowledge = new HashSet<string>();
|
|
@@ -455,16 +455,19 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
|
|
|
List<double> Score = new List<double>();
|
|
|
//List<(string name, double score, string subject)> pointScore = new();
|
|
|
foreach (string id in exam.studentIds) {
|
|
|
- double scores = 0;
|
|
|
- List<(string name, double score, string subject)> studentScore = new();
|
|
|
+ //double scores = 0;
|
|
|
+ List<(string name, double score, double point,string subject)> studentScore = new();
|
|
|
for (int k = 0; k < knowledgeName.Count; k++)
|
|
|
{
|
|
|
int n = 0;
|
|
|
+ double OnePoint = 0;
|
|
|
+ double scores = 0;
|
|
|
exam.paper.knowledge.ForEach(kno =>
|
|
|
{
|
|
|
if (kno.Contains(knowledgeName[k]))
|
|
|
{
|
|
|
var itemPersent = kno.Count > 0 ? 1 / Convert.ToDouble(kno.Count) : 0;
|
|
|
+ OnePoint += point[n] * itemPersent;
|
|
|
int index = exam.studentIds.IndexOf(id);
|
|
|
if (exam.studentScores[index][n] > 0)
|
|
|
{
|
|
@@ -473,7 +476,7 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
|
|
|
}
|
|
|
n++;
|
|
|
});
|
|
|
- studentScore.Add((knowledgeName[k], Math.Round(scores,2), exam.subjectId));
|
|
|
+ studentScore.Add((knowledgeName[k], Math.Round(scores,2), OnePoint, exam.subjectId));
|
|
|
}
|
|
|
studentScores.Add((studentScore,id));
|
|
|
}
|
|
@@ -635,6 +638,7 @@ namespace TEAMModelOS.FunctionV4.CosmosDB
|
|
|
p => p.subject.Equals(sj.id)).Select(z => new {
|
|
|
z.name,
|
|
|
z.score,
|
|
|
+ z.point,
|
|
|
block = subjectKnow.Where(v => v.subId.Equals(sj.id)).SelectMany(k => k.knos).Where(c => null != c.kno && c.kno.Contains(z.name)).Select(x => x.name)
|
|
|
})
|
|
|
};
|