From 47a92a99583c35c9c60980476ed96cdf8d65a171 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 8 Aug 2024 11:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_CourseServices.cs | 2 +- .../Ghre/Ghre_QuestionServices.cs | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs index b3648323..e4b0bcf9 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs @@ -530,7 +530,7 @@ public class Ghre_CourseServices : BaseServices.OprateSuccess("导出成功", path); } diff --git a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs index fa9aa864..dc39f2f9 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs @@ -873,14 +873,15 @@ public class Ghre_QuestionServices : BaseServices a)); - isExistError = true; - continue; - } + if (questionType != "Completion" && questionType != "ShortAnswer") + if (!dt.Columns.Contains("正确答案(必填)")) + { + comments.Add("未查询到【正确答案(必填)】列!"); + data.ErrorCount++; + dt.Rows[i]["Comments"] = string.Join(";", comments.Select(a => a)); + isExistError = true; + continue; + } if (!dt.Columns.Contains("课程(必填)")) { @@ -1026,7 +1027,7 @@ public class Ghre_QuestionServices : BaseServices -1) { - if (questionContent.Length > index + 2) + if (questionContent.Length > index + 4) { if (questionContent.Substring(index + 2, 2) == "()") questionContent = questionContent.Substring(0, index) + "____、" + questionContent.Substring(index + 2); @@ -1083,7 +1084,7 @@ public class Ghre_QuestionServices : BaseServices x.QuestionId = id); - //await _ghre_QuestionAnswerServices.Add(insertAnswers); + await _ghre_QuestionAnswerServices.Add(insertAnswers); } } else