Commit 84d3646c authored by liudong1993's avatar liudong1993

1

parent 27f3b25e
......@@ -39,11 +39,6 @@ namespace EduSpider.Model.Entity
/// </summary>
public string KnowledgePoint { get; set; }
/// <summary>
/// 归属模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 分数
/// </summary>
......
......@@ -52,11 +52,6 @@ namespace EduSpider.Model.Extend
/// </summary>
public string KnowledgePoint { get; set; }
/// <summary>
/// 归属模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 题目分数
/// </summary>
......
......@@ -96,7 +96,6 @@ namespace EduSpider.Services
foreach (var qitem in sExamModel.ScoreList) {
qitem.Difficulty = qlist.Where(x => x.Sort == qitem.Sort).FirstOrDefault()?.Difficulty ?? "";
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;
}
}
......@@ -120,12 +119,12 @@ namespace EduSpider.Services
x.QScore,
x.Score,
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),
}),
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),
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),
......@@ -209,7 +208,6 @@ namespace EduSpider.Services
ExamId = ExamId,
Difficulty = item.Difficulty,
KnowledgePoint = item.KnowledgePoint,
Module = item.Module,
Score = item.Score,
Sort = item.Id
});
......@@ -232,7 +230,7 @@ namespace EduSpider.Services
{
Sort = x.Id,
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,
Rank = Convert.ToInt32(clist.Where(x => x.Id == -2).FirstOrDefault()?.Score ?? 0),
......@@ -295,7 +293,6 @@ namespace EduSpider.Services
ExamId = ExamId,
Difficulty = item.Difficulty,
KnowledgePoint = item.KnowledgePoint,
Module = item.Module,
Score = item.Score,
Sort = item.Id
});
......
......@@ -34,8 +34,7 @@ namespace EduSpider.Utility.Data
Id = i,
Difficulty = dt.Rows[0][i.ToString()].ToString(),
KnowledgePoint = dt.Rows[1][i.ToString()].ToString(),
Module = dt.Rows[2][i.ToString()].ToString(),
Score = Convert.ToDecimal(dt.Rows[3][i.ToString()].ToString())
Score = Convert.ToDecimal(dt.Rows[2][i.ToString()].ToString())
});
}
else
......@@ -47,7 +46,7 @@ namespace EduSpider.Utility.Data
{
int totalCount = dt.Rows.Count;
//从第5行 开始 是学生
for (var i = 4; i < totalCount; i++)
for (var i = 3; i < totalCount; i++)
{
foreach (var item in EQList)
{
......@@ -107,11 +106,6 @@ namespace EduSpider.Utility.Data
/// </summary>
public string KnowledgePoint{ get; set; }
/// <summary>
/// 归属模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 分数
/// </summary>
......
......@@ -83,7 +83,7 @@ namespace EduSpider.WebApi.Controllers
int StuId = ReqParameters.GetInt("StuId");//学生id
int StuUId = ReqParameters.GetInt("StuUId");//学生Uid
if (ExamId <= 0 || StuId <= 0 || StuUId <= 0)
if (ExamId <= 0 || (StuId <= 0 && StuUId <= 0))
{
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