Commit 4a220d26 authored by 黄奎's avatar 黄奎

页面修改

parent 52783b8f
......@@ -52,6 +52,22 @@ namespace Edu.Model.ViewModel.Question
public string ShowName { get; set; }
}
/// <summary>
/// 完型填空
/// </summary>
public class colzeItem
{
/// <summary>
/// 题目分数
/// </summary>
public decimal SubScore { get; set; }
/// <summary>
/// 选项列表
/// </summary>
public List<optionItem> OptionList { get; set; }
}
/// <summary>
/// 填空题、简答题
/// </summary>
......@@ -104,6 +120,11 @@ namespace Edu.Model.ViewModel.Question
/// </summary>
public string SubTitle { get; set; }
/// <summary>
/// 题目分数
/// </summary>
public decimal SubScore { get; set; }
/// <summary>
/// 题目答案内容
/// </summary>
......
......@@ -336,14 +336,14 @@ namespace Edu.Module.Question
/// <returns></returns>
private object GetClozeList(string data, bool isNoAnswer)
{
var clozeList = Common.Plugin.JsonHelper.DeserializeObject<List<List<optionItem>>>(data);
var clozeList = Common.Plugin.JsonHelper.DeserializeObject<List<colzeItem>>(data);
if (isNoAnswer)
{
if (clozeList != null && clozeList.Count > 0)
{
clozeList.ForEach(item =>
{
item.ForEach(subItem =>
item.OptionList.ForEach(subItem =>
{
subItem.IsAnswer = false;
});
......@@ -588,21 +588,21 @@ namespace Edu.Module.Question
//完型填空
else if (QuestionTypeKey == "cloze")
{
var clozeList = Common.Plugin.JsonHelper.DeserializeObject<List<List<optionItem>>>(QuestionContent);
var clozeList = Common.Plugin.JsonHelper.DeserializeObject<List<colzeItem>>(QuestionContent);
if (clozeList != null && clozeList.Count > 0)
{
int index = 1;
string clozeAnswer = "";
foreach (var subList in clozeList)
foreach (var rootItem in clozeList)
{
var tempModel = subList.Where(qitem => qitem.IsAnswer == true)?.FirstOrDefault();
var tempModel = rootItem.OptionList.Where(qitem => qitem.IsAnswer == true)?.FirstOrDefault();
clozeAnswer += "," + tempModel?.Name ?? "";
if (subList.Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
if (rootItem.OptionList.Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
{
message = string.Format("第{0}小题选项内容不能为空!", index);
return message;
}
if (!(subList.Where(qitem => qitem.IsAnswer == true).Count() > 0))
if (!(rootItem.OptionList.Where(qitem => qitem.IsAnswer == true).Count() > 0))
{
message = string.Format("请设置第{0}小题选项的正确答案!", index);
return message;
......
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