Commit 080d989f authored by 黄奎's avatar 黄奎

页面修改

parent 9874320c
......@@ -73,6 +73,37 @@ namespace Edu.Model.ViewModel.Question
public List<optionItem> OptionList { get; set; }
}
/// <summary>
/// 完型填空、阅读理解、听力答案
/// </summary>
public class SubAnswerItem
{
/// <summary>
/// 小题编号
/// </summary>
public string SubQuestionId { get; set; }
/// <summary>
/// 小题问题类型
/// </summary>
public string SubQuestionKey { get; set; }
/// <summary>
/// 小题答案
/// </summary>
public string SubAnswer { get; set; }
/// <summary>
/// 小题分数
/// </summary>
public decimal SubScore { get; set; }
/// <summary>
/// 学生小题得分
/// </summary>
public decimal StudentScore { get; set; }
}
/// <summary>
/// 填空题、简答题
/// </summary>
......
......@@ -1267,6 +1267,7 @@ namespace Edu.Module.Exam
QuestionContentObj = analysisQuestion.ParsingQuestion(questionModel.QuestionTypeKey, sItem.StudentContent, isEdit: true);
}
List<object> answerList = new List<object>();
List<object> quesAnswerList = new List<object>();
//填空题、分录题、资料题
if (questionModel.QuestionTypeKey == "fill-in" || questionModel.QuestionTypeKey == "entry-problem" || questionModel.QuestionTypeKey == "data-question")
{
......@@ -1282,24 +1283,51 @@ namespace Edu.Module.Exam
//完型填空
else if (questionModel.QuestionTypeKey == "cloze")
{
var tempList = sItem.StundetAnswer.Split(',');
if (tempList != null && tempList.Count() > 0)
if (!string.IsNullOrEmpty(questionModel.Answer.ToString()))
{
foreach (var tItem in tempList)
var qAnsList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(questionModel.Answer.ToString());
if (qAnsList != null && qAnsList.Count() > 0)
{
answerList.Add(tItem);
foreach (var tItem in qAnsList)
{
quesAnswerList.Add(tItem);
}
}
}
if (!string.IsNullOrEmpty(sItem.StundetAnswer.ToString()))
{
var tempList = JsonHelper.DeserializeObject<List<SubAnswerItem>>(sItem.StundetAnswer.ToString());
if (tempList != null && tempList.Count() > 0)
{
foreach (var tItem in tempList)
{
answerList.Add(tItem);
}
}
}
}
else if (questionModel.QuestionTypeKey == "reading-comprehensio" || questionModel.QuestionTypeKey == "listening")
{
var qList = JsonHelper.DeserializeObject<List<matchingItem>>(sItem.StundetAnswer.ToString());
foreach (var mItem in qList)
if (!string.IsNullOrEmpty(questionModel.Answer.ToString()))
{
answerList.Add(new { mItem.Name, mItem.Content });
var qAnsList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(questionModel.Answer.ToString());
if (qAnsList != null && qAnsList.Count() > 0)
{
foreach (var tItem in qAnsList)
{
quesAnswerList.Add(tItem);
}
}
}
if (!string.IsNullOrEmpty(sItem.StundetAnswer.ToString()))
{
var qList = JsonHelper.DeserializeObject<List<SubAnswerItem>>(sItem.StundetAnswer.ToString());
foreach (var mItem in qList)
{
answerList.Add(mItem);
}
}
}
var qObj = new
{
PaperDetailsId = sItem.DetailsId,//试卷问题编号
......@@ -1314,6 +1342,7 @@ namespace Edu.Module.Exam
questionModel.Score,
Answer = isShowAnswer ? questionModel.Answer : sItem.StundetAnswer,
sItem.StundetAnswer,
QuestionAnswerList= quesAnswerList,
AnswerList = isShowAnswer ? answerList : new List<object>(),
questionModel.AnswerParse,
sItem.StudentScore,
......@@ -1430,7 +1459,7 @@ namespace Edu.Module.Exam
{
foreach (var item in list)
{
analysisQuestion.CheckQuestion(item.QuestionTypeKey, item.QuestionContent, item.Answer, out string newAnswer);
analysisQuestion.CheckQuestion(item.QuestionTypeKey, item.QuestionContent, item.Answer, out string newAnswer,IsRequire:false);
RB_Examination_StudentDetails_ViewModel model = new RB_Examination_StudentDetails_ViewModel()
{
Id = item.StundetDetailsId,
......
using Edu.Model.ViewModel.Exam;
using Edu.Model.ViewModel.Question;
using Edu.Repository.Exam;
using System;
using System.Collections.Generic;
......@@ -114,11 +115,56 @@ namespace Edu.Module.Exam
break;
//完型填空
case "cloze":
var cloze_AnswerList= Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(sItem.Answer.ToString());
var cloze_Stu_AnswerList= Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(answerModel.StundetAnswer.ToString());
decimal clozeScore = 0;
if (cloze_AnswerList != null && cloze_Stu_AnswerList != null
&& cloze_AnswerList.Count > 0 && cloze_Stu_AnswerList.Count > 0
&& cloze_AnswerList.Count == cloze_Stu_AnswerList.Count)
{
for (var i = 0; i < cloze_AnswerList.Count; i++)
{
if (cloze_AnswerList[i].SubAnswer == cloze_Stu_AnswerList[i].SubAnswer)
{
clozeScore += cloze_AnswerList[i].SubScore;
cloze_Stu_AnswerList[i].StudentScore = cloze_AnswerList[i].SubScore;
}
}
}
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StudentScore = clozeScore,
StundetAnswer=Common.Plugin.JsonHelper.Serialize(cloze_Stu_AnswerList)
});
break;
//阅读理解
case "reading-comprehensio":
var reading_AnswerList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(sItem.Answer.ToString());
var reading_Stu_AnswerList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(answerModel.StundetAnswer.ToString());
decimal readingScore = 0;
if (reading_AnswerList != null && reading_Stu_AnswerList != null
&& reading_AnswerList.Count > 0 && reading_Stu_AnswerList.Count > 0
&& reading_AnswerList.Count == reading_Stu_AnswerList.Count)
{
for (var i = 0; i < reading_AnswerList.Count; i++)
{
if (reading_AnswerList[i].SubQuestionKey != "fill-in" && reading_AnswerList[i].SubQuestionKey != "short-answer")
{
if (reading_AnswerList[i].SubAnswer == reading_Stu_AnswerList[i].SubAnswer)
{
readingScore += reading_AnswerList[i].SubScore;
reading_Stu_AnswerList[i].StudentScore = reading_AnswerList[i].SubScore;
}
}
}
}
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StudentScore = readingScore,
StundetAnswer = Common.Plugin.JsonHelper.Serialize(reading_Stu_AnswerList)
});
break;
//口语题
case "spoken":
......@@ -126,7 +172,31 @@ namespace Edu.Module.Exam
break;
//听力题
case "listening":
var listening_AnswerList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(sItem.Answer.ToString());
var listening_Stu_AnswerList = Common.Plugin.JsonHelper.DeserializeObject<List<SubAnswerItem>>(answerModel.StundetAnswer.ToString());
decimal listeningScore = 0;
if (listening_AnswerList != null && listening_Stu_AnswerList != null
&& listening_AnswerList.Count > 0 && listening_Stu_AnswerList.Count > 0
&& listening_AnswerList.Count == listening_Stu_AnswerList.Count)
{
for (var i = 0; i < listening_AnswerList.Count; i++)
{
if (listening_AnswerList[i].SubQuestionKey != "fill-in"&& listening_AnswerList[i].SubQuestionKey != "short-answer")
{
if (listening_AnswerList[i].SubAnswer == listening_Stu_AnswerList[i].SubAnswer)
{
listeningScore += listening_AnswerList[i].SubScore;
listening_Stu_AnswerList[i].StudentScore = listening_AnswerList[i].SubScore;
}
}
}
}
answerList.Add(new RB_Examination_StudentDetails_ViewModel()
{
Id = answerModel.Id,
StudentScore = listeningScore,
StundetAnswer = Common.Plugin.JsonHelper.Serialize(listening_Stu_AnswerList)
});
break;
//公用选项题
case "sharing-choose":
......@@ -157,6 +227,10 @@ namespace Edu.Module.Exam
{nameof(RB_Examination_StudentDetails_ViewModel.StudentScore),item.StudentScore },
{nameof(RB_Examination_StudentDetails_ViewModel.IsMarking),1 },
};
if (!string.IsNullOrEmpty(item.StundetAnswer))
{
fileds.Add(nameof(RB_Examination_StudentDetails_ViewModel.StundetAnswer), item.StundetAnswer);
}
examination_StudentDetailsRepository.Update(fileds, new WhereHelper(nameof(RB_Examination_StudentDetails_ViewModel.Id), item.Id));
}
}
......
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