Commit 0c4f1611 authored by 吴春's avatar 吴春

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

parents 82579196 f6386b46
......@@ -195,22 +195,30 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Failed(message: "请添加选择题选项!");
}
}
else if (extModel.QuestionTypeKey == "fill-in")
{
var fillInList = Common.Plugin.JsonHelper.DeserializeObject<List<fillInItem>>(extModel.QuestionContent);
if (fillInList != null && fillInList.Count > 0)
{
if (fillInList.Where(qitem => string.IsNullOrEmpty(qitem.Content)).Count() > 0)
{
return ApiResult.Failed(message: "请输入答案!");
}
}
else
{
return ApiResult.Failed(message: "请添加答案!");
}
}
var obj = new object();
switch (extModel.QuestionTypeKey)
{
//单选题
case "single":
break;
//多选题
case "multiple":
obj = Common.Plugin.JsonHelper.DeserializeObject<List<optionItem>>(extModel.QuestionContent);
break;
//填空题
case "fill-in":
obj = Common.Plugin.JsonHelper.DeserializeObject<List<fillInItem>>(extModel.QuestionContent);
break;
//判断题
case "judge":
......
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