|
|
|
@ -479,7 +479,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt |
|
|
|
|
i = i + 100; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (insertAnswers.Where(b => string.IsNullOrWhiteSpace(b.AnswerContent)).Any()) |
|
|
|
|
if (insertAnswers.Where(b => string.IsNullOrWhiteSpace(b.AnswerContent) && string.IsNullOrWhiteSpace(b.ImageUrl)).Any()) |
|
|
|
|
throw new Exception(insert.QuestionType == "ShortAnswer" ? "关键词存在空值!" : "答案选项存在空值!"); |
|
|
|
|
if (!insertAnswers.Where(b => b.IsCorrect == true).Any()) |
|
|
|
|
throw new Exception(insert.QuestionType == "ShortAnswer" ? "关键词未填写!" : "正确答案未标记!"); |
|
|
|
@ -570,7 +570,7 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt |
|
|
|
|
x.IsCorrect = true; |
|
|
|
|
i = i + 100; |
|
|
|
|
}); |
|
|
|
|
if (insertAnswers.Where(b => string.IsNullOrWhiteSpace(b.AnswerContent)).Any()) |
|
|
|
|
if (insertAnswers.Where(b => string.IsNullOrWhiteSpace(b.AnswerContent) && string.IsNullOrWhiteSpace(b.ImageUrl)).Any()) |
|
|
|
|
throw new Exception(edit.QuestionType == "ShortAnswer" ? "关键词存在空值!" : "答案选项存在空值!"); |
|
|
|
|
if (!insertAnswers.Where(b => b.IsCorrect == true).Any()) |
|
|
|
|
throw new Exception(edit.QuestionType == "ShortAnswer" ? "关键词未填写!" : "正确答案未标记!"); |
|
|
|
|