Commit f3c08132 authored by 黄奎's avatar 黄奎

页面修改

parent edba8fbe
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using Edu.Repository.Exam; using Edu.Repository.Exam;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Edu.Module.Exam namespace Edu.Module.Exam
...@@ -18,15 +19,20 @@ namespace Edu.Module.Exam ...@@ -18,15 +19,20 @@ namespace Edu.Module.Exam
private readonly RB_Examination_StudentDetailsRepository examination_StudentDetailsRepository = new RB_Examination_StudentDetailsRepository(); private readonly RB_Examination_StudentDetailsRepository examination_StudentDetailsRepository = new RB_Examination_StudentDetailsRepository();
/// <summary> /// <summary>
/// 自动阅卷处理类 /// 自动阅卷方法
/// </summary> /// </summary>
/// <param name="PaperId">试卷编号</param> /// <param name="PaperId">试卷编号</param>
/// <param name="PublishId">发布编号</param> /// <param name="PublishId">发布编号</param>
/// <param name="GuestId">学员编号</param> /// <param name="GuestId">学员编号</param>
/// <returns></returns> /// <returns></returns>
public bool AutoReviewPaperModule(int PaperId,int PublishId,int GuestId) public bool AutoReviewPaperModule(int PaperId, int PublishId, int GuestId)
{ {
bool flag = false; bool flag = false;
var paperConfig = examination_PublishRepository.GetEntity(PublishId);
//多选题未选全是否给一半的分
var IsHalfScore = paperConfig?.IsHalfScore ?? 0;
List<RB_Examination_StudentDetails_ViewModel> answerList = new List<RB_Examination_StudentDetails_ViewModel>();
//试卷题目 //试卷题目
var sourceQuestionList = examination_DetailsRepository.GetExaminationDetailsListRepository(new RB_Examination_Details_ViewModel() { PaperId = PaperId }); var sourceQuestionList = examination_DetailsRepository.GetExaminationDetailsListRepository(new RB_Examination_Details_ViewModel() { PaperId = PaperId });
//学员提交答案列表 //学员提交答案列表
...@@ -39,12 +45,22 @@ namespace Edu.Module.Exam ...@@ -39,12 +45,22 @@ namespace Edu.Module.Exam
if (sourceQuestionList != null && sourceQuestionList.Count > 0) if (sourceQuestionList != null && sourceQuestionList.Count > 0)
{ {
foreach (var sItem in sourceQuestionList) foreach (var sItem in sourceQuestionList)
{
var answerModel = stuQuesList?.Where(qitem => qitem.DetailsId == sItem.Id)?.FirstOrDefault();
if (answerModel != null && answerModel.Id > 0)
{ {
switch (sItem.QuestionTypeKey) switch (sItem.QuestionTypeKey)
{ {
//单选题 //单选题
case "single": case "single":
if (sItem.Answer == answerModel.StundetAnswer)
{
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StundetScore = sItem.Score
});
}
break; break;
//多选题 //多选题
case "multiple": case "multiple":
...@@ -56,7 +72,14 @@ namespace Edu.Module.Exam ...@@ -56,7 +72,14 @@ namespace Edu.Module.Exam
break; break;
//判断题 //判断题
case "judge": case "judge":
if (sItem.Answer == answerModel.StundetAnswer)
{
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StundetScore = sItem.Score
});
}
break; break;
//简答题 //简答题
case "short-answer": case "short-answer":
...@@ -84,11 +107,25 @@ namespace Edu.Module.Exam ...@@ -84,11 +107,25 @@ namespace Edu.Module.Exam
break; break;
//连线题 //连线题
case "matching": case "matching":
if (sItem.Answer == answerModel.StundetAnswer)
{
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StundetScore = sItem.Score
});
}
break; break;
//排序题 //排序题
case "sorting-problem": case "sorting-problem":
if (sItem.Answer == answerModel.StundetAnswer)
{
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StundetScore = sItem.Score
});
}
break; break;
//完型填空 //完型填空
case "cloze": case "cloze":
...@@ -116,11 +153,19 @@ namespace Edu.Module.Exam ...@@ -116,11 +153,19 @@ namespace Edu.Module.Exam
break; break;
//单选题-数字 //单选题-数字
case "single-number": case "single-number":
if (sItem.Answer == answerModel.StundetAnswer)
{
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StundetScore = sItem.Score
});
}
break; break;
} }
} }
} }
}
return flag; return flag;
} }
} }
......
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