Commit 84d3646c authored by liudong1993's avatar liudong1993

1

parent 27f3b25e
...@@ -39,11 +39,6 @@ namespace EduSpider.Model.Entity ...@@ -39,11 +39,6 @@ namespace EduSpider.Model.Entity
/// </summary> /// </summary>
public string KnowledgePoint { get; set; } public string KnowledgePoint { get; set; }
/// <summary>
/// 归属模块
/// </summary>
public string Module { get; set; }
/// <summary> /// <summary>
/// 分数 /// 分数
/// </summary> /// </summary>
......
...@@ -52,11 +52,6 @@ namespace EduSpider.Model.Extend ...@@ -52,11 +52,6 @@ namespace EduSpider.Model.Extend
/// </summary> /// </summary>
public string KnowledgePoint { get; set; } public string KnowledgePoint { get; set; }
/// <summary>
/// 归属模块
/// </summary>
public string Module { get; set; }
/// <summary> /// <summary>
/// 题目分数 /// 题目分数
/// </summary> /// </summary>
......
...@@ -96,7 +96,6 @@ namespace EduSpider.Services ...@@ -96,7 +96,6 @@ namespace EduSpider.Services
foreach (var qitem in sExamModel.ScoreList) { foreach (var qitem in sExamModel.ScoreList) {
qitem.Difficulty = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.Difficulty ?? ""; qitem.Difficulty = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.Difficulty ?? "";
qitem.KnowledgePoint = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.KnowledgePoint ?? ""; qitem.KnowledgePoint = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.KnowledgePoint ?? "";
qitem.Module = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.Module ?? "";
qitem.QScore = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.Score ?? 0; qitem.QScore = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.Score ?? 0;
} }
} }
...@@ -120,12 +119,12 @@ namespace EduSpider.Services ...@@ -120,12 +119,12 @@ namespace EduSpider.Services
x.QScore, x.QScore,
x.Score, x.Score,
ScoreRate = Math.Round(x.Score / x.QScore, 2, MidpointRounding.AwayFromZero), ScoreRate = Math.Round(x.Score / x.QScore, 2, MidpointRounding.AwayFromZero),
x.AvgScore, AvgScore = Math.Round(x.AvgScore, 6, MidpointRounding.AwayFromZero),
AvgScoreRate = Math.Round(x.AvgScore / x.QScore, 2, MidpointRounding.AwayFromZero), AvgScoreRate = Math.Round(x.AvgScore / x.QScore, 2, MidpointRounding.AwayFromZero),
}), }),
ModuleList = sExamModel?.ScoreList.GroupBy(x => new { x.Module }).Select(x => new ModuleList = sExamModel?.ScoreList.GroupBy(x => new { x.KnowledgePoint }).Select(x => new
{ {
x.Key.Module, Module = x.Key.KnowledgePoint,
Score = x.Sum(y => y.QScore), Score = x.Sum(y => y.QScore),
ScoreRate = Math.Round(x.Sum(y => y.Score) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero), ScoreRate = Math.Round(x.Sum(y => y.Score) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero),
AvgScoreRate = Math.Round(x.Sum(y => y.AvgScore) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero), AvgScoreRate = Math.Round(x.Sum(y => y.AvgScore) / x.Sum(y => y.QScore), 2, MidpointRounding.AwayFromZero),
...@@ -209,7 +208,6 @@ namespace EduSpider.Services ...@@ -209,7 +208,6 @@ namespace EduSpider.Services
ExamId = ExamId, ExamId = ExamId,
Difficulty = item.Difficulty, Difficulty = item.Difficulty,
KnowledgePoint = item.KnowledgePoint, KnowledgePoint = item.KnowledgePoint,
Module = item.Module,
Score = item.Score, Score = item.Score,
Sort = item.Id Sort = item.Id
}); });
...@@ -232,7 +230,7 @@ namespace EduSpider.Services ...@@ -232,7 +230,7 @@ namespace EduSpider.Services
{ {
Sort = x.Id, Sort = x.Id,
x.Score, x.Score,
AvgScore = AvgList.Where(y => y.Id == x.Id).FirstOrDefault()?.Score ?? 0 AvgScore = Math.Round(AvgList.Where(y => y.Id == x.Id).FirstOrDefault()?.Score ?? 0, 6, MidpointRounding.AwayFromZero)
})), })),
TScore = clist.Where(x => x.Id == -1).FirstOrDefault()?.Score ?? 0, TScore = clist.Where(x => x.Id == -1).FirstOrDefault()?.Score ?? 0,
Rank = Convert.ToInt32(clist.Where(x => x.Id == -2).FirstOrDefault()?.Score ?? 0), Rank = Convert.ToInt32(clist.Where(x => x.Id == -2).FirstOrDefault()?.Score ?? 0),
...@@ -295,7 +293,6 @@ namespace EduSpider.Services ...@@ -295,7 +293,6 @@ namespace EduSpider.Services
ExamId = ExamId, ExamId = ExamId,
Difficulty = item.Difficulty, Difficulty = item.Difficulty,
KnowledgePoint = item.KnowledgePoint, KnowledgePoint = item.KnowledgePoint,
Module = item.Module,
Score = item.Score, Score = item.Score,
Sort = item.Id Sort = item.Id
}); });
......
...@@ -34,8 +34,7 @@ namespace EduSpider.Utility.Data ...@@ -34,8 +34,7 @@ namespace EduSpider.Utility.Data
Id = i, Id = i,
Difficulty = dt.Rows[0][i.ToString()].ToString(), Difficulty = dt.Rows[0][i.ToString()].ToString(),
KnowledgePoint = dt.Rows[1][i.ToString()].ToString(), KnowledgePoint = dt.Rows[1][i.ToString()].ToString(),
Module = dt.Rows[2][i.ToString()].ToString(), Score = Convert.ToDecimal(dt.Rows[2][i.ToString()].ToString())
Score = Convert.ToDecimal(dt.Rows[3][i.ToString()].ToString())
}); });
} }
else else
...@@ -47,7 +46,7 @@ namespace EduSpider.Utility.Data ...@@ -47,7 +46,7 @@ namespace EduSpider.Utility.Data
{ {
int totalCount = dt.Rows.Count; int totalCount = dt.Rows.Count;
//从第5行 开始 是学生 //从第5行 开始 是学生
for (var i = 4; i < totalCount; i++) for (var i = 3; i < totalCount; i++)
{ {
foreach (var item in EQList) foreach (var item in EQList)
{ {
...@@ -107,11 +106,6 @@ namespace EduSpider.Utility.Data ...@@ -107,11 +106,6 @@ namespace EduSpider.Utility.Data
/// </summary> /// </summary>
public string KnowledgePoint{ get; set; } public string KnowledgePoint{ get; set; }
/// <summary>
/// 归属模块
/// </summary>
public string Module { get; set; }
/// <summary> /// <summary>
/// 分数 /// 分数
/// </summary> /// </summary>
......
...@@ -83,7 +83,7 @@ namespace EduSpider.WebApi.Controllers ...@@ -83,7 +83,7 @@ namespace EduSpider.WebApi.Controllers
int StuId = ReqParameters.GetInt("StuId");//学生id int StuId = ReqParameters.GetInt("StuId");//学生id
int StuUId = ReqParameters.GetInt("StuUId");//学生Uid int StuUId = ReqParameters.GetInt("StuUId");//学生Uid
if (ExamId <= 0 || StuId <= 0 || StuUId <= 0) if (ExamId <= 0 || (StuId <= 0 && StuUId <= 0))
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment