Commit 327924bc authored by 吴春's avatar 吴春

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 96575919 33ce1603
......@@ -632,8 +632,9 @@ namespace Edu.Module.Exam
/// 根据试卷编号获取试卷实体
/// </summary>
/// <param name="PaperId"></param>
/// <param name="isShowAnswer">是否查询答案</param>
/// <returns></returns>
public RB_Examination_Paper_ViewModel GetExaminationPaperModule(object PaperId)
public RB_Examination_Paper_ViewModel GetExaminationPaperModule(object PaperId,bool isShowAnswer=true)
{
// 定义正则表达式用来匹配 img 标签
string str = @"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?<imgUrl>[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>";
......@@ -673,6 +674,11 @@ namespace Edu.Module.Exam
gItem.GScore = gItem?.DetailsList?.Sum(qitem => qitem.Score) ?? 0;
foreach (var sItem in gItem.DetailsList)
{
if (!isShowAnswer)
{
sItem.Answer = "";
sItem.AnswerParse = "";
}
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;
......
......@@ -536,7 +536,17 @@ namespace Edu.WebApi.Controllers.Applet
item.ExamStatusStr = "已开始";
}
}
pageModel.PageData = list.Select(x => new { x.PaperId, x.Id, x.PaperName, x.PublishPic, ExamStartTime= x.ExamStartTime.ToString("yyyy-MM-dd HH:mm:ss"), x.ExamStatus, x.ExamStatusStr });
pageModel.PageData = list.Select(x => new {
x.PaperId,
x.Id,
x.PaperName,
x.PublishPic,
ExamStartTime=Common.ConvertHelper.FormatTime(x.ExamStartTime),
ExamEndTime = Common.ConvertHelper.FormatTime(x.ExamEndTime),
x.ExamTimes,
x.ExamStatus,
x.ExamStatusStr
});
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
......@@ -552,8 +562,7 @@ namespace Edu.WebApi.Controllers.Applet
var PaperId = base.ParmJObj.GetInt("PaperId");
var Id = base.ParmJObj.GetInt("Id");
var modelPublish = paperModule.GetExaminationPublishModule(Id);
var modelPaper = paperModule.GetExaminationPaperModule(PaperId);
var modelPaper = paperModule.GetExaminationPaperModule(PaperId, isShowAnswer: false);
return ApiResult.Success(data: new{ Publish= modelPublish, Paper = modelPaper });
}
#endregion
......
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