Commit e8f58330 authored by 黄奎's avatar 黄奎

知识点修改

parent 2b1af9b0
using Edu.Model.Entity.Exam;
using Edu.Model.ViewModel.Question;
using System;
using System.Collections.Generic;
using System.Text;
......@@ -29,5 +30,10 @@ namespace Edu.Model.ViewModel.Exam
/// 问题数量
/// </summary>
public int QuestionCount { get; set; }
/// <summary>
/// 知识点
/// </summary>
public List<RB_Question_Point_ViewModel> QuestionPointList { get; set; }
}
}
......@@ -69,6 +69,11 @@ namespace Edu.Module.Exam
/// </summary>
private readonly Repository.EduTask.RB_Education_ReceiptRepository education_ReceiptRepository = new Repository.EduTask.RB_Education_ReceiptRepository();
/// <summary>
/// 知识点仓储层对象
/// </summary>
private readonly RB_Question_PointRepository question_PointRepository = new RB_Question_PointRepository();
/// <summary>
/// 获取试卷分页列表
/// </summary>
......@@ -539,6 +544,20 @@ namespace Edu.Module.Exam
});
if (extModel.GroupList != null && extModel.GroupList.Count > 0 && detailsList != null && detailsList.Count > 0)
{
List<int> pointsList = new List<int>();
var tempPoints = Common.ConvertHelper.StringToList(string.Join(",", detailsList?.Where(qitem => !string.IsNullOrEmpty(qitem.Knowledge))?.Select(qitem => qitem.Knowledge)));
if (tempPoints != null && tempPoints.Count > 0)
{
pointsList.AddRange(tempPoints);
}
List<RB_Question_Point_ViewModel> pointList = new List<RB_Question_Point_ViewModel>();
if (pointsList != null && pointsList.Count > 0)
{
pointList = question_PointRepository.GetPointListRepository(new RB_Question_Point_ViewModel()
{
QPointIds = string.Join(",", pointsList)
});
}
foreach (var gItem in extModel.GroupList)
{
gItem.DetailsList = detailsList?.Where(qitem => qitem.QuestionTypeId == gItem.QuestionTypeId)?.OrderBy(qitem => qitem.SortNum)?.ToList() ?? new List<RB_Examination_Details_ViewModel>();
......@@ -547,6 +566,7 @@ namespace Edu.Module.Exam
gItem.GScore = gItem?.DetailsList?.Sum(qitem => qitem.Score) ?? 0;
foreach (var sItem in gItem.DetailsList)
{
sItem.QuestionPointList = pointList?.Where(qitem => sItem.Knowledge.Contains(qitem.PointId.ToString()))?.ToList() ?? new List<RB_Question_Point_ViewModel>();
sItem.QuestionContentObj = analysisQuestion.ParsingQuestion(sItem.QuestionTypeKey, sItem.QuestionContent);
string newTitle = sItem.Title;
try
......
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