Commit ff2b9ea0 authored by 黄奎's avatar 黄奎

页面修改

parent 28f73626
......@@ -73,6 +73,12 @@ namespace Edu.Model.ViewModel.Question
/// <summary>
/// 大类名称
/// </summary>
public string CategoryName { get; set; }
public string CategoryName
{
get
{
return Common.Plugin.EnumHelper.ToName(this.Category);
}
}
}
}
\ No newline at end of file
......@@ -99,7 +99,7 @@ namespace Edu.WebApi.Controllers.Course
item.CreateByName,
item.CreateTimeStr,
item.DifficultyType,
CategoryName = item.Category.ToName(),
item.CategoryName,
DifficultyTypeName = item.DifficultyType.ToName(),
}); ;
}
......@@ -197,6 +197,7 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.Failed(message: shortMessage);
}
extModel.QuestionContent = "";
}
//名词解释
else if (extModel.QuestionTypeKey == "noun-explanation")
......@@ -205,6 +206,7 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.Failed(message: "请填写名词解释答案!");
}
extModel.QuestionContent = "";
}
//论述题
else if (extModel.QuestionTypeKey == "essay-question")
......@@ -213,6 +215,7 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.Failed(message: "请填写论述题答案!");
}
extModel.QuestionContent = "";
}
//计算题
else if (extModel.QuestionTypeKey == "calculation")
......@@ -221,6 +224,7 @@ namespace Edu.WebApi.Controllers.Course
{
return ApiResult.Failed(message: "请填写计算题答案!");
}
extModel.QuestionContent = "";
}
//分录题、资料题
else if (extModel.QuestionTypeKey == "entry-problem" || extModel.QuestionTypeKey == "data-question")
......@@ -260,13 +264,34 @@ namespace Edu.WebApi.Controllers.Course
var matchList = Common.Plugin.JsonHelper.DeserializeObject<List<List<matchingItem>>>(extModel.QuestionContent);
if (matchList != null && matchList.Count > 0)
{
if (matchList[0].Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
if (matchList[0] != null && matchList[0].Count > 0)
{
return ApiResult.Failed(message: "第一组选项内容不能为空!");
if (matchList[0].Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
{
return ApiResult.Failed(message: "第一组选项内容不能为空!");
}
}
else
{
return ApiResult.Failed(message: "请添加第一组选项!");
}
if (matchList.Count > 1 && matchList[1] != null && matchList[1].Count > 0)
{
if (matchList[1].Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
{
return ApiResult.Failed(message: "第二组选项内容不能为空!");
}
}
else
{
return ApiResult.Failed(message: "请添加第二组选项!");
}
if (matchList[1].Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
if (matchList.Count > 2)
{
return ApiResult.Failed(message: "第二组选项内容不能为空!");
if (matchList[2].Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
{
return ApiResult.Failed(message: "请设置答案!");
}
}
}
else
......
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