Commit 9ababc95 authored by 黄奎's avatar 黄奎

页面修改

parent b1cdb7a3
...@@ -14,5 +14,15 @@ namespace Edu.Model.ViewModel.Exam ...@@ -14,5 +14,15 @@ namespace Edu.Model.ViewModel.Exam
/// 考试编号【查询使用】 /// 考试编号【查询使用】
/// </summary> /// </summary>
public string QExamIds { get; set; } public string QExamIds { get; set; }
/// <summary>
/// 题库编号
/// </summary>
public int BankId { get; set; }
/// <summary>
/// 学员编号
/// </summary>
public int StudentId { get; set; }
} }
} }
...@@ -933,14 +933,20 @@ namespace Edu.Module.Exam ...@@ -933,14 +933,20 @@ namespace Edu.Module.Exam
/// <param name="rowsCount"></param> /// <param name="rowsCount"></param>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<object> GetAppBankDetailsPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Question_ViewModel query) public List<object> GetAppBankDetailsPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Question_ViewModel query,int StudentId=0)
{ {
List<object> result = new List<object>(); List<object> result = new List<object>();
var questionList = questionRepository.GetQuestionPageListRepository(pageIndex, pageSize, out rowsCount, query)?.OrderBy(qitem=>qitem.Category)?.ToList(); var questionList = questionRepository.GetQuestionPageListRepository(pageIndex, pageSize, out rowsCount, query)?.OrderBy(qitem=>qitem.Category)?.ToList();
List<RB_Student_ExamDetails_Extend> stuExamList = new List<RB_Student_ExamDetails_Extend>();
if (StudentId > 0)
{
stuExamList=student_ExamDetailsRepository.GetStudentExamDetailsListRepository(new RB_Student_ExamDetails_Extend() { BankId = query.BankId, StudentId = StudentId });
}
if (questionList != null && questionList.Count > 0) if (questionList != null && questionList.Count > 0)
{ {
foreach (var item in questionList) foreach (var item in questionList)
{ {
var tempQuestion = stuExamList?.FirstOrDefault(qitem => qitem.QuestionId == item.QuestionId);
decimal Score = 5; decimal Score = 5;
var QuestionContentObj = analysisQuestion.ParsingQuestion(item.QuestionTypeKey, item.QuestionContent, isNoAnswer: true); var QuestionContentObj = analysisQuestion.ParsingQuestion(item.QuestionTypeKey, item.QuestionContent, isNoAnswer: true);
List<object> quesAnswerList = new List<object>(); List<object> quesAnswerList = new List<object>();
...@@ -999,6 +1005,10 @@ namespace Edu.Module.Exam ...@@ -999,6 +1005,10 @@ namespace Edu.Module.Exam
StundetAnswer = new List<string>(), StundetAnswer = new List<string>(),
item.Answer, item.Answer,
Score, Score,
StudentAnswer= tempQuestion?.StudentAnswer??"",
IsAnswer=tempQuestion?.IsAnswer??0,
IsWrong= tempQuestion?.IsWrong??0,
StudentScore = tempQuestion?.StudentScore ?? 0,
}; };
result.Add(obj); result.Add(obj);
} }
......
...@@ -25,17 +25,7 @@ SELECT A.* ...@@ -25,17 +25,7 @@ SELECT A.*
FROM RB_Student_ExamDetails AS A FROM RB_Student_ExamDetails AS A
WHERE 1=1 WHERE 1=1
"); ");
if (query != null) builder.AppendFormat(@" AND ExamId IN(SELECT MAX(id) FROM rb_student_exam WHERE StudentId IN({0}) AND BankId={1} AND Score>0) ", query.StudentId, query.BankId);
{
if (query.ExamId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Student_ExamDetails_Extend.ExamId), query.ExamId);
}
if (!string.IsNullOrEmpty(query.QExamIds))
{
builder.AppendFormat(@" AND A.{0} IN ({1}) ", nameof(RB_Student_ExamDetails_Extend.ExamId), query.QExamIds);
}
}
return Get<RB_Student_ExamDetails_Extend>(builder.ToString()).ToList(); return Get<RB_Student_ExamDetails_Extend>(builder.ToString()).ToList();
} }
......
...@@ -1103,7 +1103,8 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -1103,7 +1103,8 @@ namespace Edu.WebApi.Controllers.Exam
{ {
BankId = base.ParmJObj.GetInt("BankId"), BankId = base.ParmJObj.GetInt("BankId"),
}; };
var list = courseExamModule.GetAppBankDetailsPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); int StudentId = base.ParmJObj.GetInt("StudentId");
var list = courseExamModule.GetAppBankDetailsPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query, StudentId: StudentId);
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
pageModel.PageData = list; pageModel.PageData = list;
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
......
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