Commit 7fa36a61 authored by 黄奎's avatar 黄奎

页面修改

parent 8ac2af28
...@@ -83,5 +83,10 @@ namespace Edu.Model.Entity.Exam ...@@ -83,5 +83,10 @@ namespace Edu.Model.Entity.Exam
/// 学生答案 /// 学生答案
/// </summary> /// </summary>
public string StudentAnswer { get; set; } public string StudentAnswer { get; set; }
/// <summary>
/// 是否复习
/// </summary>
public int IsReview { get; set; }
} }
} }
...@@ -838,7 +838,7 @@ namespace Edu.Module.Exam ...@@ -838,7 +838,7 @@ namespace Edu.Module.Exam
{ {
List<object> result = new List<object>(); List<object> result = new List<object>();
var list = student_ExamRepository.GetStudentExamStaticRepository(new RB_Student_Exam_Extend()); var list = student_ExamRepository.GetStudentExamStaticRepository(new RB_Student_Exam_Extend());
var bankTypeList = Common.Plugin.EnumHelper.EnumToList(typeof(LevelTypeEnum)); var bankTypeList = Common.Plugin.EnumHelper.EnumToList(typeof(LevelTypeEnum));
if (bankTypeList != null && bankTypeList.Count > 0) if (bankTypeList != null && bankTypeList.Count > 0)
{ {
foreach (var item in bankTypeList) foreach (var item in bankTypeList)
...@@ -850,7 +850,7 @@ namespace Edu.Module.Exam ...@@ -850,7 +850,7 @@ namespace Edu.Module.Exam
{ {
item.Id, item.Id,
item.Name, item.Name,
JoinNum= joinNum JoinNum = joinNum
}); });
} }
} }
...@@ -877,7 +877,7 @@ namespace Edu.Module.Exam ...@@ -877,7 +877,7 @@ namespace Edu.Module.Exam
{ {
stuExamList = student_ExamRepository.GetStudentExamListRepository(new RB_Student_Exam_Extend() stuExamList = student_ExamRepository.GetStudentExamListRepository(new RB_Student_Exam_Extend()
{ {
// GroupId = query.Group_Id, // GroupId = query.Group_Id,
QBankIds = bankIds QBankIds = bankIds
}); });
} }
...@@ -903,7 +903,7 @@ namespace Edu.Module.Exam ...@@ -903,7 +903,7 @@ namespace Edu.Module.Exam
{ {
MyUseTime = Common.ConvertHelper.CalcMinutesAndSeconds(myLast.StartTime, myLast.EndTime); MyUseTime = Common.ConvertHelper.CalcMinutesAndSeconds(myLast.StartTime, myLast.EndTime);
MyScore = myLast.Score; MyScore = myLast.Score;
MyRank = tempList.FindIndex(qitem => qitem.Id == myLast.Id)+1; MyRank = tempList.FindIndex(qitem => qitem.Id == myLast.Id) + 1;
} }
MyTimes = tempList?.Where(qitem => qitem.StudentId == query.StudentId)?.Count() ?? 0; MyTimes = tempList?.Where(qitem => qitem.StudentId == query.StudentId)?.Count() ?? 0;
} }
...@@ -933,14 +933,14 @@ namespace Edu.Module.Exam ...@@ -933,14 +933,14 @@ 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,int StudentId=0) 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>(); List<RB_Student_ExamDetails_Extend> stuExamList = new List<RB_Student_ExamDetails_Extend>();
if (StudentId > 0) if (StudentId > 0)
{ {
stuExamList=student_ExamDetailsRepository.GetStudentExamDetailsListRepository(new RB_Student_ExamDetails_Extend() { BankId = query.BankId, StudentId = StudentId }); 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)
{ {
...@@ -954,7 +954,7 @@ namespace Edu.Module.Exam ...@@ -954,7 +954,7 @@ namespace Edu.Module.Exam
{ {
try try
{ {
var listenList = JsonHelper.DeserializeObject<List<SubAnswerItem>>(item.Answer); var listenList = JsonHelper.DeserializeObject<List<SubAnswerItem>>(item.Answer);
if (listenList != null && listenList.Count > 0) if (listenList != null && listenList.Count > 0)
{ {
...@@ -1009,8 +1009,8 @@ namespace Edu.Module.Exam ...@@ -1009,8 +1009,8 @@ namespace Edu.Module.Exam
StudentAnswer = studentAnswerList, StudentAnswer = studentAnswerList,
item.Answer, item.Answer,
Score, Score,
IsAnswer=tempQuestion?.IsAnswer??0, IsAnswer = tempQuestion?.IsAnswer ?? 0,
IsWrong= tempQuestion?.IsWrong??0, IsWrong = tempQuestion?.IsWrong ?? 0,
StudentScore = tempQuestion?.StudentScore ?? 0, StudentScore = tempQuestion?.StudentScore ?? 0,
}; };
result.Add(obj); result.Add(obj);
...@@ -1019,7 +1019,7 @@ namespace Edu.Module.Exam ...@@ -1019,7 +1019,7 @@ namespace Edu.Module.Exam
return result; return result;
} }
/// <summary> /// <summary>
/// 新增修改学员练习 /// 新增修改学员练习
...@@ -1082,7 +1082,7 @@ namespace Edu.Module.Exam ...@@ -1082,7 +1082,7 @@ namespace Edu.Module.Exam
decimal totalScore = 0; decimal totalScore = 0;
if (model.ExamDetailsList != null && model.ExamDetailsList.Count > 0) if (model.ExamDetailsList != null && model.ExamDetailsList.Count > 0)
{ {
foreach (var item in model.ExamDetailsList) foreach (var item in model.ExamDetailsList)
{ {
item.ExamId = model.Id; item.ExamId = model.Id;
...@@ -1110,8 +1110,8 @@ namespace Edu.Module.Exam ...@@ -1110,8 +1110,8 @@ namespace Edu.Module.Exam
} }
} }
catch catch
{ {
} }
item.StudentScore = tempScore; item.StudentScore = tempScore;
} }
...@@ -1174,7 +1174,7 @@ namespace Edu.Module.Exam ...@@ -1174,7 +1174,7 @@ namespace Edu.Module.Exam
int wordsWrongFinishCount = 0; int wordsWrongFinishCount = 0;
int wordsWrongStartId = 0; int wordsWrongStartId = 0;
var list= student_PracticeRepository.GetStudentPracticeWrongStaticRepository(query); var list = student_PracticeRepository.GetStudentPracticeWrongStaticRepository(query);
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
var tempReadingList = list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ReadingChoose)?.ToList(); var tempReadingList = list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ReadingChoose)?.ToList();
...@@ -1182,23 +1182,23 @@ namespace Edu.Module.Exam ...@@ -1182,23 +1182,23 @@ namespace Edu.Module.Exam
{ {
readingWrongTotalCount = tempReadingList.Sum(qitem => qitem.WrongCount); readingWrongTotalCount = tempReadingList.Sum(qitem => qitem.WrongCount);
} }
var tempListeningList = list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.Listening)?.ToList(); var tempListeningList = list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.Listening)?.ToList();
if (tempListeningList != null && tempListeningList.Count > 0) if (tempListeningList != null && tempListeningList.Count > 0)
{ {
listeningWrongTotalCount = tempListeningList.Sum(qitem => qitem.WrongCount); listeningWrongTotalCount = tempListeningList.Sum(qitem => qitem.WrongCount);
} }
var tempGrammarList= list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseGrammarUse)?.ToList(); var tempGrammarList = list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseGrammarUse)?.ToList();
if (tempGrammarList != null && tempGrammarList.Count > 0) if (tempGrammarList != null && tempGrammarList.Count > 0)
{ {
grammarWrongTotalCount = tempGrammarList.Sum(qitem => qitem.WrongCount); grammarWrongTotalCount = tempGrammarList.Sum(qitem => qitem.WrongCount);
} }
var tempWordsList= list?.Where(qitem => var tempWordsList = list?.Where(qitem =>
qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWord qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWord
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseMean || qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseMean
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWordUse || qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWordUse
)?.ToList(); )?.ToList();
if (tempWordsList != null && tempWordsList.Count > 0) if (tempWordsList != null && tempWordsList.Count > 0)
{ {
...@@ -1235,12 +1235,27 @@ namespace Edu.Module.Exam ...@@ -1235,12 +1235,27 @@ namespace Edu.Module.Exam
{ {
var list = student_PracticeRepository.GetStudentPracticePageRepository(pageIndex, pageSize, out rowsCount, query); var list = student_PracticeRepository.GetStudentPracticePageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
} }
return list; return list;
} }
/// <summary>
/// 设置错题已复习
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetPracticeReviewModule(RB_Student_Practice_Extend model)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Practice_Extend.IsReview),model.IsReview }
};
bool flag = student_PracticeRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Practice_Extend.Id), model.Id));
return flag;
}
#endregion #endregion
} }
} }
...@@ -113,6 +113,10 @@ WHERE 1=1 ...@@ -113,6 +113,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Student_Practice_Extend.LevelType), (int)query.LevelType); builder.AppendFormat(" AND {0}={1} ", nameof(RB_Student_Practice_Extend.LevelType), (int)query.LevelType);
} }
if (!string.IsNullOrEmpty(query.QCategoryIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Student_Practice_Extend.Category), query.QCategoryIds);
}
} }
builder.AppendFormat(" GROUP BY Category "); builder.AppendFormat(" GROUP BY Category ");
return Get<RB_Student_Practice_Extend>(builder.ToString()).ToList(); return Get<RB_Student_Practice_Extend>(builder.ToString()).ToList();
......
...@@ -1242,6 +1242,7 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -1242,6 +1242,7 @@ namespace Edu.WebApi.Controllers.Exam
StudentId = base.ParmJObj.GetInt("StudentId"), StudentId = base.ParmJObj.GetInt("StudentId"),
LevelType = (LevelTypeEnum)base.ParmJObj.GetInt("LevelType"), LevelType = (LevelTypeEnum)base.ParmJObj.GetInt("LevelType"),
StartId=base.ParmJObj.GetInt("StartId"), StartId=base.ParmJObj.GetInt("StartId"),
QCategoryIds = base.ParmJObj.GetStringValue("QCategoryIds"),
}; };
query.IsQueryWrong = 1; query.IsQueryWrong = 1;
var list = courseExamModule.GetPracticeWrongPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = courseExamModule.GetPracticeWrongPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
...@@ -1249,6 +1250,23 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -1249,6 +1250,23 @@ namespace Edu.WebApi.Controllers.Exam
pageModel.PageData = list; pageModel.PageData = list;
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
/// <summary>
/// 设置错题复习
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowRepeat]
public ApiResult SetPracticeReview()
{
var model = new RB_Student_Practice_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
IsReview = 1
};
bool flag = courseExamModule.SetPracticeReviewModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion #endregion
} }
} }
\ No newline at end of file
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