|
@@ -595,8 +595,8 @@ namespace TEAMModelOS.FunctionV4
|
|
|
List<string> plId = new List<string>();
|
|
|
List<List<List<string>>> opth = new List<List<List<string>>>();
|
|
|
List<List<List<string>>> optl = new List<List<List<string>>>();
|
|
|
- await knowledgeCount(info, subject, _dingDing, no, classResults, rhwCount, rhw, rhlCount, rhl, _azureCosmos);
|
|
|
- await fieldCount(info, subject, _dingDing, no, classResults, rhwCount, rhw, rhlCount, rhl, _azureCosmos);
|
|
|
+ List<double> akp = await knowledgeCount(info, subject, _dingDing, no, classResults, rhwCount, rhw, rhlCount, rhl, _azureCosmos);
|
|
|
+ List<double> afp = await fieldCount(info, subject, _dingDing, no, classResults, rhwCount, rhw, rhlCount, rhl, _azureCosmos);
|
|
|
int PHCount = 0;
|
|
|
int PLCount = 0;
|
|
|
foreach (ExamClassResult classResult in classResults)
|
|
@@ -635,6 +635,8 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
result.phc = getMore(info, no, opth);
|
|
|
result.plc = getMore(info, no, optl);
|
|
|
+ result.afp = afp;
|
|
|
+ result.akp = akp;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -817,14 +819,16 @@ namespace TEAMModelOS.FunctionV4
|
|
|
return classLists;
|
|
|
}
|
|
|
|
|
|
- public static async Task knowledgeCount(ExamInfo info, ExamSubject subject, DingDing _dingDing, int no, List<ExamClassResult> classResults,
|
|
|
+ public static async Task<List<double>> knowledgeCount(ExamInfo info, ExamSubject subject, DingDing _dingDing, int no, List<ExamClassResult> classResults,
|
|
|
double rhwCount, double rhw, double rhlCount, double rhl, AzureCosmosFactory _azureCosmos)
|
|
|
{
|
|
|
+ List<double> akp = new();
|
|
|
try
|
|
|
{
|
|
|
int phcount = 0;
|
|
|
int plcount = 0;
|
|
|
//存放并去重知识点
|
|
|
+
|
|
|
HashSet<string> kname = new HashSet<string>();
|
|
|
if (info.papers[no].knowledge.Count > 0)
|
|
|
{
|
|
@@ -922,18 +926,51 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
//await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync(classResult, classResult.id, new Azure.Cosmos.PartitionKey($"{classResult.code}"));
|
|
|
}
|
|
|
- }
|
|
|
+ foreach (string k in knowledgeName)
|
|
|
+ {
|
|
|
+ double score = 0;
|
|
|
+ double allScore = 0;
|
|
|
+ int n = 0;
|
|
|
+ int count = 0;
|
|
|
+ foreach (ExamClassResult result in classResults)
|
|
|
+ {
|
|
|
+ if (result.subjectId.Equals(subject.id))
|
|
|
+ {
|
|
|
+ foreach (List<string> str in info.papers[no].knowledge)
|
|
|
+ {
|
|
|
+ if (str.Contains(k))
|
|
|
+ {
|
|
|
+ var itemPersent = str.Count > 0 ? 1 / Convert.ToDouble(str.Count) : 0;
|
|
|
+ allScore += info.papers[no].point.Count > 0 ? info.papers[no].point[n] * itemPersent : 0;
|
|
|
+
|
|
|
+ if (result.studentScores.Count > 0)
|
|
|
+ {
|
|
|
+ score += result.studentScores.Sum(r => r.Sum()) * itemPersent;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ n++;
|
|
|
+ }
|
|
|
|
|
|
+ count += result.studentIds.Count;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double per = count > 0 ? Math.Round(score / count, 2) : 0;
|
|
|
+ akp.Add(allScore > 0 ? Math.Round(per / allScore, 2) : 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return akp;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-{info.id}-评测知识点结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static async Task fieldCount(ExamInfo info, ExamSubject subject, DingDing _dingDing, int no, List<ExamClassResult> classResults,
|
|
|
+ public static async Task<List<double>> fieldCount(ExamInfo info, ExamSubject subject, DingDing _dingDing, int no, List<ExamClassResult> classResults,
|
|
|
double rhwCount, double rhw, double rhlCount, double rhl, AzureCosmosFactory _azureCosmos)
|
|
|
{
|
|
|
+ List<double> afp = new();
|
|
|
try
|
|
|
{
|
|
|
int phcount = 0;
|
|
@@ -1022,10 +1059,43 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
//await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync(classResult, classResult.id, new Azure.Cosmos.PartitionKey($"{classResult.code}"));
|
|
|
}
|
|
|
+ for (int i = 0; i < knowledgeName.Count; i++)
|
|
|
+ {
|
|
|
+ double score = 0;
|
|
|
+ double allScore = 0;
|
|
|
+ int n = 0;
|
|
|
+ int count = 0;
|
|
|
+ foreach (ExamClassResult result in classResults)
|
|
|
+ {
|
|
|
+ if (result.subjectId.Equals(subject.id))
|
|
|
+ {
|
|
|
+ foreach (int str in info.papers[no].field)
|
|
|
+ {
|
|
|
+ if (str == knowledgeName[i])
|
|
|
+ {
|
|
|
+ var itemPersent = 1;
|
|
|
+ allScore += info.papers[no].point.Count > 0 ? info.papers[no].point[n] * itemPersent : 0;
|
|
|
+
|
|
|
+ if (result.studentScores.Count > 0)
|
|
|
+ {
|
|
|
+ score += result.studentScores.Sum(r => r.Sum()) * itemPersent;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ n++;
|
|
|
+ }
|
|
|
+
|
|
|
+ count += result.studentIds.Count;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ double per = count > 0 ? Math.Round(score / count, 2) : 0;
|
|
|
+ afp.Add(allScore > 0 ? Math.Round(per / allScore, 2) : 0);
|
|
|
+ }
|
|
|
+ return afp;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-{info.id}-评测认知层次结算异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|
|
|
//处理选题计数
|