选项只输入图片时,提示选项为空

master
xiaochanghai 1 year ago
parent 26c5f3dbb0
commit de4cff4a0f
  1. 4
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs

@ -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" ? "关键词未填写!" : "正确答案未标记!");

Loading…
Cancel
Save