Commit 314c4621 authored by 黄奎's avatar 黄奎

页面修改

parent ffae09c9
......@@ -821,9 +821,17 @@ namespace Edu.Module.Question
message = "选项不能为空!";
}
//判断选项是否重复
if (optionItems.GroupBy(qitem => new { qitem.Content }).Where(qitem => qitem.Count() > 1).Count() > 0)
var tempList = optionItems.GroupBy(qitem => new { qitem.Content }).Select(qitem => new
{
message = "选项不能相同!";
qitem.Key.Content
});
foreach (var item in tempList)
{
var tempCount = optionItems.Where(qitem => qitem.Content == item.Content).Count();
if (tempCount > 1 && string.IsNullOrEmpty(message))
{
message = string.Format("选项【{0}】不能相同!", item.Content);
}
}
if (!(optionItems.Where(qitem => qitem.IsAnswer == true).Count() > 0))
{
......
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