master
xiaochanghai 11 months ago
parent 02ebcfdedb
commit 47a92a9958
  1. 2
      Tiobon.Core.Services/Ghre/Ghre_CourseServices.cs
  2. 21
      Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs

@ -530,7 +530,7 @@ public class Ghre_CourseServices : BaseServices<Ghre_Course, Ghre_CourseDto, Ins
Directory.CreateDirectory(physicsPath + path);
path = path + body.exportSet.TitleName + ".xlsx";
NPOIHelper.ExportExcel(dt, null, "sheet1", physicsPath + path);
NPOIHelper.ExportExcel(dt, body.exportSet.TitleName, "sheet1", physicsPath + path);
return ServiceResult<string>.OprateSuccess("导出成功", path);
}

@ -873,14 +873,15 @@ public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDt
continue;
}
if (!dt.Columns.Contains("正确答案(必填)"))
{
comments.Add("未查询到【正确答案(必填)】列!");
data.ErrorCount++;
dt.Rows[i]["Comments"] = string.Join(";", comments.Select(a => 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<Ghre_Question, Ghre_QuestionDt
int index = questionContent.IndexOf("()");
if (index > -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<Ghre_Question, Ghre_QuestionDt
data.SuccessCount++;
id = await base.Add(insert);
insertAnswers.ForEach(x => x.QuestionId = id);
//await _ghre_QuestionAnswerServices.Add(insertAnswers);
await _ghre_QuestionAnswerServices.Add(insertAnswers);
}
}
else

Loading…
Cancel
Save