|
|
|
@ -1406,7 +1406,7 @@ public class Ghre_CourseServices : BaseServices<Ghre_Course, Ghre_CourseDto, Ins |
|
|
|
|
|
|
|
|
|
var sql1 = GetQueryString(sql, filter.pageNum, filter.pageSize, filter.orderBy); |
|
|
|
|
|
|
|
|
|
var data = DbAccess.QueryList<CourseAndScene>(sql1); |
|
|
|
|
var data = DbAccess.QueryList<CourseAndScene>(sql1); |
|
|
|
|
|
|
|
|
|
totalCount = await Db.Ado.GetIntAsync("SELECT COUNT(0) from Ghre_CourseScene_V A WHERE 1=1"); |
|
|
|
|
|
|
|
|
@ -1558,7 +1558,6 @@ public class Ghre_CourseServices : BaseServices<Ghre_Course, Ghre_CourseDto, Ins |
|
|
|
|
b.PaperName |
|
|
|
|
}) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
var examRanking = new JArray(); |
|
|
|
|
var examRankings = new JArray(); |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < exams.Count; i++) |
|
|
|
@ -1596,6 +1595,42 @@ public class Ghre_CourseServices : BaseServices<Ghre_Course, Ghre_CourseDto, Ins |
|
|
|
|
data.ExamRankings = examRankings; |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region 错误率排名 |
|
|
|
|
|
|
|
|
|
var questionErrorRankings = await Db.Queryable<Ghre_Question>() |
|
|
|
|
.Where(x => x.CourseId == id || x.CourseIds.Contains(id.ToString())) |
|
|
|
|
.Select(x => new QuestionErrorRanking |
|
|
|
|
{ |
|
|
|
|
Id = x.Id, |
|
|
|
|
QuestionNo = x.QuestionNo, |
|
|
|
|
QuestionContent = x.QuestionContent |
|
|
|
|
}) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
|
|
|
|
|
var questionIds = questionErrorRankings.Select(x => x.Id).ToList(); |
|
|
|
|
|
|
|
|
|
var recordDetails = await Db.Queryable<Ghre_ExamRecordDetail>() |
|
|
|
|
.Where(x => x.QuestionId != null && questionIds.Contains(x.QuestionId.Value)) |
|
|
|
|
.ToListAsync(); |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < questionErrorRankings.Count; i++) |
|
|
|
|
{ |
|
|
|
|
questionErrorRankings[i].TotalCount = recordDetails.Where(x => x.QuestionId == questionErrorRankings[i].Id).Count(); |
|
|
|
|
questionErrorRankings[i].ErrorCount = recordDetails.Where(x => x.QuestionId == questionErrorRankings[i].Id && x.IsCorrect != true).Count(); |
|
|
|
|
|
|
|
|
|
if (questionErrorRankings[i].ErrorCount > 0 && questionErrorRankings[i].TotalCount > 0) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
decimal? Percent1 = questionErrorRankings[i].ErrorCount / questionErrorRankings[i].TotalCount; |
|
|
|
|
questionErrorRankings[i].Percent1 = Percent1.TrimDecimalString(2); |
|
|
|
|
questionErrorRankings[i].Percent = Convert.ToDecimal((Percent1 * 100).TrimDecimalString(0)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
questionErrorRankings = questionErrorRankings.OrderByDescending(x => x.Percent).ToList(); |
|
|
|
|
data.QuestionErrorRankings = questionErrorRankings; |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
obj.Data = data; |
|
|
|
|
obj.Success = true; |
|
|
|
|
obj.Status = 200; |
|
|
|
|