diff --git a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs index 37fd396d..5a63e7f0 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs @@ -1,6 +1,5 @@ - -using System.Collections.Generic; -using System.Data; +using System.Data; +using System.Net; using AgileObjects.AgileMapper; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -214,12 +213,14 @@ public class Ghre_QuestionServices : BaseServices(sql) .OrderBy(filter.orderBy) - .ToPageListAsync(filter.pageNum, filter.pageSize, totalCount); - + .ToPageListAsync(filter.pageNum, filter.pageSize, totalCount); + data.ForEach(async x => { x.DifficultyLevelLabel = await GetParaLabel("DifficultyLevel", x.DifficultyLevel); - x.QuestionTypeLabel = await GetParaLabel("QuestionType", x.QuestionType); + x.QuestionTypeLabel = await GetParaLabel("QuestionType", x.QuestionType); + x.QuestionContent = WebUtility.HtmlDecode(x.QuestionContent); + }); @@ -378,6 +379,8 @@ public class Ghre_QuestionServices : BaseServices x.IsCorrect == true).FirstOrDefault()?.QuestionNo; questionType.detail.answer1 = answers.Where(x => x.IsCorrect == true).Select(x => x.QuestionNo).ToList(); questionType.detail.content = question.QuestionContent; + questionType.detail.content = WebUtility.HtmlDecode(questionType.detail.content); + questionType.detail.RemarkSz = question.QuestionAnalysis; questionType.detail.answerList = answers.Select(x => new FromGhre_QuestionQuestionAnswerList() { @@ -417,6 +420,8 @@ public class Ghre_QuestionServices : BaseServices x.isActive == 1).FirstOrDefault(); + + questionType.detail.content = WebUtility.HtmlEncode(questionType.detail.content); + #region 填空题处理 if (questionType.type == "Completion") questionType.detail.answerList = questionType.detail.answer1 @@ -520,6 +528,8 @@ public class Ghre_QuestionServices : BaseServices x.QuestionId == Id); var edit = Mapper.Map(data).ToANew();