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; }
} }
} }
...@@ -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
}); });
} }
} }
...@@ -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)
{ {
...@@ -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);
...@@ -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();
...@@ -1189,13 +1189,13 @@ namespace Edu.Module.Exam ...@@ -1189,13 +1189,13 @@ namespace Edu.Module.Exam
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
...@@ -1241,6 +1241,21 @@ namespace Edu.Module.Exam ...@@ -1241,6 +1241,21 @@ namespace Edu.Module.Exam
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