Commit accf11dc authored by 黄奎's avatar 黄奎

页面修改

parent f1ba8692
......@@ -139,5 +139,10 @@ namespace Edu.Model.ViewModel.Question
/// 排序类型(1-问题编号)
/// </summary>
public int OrderByType { get; set; }
/// <summary>
/// 问题编号
/// </summary>
public string QuestionIds { get; set; }
}
}
\ No newline at end of file
......@@ -1267,10 +1267,86 @@ namespace Edu.Module.Exam
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Practice_Extend> GetPracticeWrongPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_Practice_Extend query)
public List<object> GetPracticeWrongPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Student_Practice_Extend query)
{
List<object> result = new List<object>();
var list = student_PracticeRepository.GetStudentPracticePageRepository(pageIndex, pageSize, out rowsCount, query);
return list;
if (list != null && list.Count > 0)
{
string questionIds = string.Join(",", list.Select(qitem => qitem.QuestionId));
var questionList = questionRepository.GetQuestionListRepository(new RB_Question_ViewModel()
{
QuestionIds=questionIds
});
foreach (var item in list)
{
var tempQuestion = questionList.Where(qitem => qitem.QuestionId == item.QuestionId).FirstOrDefault();
var QuestionContentObj = analysisQuestion.ParsingQuestion(item.QuestionTypeKey, item.QuestionContent, isNoAnswer: false);
List<object> quesAnswerList = new List<object>();
if (tempQuestion.QuestionTypeKey == "listening" || tempQuestion.QuestionTypeKey == "reading-comprehensio")
{
try
{
var listenList = JsonHelper.DeserializeObject<List<SubAnswerItem>>(tempQuestion.Answer);
if (listenList != null && listenList.Count > 0)
{
foreach (var subItem in listenList)
{
quesAnswerList.Add(subItem.SubAnswer);
}
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_listening:" + Common.Plugin.JsonHelper.Serialize(item));
}
}
if (tempQuestion.QuestionTypeKey != "listening" && tempQuestion.QuestionTypeKey != "reading-comprehensio" && !string.IsNullOrEmpty(tempQuestion.Answer))
{
try
{
var tempList = Common.ConvertHelper.StringToFileList(tempQuestion.Answer);
if (tempList != null && tempList.Count > 0)
{
foreach (var tItem in tempList)
{
quesAnswerList.Add(tItem);
}
}
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetAppQuestionCategoryListModule_Answer:" + Common.Plugin.JsonHelper.Serialize(item));
}
}
List<string> studentAnswerList = new List<string>();
if (!string.IsNullOrEmpty(item?.StudentAnswer))
{
studentAnswerList = JsonHelper.DeserializeObject<List<string>>(item?.StudentAnswer);
}
var obj = new
{
item.Id,
item.QuestionId,
item.QuestionTypeId,
item.QuestionTypeKey,
item.Category,
item.LevelType,
item.Title,
item.AnswerParse,
QuestionContentObj,
QuestionAnswerList = quesAnswerList,
StudentAnswer = studentAnswerList,
item.Answer,
Score=0,
IsAnswer = item?.IsAnswer ?? 0,
IsWrong = item?.IsWrong ?? 0,
StudentScore = 0
};
result.Add(obj);
}
}
return result;
}
/// <summary>
......
......@@ -52,6 +52,10 @@ WHERE 1=1 AND B.Status=0
{
builder.AppendFormat(" AND B.{0}={1} ", nameof(RB_Question_ViewModel.BankType), (int)query.BankType);
}
if (!string.IsNullOrEmpty(query.QuestionIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.QuestionId), query.QuestionIds);
}
return Get<RB_Question_ViewModel>(builder.ToString()).ToList();
}
}
......
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