diff --git a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs index 46cad571..e865c09b 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs @@ -479,7 +479,7 @@ public class Ghre_QuestionServices : BaseServices 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 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" ? "关键词未填写!" : "正确答案未标记!");