|
@@ -238,12 +238,19 @@ namespace HTEX.Test.Controllers
|
|
|
int index = 0;
|
|
|
lessonBase.student.ForEach(x =>
|
|
|
{
|
|
|
+ int attend = 0;
|
|
|
+ var client = lessonBase.report.clientSummaryList.Find(y => y.seatID == x.seatID);
|
|
|
+ if (client!=null)
|
|
|
+ {
|
|
|
+ attend=client.attendState;
|
|
|
+ }
|
|
|
studentLessonDatas.Add(new StudentLessonData()
|
|
|
{
|
|
|
id = x.id,
|
|
|
index = index,
|
|
|
seatID =$"{x.seatID}",
|
|
|
groupId = x.groupId,
|
|
|
+ attend= attend
|
|
|
});
|
|
|
index++;
|
|
|
});
|
|
@@ -313,11 +320,12 @@ namespace HTEX.Test.Controllers
|
|
|
var studentLessonData = studentLessonDatas.Find(x => x.seatID!.Equals($"{mbr}"));
|
|
|
if (studentLessonData!=null)
|
|
|
{
|
|
|
+ studentLessonData.attend=1;
|
|
|
studentLessonData.interactRecord.interactRecords.Add(new ItemRecord()
|
|
|
{
|
|
|
resultWeight = InteractWeight.TT,
|
|
|
resultType="TT",
|
|
|
- interactType = string.IsNullOrWhiteSpace(item.PickupType) ? "PickupResult" : item.PickupType
|
|
|
+ itemType = string.IsNullOrWhiteSpace(item.PickupType) ? "PickupResult" : item.PickupType
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -333,8 +341,9 @@ namespace HTEX.Test.Controllers
|
|
|
{
|
|
|
//检查是否设置正确答案。
|
|
|
var answers_q = irsDataPage.question?["exercise"]?["answer"]?.ToJsonString().ToObject<List<string>>();
|
|
|
+ //根据题去找对应的试卷和评测信息
|
|
|
var question_id = $"{irsDataPage.question?["id"]}";
|
|
|
- var xs= examDatas.Where(x =>x.paper!=null && x.paper.slides.Exists(x =>!string.IsNullOrWhiteSpace(x.url) && x.url.Equals($"{question_id}.json"))).FirstOrDefault();
|
|
|
+ var examData = examDatas.Where(x =>x.paper!=null && x.paper.slides.Exists(x =>!string.IsNullOrWhiteSpace(x.url) && x.url.Equals($"{question_id}.json"))).FirstOrDefault();
|
|
|
List<string> answers = new List<string>();
|
|
|
answers_q?.ForEach(x => {
|
|
|
if (!string.IsNullOrWhiteSpace(x))
|
|
@@ -346,7 +355,7 @@ namespace HTEX.Test.Controllers
|
|
|
var scoreNode = irsDataPage.question?["exercise"]?["score"];
|
|
|
var _type = irsDataPage.question?["exercise"]?["type"];
|
|
|
var _answerType = irsDataPage.question?["exercise"]?["answerType"];//file,audio,text,image
|
|
|
- double score = 0;
|
|
|
+ double questionScore = 0;
|
|
|
bool objective = false;
|
|
|
|
|
|
if (_objective!=null) {
|
|
@@ -366,7 +375,6 @@ namespace HTEX.Test.Controllers
|
|
|
else {
|
|
|
objective = false;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
if (_answerType!=null)
|
|
@@ -383,7 +391,7 @@ namespace HTEX.Test.Controllers
|
|
|
}
|
|
|
if (scoreNode!=null)
|
|
|
{
|
|
|
- double.TryParse(scoreNode.ToString(), out score);
|
|
|
+ double.TryParse(scoreNode.ToString(), out questionScore);
|
|
|
}
|
|
|
string interactType = string.Empty;
|
|
|
|
|
@@ -413,6 +421,19 @@ namespace HTEX.Test.Controllers
|
|
|
{
|
|
|
for (int index = 0; index< clientAnswers[0].Count; index++)
|
|
|
{
|
|
|
+ var student = studentLessonDatas[index];
|
|
|
+ double studentScore = 0 ;
|
|
|
+ if (examData!=null && examData.examClassResult.IsNotEmpty()) {
|
|
|
+ var examResultIndex = examData.examClassResult.First().studentIds.IndexOf(student.id);
|
|
|
+ var questionIndex = examData.paper.slides.Select(x => x.url).ToList().IndexOf($"{question_id}.json");
|
|
|
+ if (examResultIndex>=0
|
|
|
+ && examData.examClassResult.First().studentScores.Count>=(examResultIndex+1) //防止索引越界
|
|
|
+ && examData.examClassResult.First().studentScores[examResultIndex].Count>=(questionIndex+1)) //防止索引越界
|
|
|
+ {
|
|
|
+ //获取index学生在questionIndex题的分数
|
|
|
+ studentScore = examData.examClassResult.First().studentScores[examResultIndex][questionIndex];
|
|
|
+ }
|
|
|
+ }
|
|
|
//index 代表学生下标
|
|
|
List<ItemRecord> interactRecords = new List<ItemRecord>();
|
|
|
if (clientAnswers.Count==1)
|
|
@@ -420,12 +441,14 @@ namespace HTEX.Test.Controllers
|
|
|
//即问即答
|
|
|
interactType = "PopQuesLoad";
|
|
|
var ans0 = clientAnswers[0][index];
|
|
|
- var IS0 = GetInteractResultHasAnswer(answers, ans0, objective,type);
|
|
|
+ var IS0 = GetInteractResultHasAnswer(answers, ans0, objective,type,questionScore, studentScore);
|
|
|
interactRecords.Add(new ItemRecord()
|
|
|
{
|
|
|
resultWeight = IS0.weight,
|
|
|
resultType=IS0.reultType,
|
|
|
- interactType= interactType
|
|
|
+ itemType= interactType,
|
|
|
+ criterion= questionScore,
|
|
|
+ itemScore= IS0.interactScore
|
|
|
});
|
|
|
}
|
|
|
if (clientAnswers.Count==2)
|
|
@@ -433,12 +456,14 @@ namespace HTEX.Test.Controllers
|
|
|
//二次作答
|
|
|
interactType="ReAtmpAnsStrt";
|
|
|
var ans1 = clientAnswers[1][index];
|
|
|
- var IS1 = GetInteractResultHasAnswer(answers, ans1, objective,type);
|
|
|
+ var IS1 = GetInteractResultHasAnswer(answers, ans1, objective,type,questionScore,studentScore);
|
|
|
interactRecords.Add(new ItemRecord()
|
|
|
{
|
|
|
resultWeight = IS1.weight,
|
|
|
resultType=IS1.reultType,
|
|
|
- interactType= interactType
|
|
|
+ itemType= interactType,
|
|
|
+ criterion= questionScore,
|
|
|
+ itemScore= IS1.interactScore
|
|
|
});
|
|
|
}
|
|
|
if (clientAnswers.Count>2)
|
|
@@ -446,15 +471,20 @@ namespace HTEX.Test.Controllers
|
|
|
//三次作答
|
|
|
interactType="TeAtmpAnsStrt";
|
|
|
var ans2 = clientAnswers[2][index];
|
|
|
- var IS2 = GetInteractResultHasAnswer(answers, ans2, objective,type);
|
|
|
+ var IS2 = GetInteractResultHasAnswer(answers, ans2, objective, type, questionScore, studentScore);
|
|
|
interactRecords.Add(new ItemRecord()
|
|
|
{
|
|
|
resultWeight = IS2.weight,
|
|
|
resultType=IS2.reultType,
|
|
|
- interactType= interactType
|
|
|
+ itemType= interactType,
|
|
|
+ criterion= questionScore,
|
|
|
+ itemScore= IS2.interactScore
|
|
|
});
|
|
|
}
|
|
|
- studentLessonDatas[index].interactRecord.interactRecords.AddRange(interactRecords);
|
|
|
+ if (studentLessonDatas[index].attend==1)
|
|
|
+ {
|
|
|
+ studentLessonDatas[index].interactRecord.interactRecords.AddRange(interactRecords);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -470,25 +500,28 @@ namespace HTEX.Test.Controllers
|
|
|
var studentData = studentLessonDatas.Find(x => x.seatID!.Equals(buzzParticipant));
|
|
|
if (studentData != null)
|
|
|
{
|
|
|
- buzzParticipants[buzzParticipant]=new ItemRecord() { resultWeight = InteractWeight.T1, interactType= interactType };
|
|
|
+ buzzParticipants[buzzParticipant]=new ItemRecord() { resultWeight = InteractWeight.T1, itemType= interactType };
|
|
|
}
|
|
|
}
|
|
|
//处理抢权成功的
|
|
|
foreach (var buzzClient in irsDataPage.buzzClients)
|
|
|
{
|
|
|
- buzzParticipants[buzzClient]=new ItemRecord() { resultWeight = InteractWeight.TT, interactType= interactType };
|
|
|
+ buzzParticipants[buzzClient]=new ItemRecord() { resultWeight = InteractWeight.TT, itemType= interactType };
|
|
|
}
|
|
|
foreach (var studentLessonData in studentLessonDatas)
|
|
|
{
|
|
|
if (buzzParticipants.ContainsKey(studentLessonData.seatID!))
|
|
|
{
|
|
|
//处理已经有抢权结果的数据
|
|
|
+ studentLessonData.attend=1;
|
|
|
studentLessonData.interactRecord.interactRecords.Add(buzzParticipants[studentLessonData.seatID!]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //处理未参与抢权的
|
|
|
- studentLessonData.interactRecord.interactRecords.Add(new ItemRecord() { resultWeight = InteractWeight.T0, interactType = interactType });
|
|
|
+ if (studentLessonData.attend==1) {
|
|
|
+ //处理未参与抢权的
|
|
|
+ studentLessonData.interactRecord.interactRecords.Add(new ItemRecord() { resultWeight = InteractWeight.T0, itemType = interactType });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -497,7 +530,7 @@ namespace HTEX.Test.Controllers
|
|
|
return studentLessonDatas;
|
|
|
}
|
|
|
|
|
|
- private static (double weight,string reultType) GetInteractResultHasAnswer(List<string>? answers, List<string> ans0 , bool objective,string type)
|
|
|
+ private static (double weight,string reultType,double interactScore) GetInteractResultHasAnswer(List<string>? answers, List<string> ans0 , bool objective,string type, double questionScore, double studentScore)
|
|
|
{
|
|
|
//List<string> ans0 = new List<string>();
|
|
|
//ans?.ForEach(x => {
|
|
@@ -509,6 +542,7 @@ namespace HTEX.Test.Controllers
|
|
|
//});
|
|
|
double weight = InteractWeight.T0;
|
|
|
string reultType = InteractReultType.T0;
|
|
|
+ double interactScore = 0;
|
|
|
if (answers.IsNotEmpty())
|
|
|
{
|
|
|
if (ans0.IsNotEmpty())
|
|
@@ -523,12 +557,14 @@ namespace HTEX.Test.Controllers
|
|
|
//完全正确
|
|
|
weight= InteractWeight.TT;
|
|
|
reultType= InteractReultType.TT;
|
|
|
+ interactScore= studentScore==0 ? questionScore : studentScore;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//作答错误
|
|
|
weight= InteractWeight.T1;
|
|
|
reultType = InteractReultType.T1;
|
|
|
+ interactScore= studentScore;
|
|
|
}
|
|
|
}
|
|
|
//标准答案比作答的结果多
|
|
@@ -539,12 +575,15 @@ namespace HTEX.Test.Controllers
|
|
|
//部分正确
|
|
|
weight= InteractWeight.TP;
|
|
|
reultType = InteractReultType.TP;
|
|
|
+ // 2 * 0.3 * 10= 6
|
|
|
+ interactScore= studentScore==0 ? 1/(InteractWeight.TT-InteractWeight.T1) * (InteractWeight.TP-InteractWeight.T1) * questionScore : studentScore;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//作答错误
|
|
|
weight= InteractWeight.T1;
|
|
|
reultType = InteractReultType.T1;
|
|
|
+ interactScore= studentScore;
|
|
|
}
|
|
|
}
|
|
|
//标准答案比作答结果少
|
|
@@ -553,6 +592,7 @@ namespace HTEX.Test.Controllers
|
|
|
//作答错误
|
|
|
weight= InteractWeight.T1;
|
|
|
reultType = InteractReultType.T1;
|
|
|
+ interactScore= studentScore;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -577,24 +617,29 @@ namespace HTEX.Test.Controllers
|
|
|
//完全正确
|
|
|
weight= InteractWeight.TT;
|
|
|
reultType = InteractReultType.TT;
|
|
|
+ interactScore= studentScore==0 ? questionScore : studentScore;
|
|
|
}
|
|
|
else if (hasT && hasF)
|
|
|
{
|
|
|
//部分正确
|
|
|
weight= InteractWeight.TP;
|
|
|
reultType = InteractReultType.TP;
|
|
|
+ // 2 * 0.3 * 10= 6
|
|
|
+ interactScore= studentScore==0 ? 1/(InteractWeight.TT-InteractWeight.T1) * (InteractWeight.TP-InteractWeight.T1) * questionScore : studentScore;
|
|
|
}
|
|
|
else if (!hasT && hasF)
|
|
|
{
|
|
|
//没有正确的,但有错误的,代表参与了
|
|
|
weight= InteractWeight.T1;
|
|
|
reultType = InteractReultType.T1;
|
|
|
+ interactScore= studentScore;
|
|
|
}
|
|
|
else if (!hasT && !hasF)
|
|
|
{
|
|
|
//没有正确的,也没有错误的,代表没有作答
|
|
|
weight= InteractWeight.T0;
|
|
|
reultType = InteractReultType.T0;
|
|
|
+ interactScore= studentScore;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -605,6 +650,7 @@ namespace HTEX.Test.Controllers
|
|
|
//完全正确
|
|
|
weight= InteractWeight.TT;
|
|
|
reultType = InteractReultType.TT;
|
|
|
+ interactScore= studentScore==0 ? questionScore : studentScore;
|
|
|
}
|
|
|
else
|
|
|
{ // 使用LINQ查询来判断是否有匹配的答案
|
|
@@ -614,43 +660,74 @@ namespace HTEX.Test.Controllers
|
|
|
//主观题回答正确即为完全正确
|
|
|
weight= InteractWeight.TT;
|
|
|
reultType = InteractReultType.TT;
|
|
|
+ interactScore= studentScore==0 ? questionScore : studentScore;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
//优先根据得分与标准分的占比算出得分率,如果没有得分率,如果是直接从互动,不知道是评测的 需要先去评测找作答得分。,则采用Levenshtein距离来评估两个字符串的相似度
|
|
|
//没有匹配上答案,则采用Levenshtein距离来评估两个字符串的相似度
|
|
|
- var sc = CalculateSimilarity(answers![0], ans0[0]) * 1.0/100 *(InteractWeight.TT-InteractWeight.T1);
|
|
|
- weight = sc;
|
|
|
- reultType = InteractReultType.TP;
|
|
|
+ if (questionScore>0)
|
|
|
+ {
|
|
|
+ if (studentScore>0)
|
|
|
+ {
|
|
|
+ weight = studentScore * 1.0 / questionScore* (InteractWeight.TT-InteractWeight.T1);
|
|
|
+ if (weight==InteractWeight.T1)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.T1;
|
|
|
+ interactScore=studentScore;
|
|
|
+ }
|
|
|
+ else if (weight>InteractWeight.TT)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.TT;
|
|
|
+ interactScore=studentScore==0? questionScore:studentScore;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.TP;
|
|
|
+ // 2 * 0.3 * 10= 6
|
|
|
+ interactScore= studentScore==0 ? 1/(InteractWeight.TT-InteractWeight.T1) * (InteractWeight.TP-InteractWeight.T1) * questionScore : studentScore;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ weight=InteractWeight.T1+(CalculateSimilarity(answers![0], ans0[0]) *(InteractWeight.TT-InteractWeight.T1));
|
|
|
+ if (weight==InteractWeight.T1)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.T1;
|
|
|
+ interactScore=studentScore;
|
|
|
+ }
|
|
|
+ else if (weight>InteractWeight.TT)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.TT;
|
|
|
+ interactScore=studentScore==0? questionScore:studentScore;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.TP;
|
|
|
+ // 2 * 0.3 * 10= 6
|
|
|
+ interactScore= studentScore==0 ? 1/(InteractWeight.TT-InteractWeight.T1) * (InteractWeight.TP-InteractWeight.T1) * questionScore : studentScore;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+
|
|
|
+ weight=InteractWeight.T1+(CalculateSimilarity(answers![0], ans0[0]) *(InteractWeight.TT-InteractWeight.T1));
|
|
|
+ if (weight==InteractWeight.T1)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.T1;
|
|
|
+ interactScore=studentScore;
|
|
|
+ }
|
|
|
+ else if (weight>InteractWeight.TT)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.TT;
|
|
|
+ interactScore=studentScore==0? questionScore:studentScore;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ reultType = InteractReultType.TP;
|
|
|
+ // 2 * 0.3 * 10= 6
|
|
|
+ interactScore= studentScore==0 ? 1/(InteractWeight.TT-InteractWeight.T1) * (InteractWeight.TP-InteractWeight.T1) * questionScore : studentScore;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -661,11 +738,12 @@ namespace HTEX.Test.Controllers
|
|
|
//没有作答
|
|
|
weight= InteractWeight.T0;
|
|
|
reultType = InteractReultType.T0;
|
|
|
+ interactScore=studentScore;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //没有答案的情况
|
|
|
+ //没有标准答案的情况
|
|
|
if (ans0.IsNotEmpty())
|
|
|
{
|
|
|
bool hasAns = false;
|
|
@@ -679,22 +757,45 @@ namespace HTEX.Test.Controllers
|
|
|
//作答了
|
|
|
weight= InteractWeight.T1;
|
|
|
reultType = InteractReultType.T1;
|
|
|
+ interactScore=studentScore;
|
|
|
}
|
|
|
else {
|
|
|
//没有作答
|
|
|
weight= InteractWeight.T0;
|
|
|
reultType = InteractReultType.T0;
|
|
|
+ interactScore=studentScore;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//没有作答
|
|
|
weight= InteractWeight.T0;
|
|
|
reultType = InteractReultType.T0;
|
|
|
+ interactScore=studentScore;
|
|
|
+ }
|
|
|
+ //如果教师手动给了分或AI评分
|
|
|
+ if (questionScore>0 && studentScore>0)
|
|
|
+ {
|
|
|
+ weight = studentScore * 1.0 / questionScore* (InteractWeight.TT-InteractWeight.T1);
|
|
|
+ if (weight==InteractWeight.T1)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.T1;
|
|
|
+ interactScore=studentScore;
|
|
|
+ }
|
|
|
+ else if (weight>InteractWeight.TT)
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.TT;
|
|
|
+ interactScore=studentScore==0 ? questionScore : studentScore;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ reultType = InteractReultType.TP;
|
|
|
+ // 2 * 0.3 * 10= 6
|
|
|
+ interactScore= studentScore==0 ? 1/(InteractWeight.TT-InteractWeight.T1) * (InteractWeight.TP-InteractWeight.T1) * questionScore : studentScore;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- return (weight,reultType);
|
|
|
+ return (weight,reultType,interactScore);
|
|
|
}
|
|
|
#region C# 代码 如何判断两句话是否一个意思,非机器学习的算法。使用Levenshtein距离来评估两个字符串的相似度,但是不能判断它们是否表达了同一个意思,后续借助AI实现
|
|
|
public static double CalculateSimilarity(string s1, string s2)
|
|
@@ -721,7 +822,7 @@ namespace HTEX.Test.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return (1.0 - ((double)d[n, m] / Math.Max(s1.Length, s2.Length))) * 100;
|
|
|
+ return (1.0 - ((double)d[n, m] / Math.Max(s1.Length, s2.Length))) ;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -782,9 +883,8 @@ namespace HTEX.Test.Controllers
|
|
|
|
|
|
var student = studentLessonDatas.Find(x => x.id!.Equals(item.studentIds[index]));
|
|
|
|
|
|
- if (student!=null)
|
|
|
+ if (student!=null && student.attend==1)
|
|
|
{
|
|
|
-
|
|
|
//是否要判断主观题或者客观题, 多套试卷,有主观题的
|
|
|
//,如果没获得结果,
|
|
|
//主观题有回答的:608942756458532864\Clients\18782481024\Ans\27-4341670635487887360-examExchangeAnswerlist
|
|
@@ -799,20 +899,20 @@ namespace HTEX.Test.Controllers
|
|
|
stu.ForEach(ans =>
|
|
|
{
|
|
|
bool objective = objectiveTypes.Contains(examData.exam.papers[0].type[itemIndex]);
|
|
|
- var score = examData.exam.papers[0].point[itemIndex];
|
|
|
+ var questionScore = examData.exam.papers[0].point[itemIndex];
|
|
|
string type = examData.exam.papers[0].type[itemIndex];
|
|
|
- var res= GetInteractResultHasAnswer(answers[itemIndex], ans, objective, type);
|
|
|
+ var res= GetInteractResultHasAnswer(answers[itemIndex], ans, objective, type, questionScore, studentScore[itemIndex]);
|
|
|
ItemRecord interactRecord = new ItemRecord()
|
|
|
{
|
|
|
- interactType="SPQStrt",//类型
|
|
|
+ itemType="SPQStrt",//类型
|
|
|
resultType=res.reultType,//作答结果类型
|
|
|
resultWeight=res.weight,//得分权重
|
|
|
- criterion= score,//标准分
|
|
|
- interactScore= studentScore[itemIndex]//得分
|
|
|
+ criterion= questionScore,//标准分
|
|
|
+ itemScore= studentScore[itemIndex]//得分
|
|
|
};
|
|
|
answerRecords.Add(interactRecord);
|
|
|
});
|
|
|
- studentExam.score= answerRecords.Where(x => x.interactScore>=0).Select(x => x.interactScore).Sum();//得分
|
|
|
+ studentExam.score= answerRecords.Where(x => x.itemScore>=0).Select(x => x.itemScore).Sum();//得分
|
|
|
studentExam.scoreRate= allocation.HasValue && allocation.Value>0 ? studentExam.score * 1.0/allocation.Value : 0;//得分率
|
|
|
studentExam.answerRate= answerRecords.Where(x => x.resultWeight>0).Count()*1.0/studentScore.Count();//作答率
|
|
|
studentExam.examId=examData.exam.id;
|
|
@@ -843,10 +943,10 @@ namespace HTEX.Test.Controllers
|
|
|
foreach (var key in keys)
|
|
|
{
|
|
|
var student = studentLessonDatas.Find(x => x.seatID!.Equals(key));
|
|
|
- if (student!=null)
|
|
|
+ if (student!=null && student.attend==1)
|
|
|
{
|
|
|
- var score = coworkData.participateLevelList[key];
|
|
|
- var itemRecord = new ItemRecord { criterion=-1, interactType= coworkData.coworkType,interactScore=score };
|
|
|
+ var score = coworkData.participateLevelList[key];//协作得分
|
|
|
+ var itemRecord = new ItemRecord { criterion=-1, itemType= coworkData.coworkType,itemScore=score };
|
|
|
if (score>0)
|
|
|
{
|
|
|
itemRecord.resultWeight = InteractWeight.T1;
|
|
@@ -872,14 +972,52 @@ namespace HTEX.Test.Controllers
|
|
|
/// <param name="taskDatas"></param>
|
|
|
/// <param name="studentLessonDatas"></param>
|
|
|
/// <returns></returns>
|
|
|
- private async Task<dynamic> GetTaskData(LessonRecord lessonRecord, LessonBase lessonBase, TimeLineData timeLineData, List<TaskData> taskDatas, List<StudentLessonData> studentLessonDatas)
|
|
|
+ private List<StudentLessonData> GetTaskData(LessonRecord lessonRecord, LessonBase lessonBase, TimeLineData timeLineData, List<TaskData> taskDatas, List<StudentLessonData> studentLessonDatas)
|
|
|
{
|
|
|
//协作也算任务的一种,'WrkSpaceLoad' 作品收集, "isGroupItem": false,
|
|
|
- return Ok(lessonRecord);
|
|
|
+ int indexTask = 0;
|
|
|
+ foreach (var taskData in taskDatas)
|
|
|
+ {
|
|
|
+ //作品收集是全部人员都要参加
|
|
|
+ foreach (var student in studentLessonDatas)
|
|
|
+ {
|
|
|
+ if (student.attend==1)
|
|
|
+ {
|
|
|
+ var work = taskData.clientWorks.Find(x => x.seatID.Equals(student.seatID));
|
|
|
+ if (work!= null)
|
|
|
+ {
|
|
|
+ student.taskRecord.itemRecords.Add(new ItemRecord { itemType="WrkSpaceLoad", itemScore=10, resultWeight=InteractWeight.T1, resultType=InteractReultType.T1, isGroup= work.isGroupItem });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ student.taskRecord.itemRecords.Add(new ItemRecord { itemType="WrkSpaceLoad", itemScore=0, resultWeight=InteractWeight.T0, resultType=InteractReultType.T0, isGroup= false });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ////////
|
|
|
+ ///需要处理小组的情况,当前人员没有提交作品,但是有可能是小组其他人员提交了,需要判断一下。
|
|
|
+ ///
|
|
|
+ var groupIds = studentLessonDatas.FindAll(x => x.attend==1 && x.taskRecord.itemRecords[indexTask].isGroup==true).GroupBy(x=>x.groupId).Select(x=>x.Key);
|
|
|
+ foreach (var groupId in groupIds)
|
|
|
+ {
|
|
|
+ var groupStudents= studentLessonDatas.FindAll(x => x.attend==1 && !string.IsNullOrWhiteSpace(x.groupId) && x.groupId.Equals(groupId));
|
|
|
+ foreach (var student in groupStudents)
|
|
|
+ {
|
|
|
+ student.taskRecord.itemRecords[indexTask].isGroup=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ indexTask++;
|
|
|
+ }
|
|
|
+ return studentLessonDatas;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 评分参与率 态度计算
|
|
|
+ /// //读取互评信息
|
|
|
+ /// /// 评分相关 在SmartRating.json 处理 'SmartRating' 评分模式,分 投票Voting 和 GrandRating 星光大评分(All每人多件评分,Two随机分配互评, Self自评)
|
|
|
+ //Event 过滤类型 'RatingStart'
|
|
|
+ //smartRateSummary.mutualSummary.mutualType 互评【All(每人多件评分) Two(随机分配互评) Self(自评)】 smartRateSummary.meteor_VoteSummary 投票
|
|
|
+ //读取SmartRating.json
|
|
|
/// </summary>
|
|
|
/// <param name="lessonRecord"></param>
|
|
|
/// <param name="lessonBase"></param>
|