diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 11933ca7..0fa4cb35 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -555,15 +555,21 @@ public class Ghre_ExamRecordServices : BaseServices a.Id == x.QuestionId)?.DifficultyLevel; //detail.answer = answers1.Where(x => x.IsCorrect == true).FirstOrDefault()?.QuestionNo; + //detail.answer1 = answers1.Where(x => x.IsCorrect == true).Select(x => x.QuestionNo).ToList(); - detail.answerList = answers1.Select(x => new FromGhre_QuestionQuestionAnswerList() - { - No = x.QuestionNo, - label = x.AnswerContent, - imageUrl = x.ImageUrl, - imgWidthPc = x.ImageWidthPc, - imgWidthApp = x.ImageWidthApp, - }).ToList(); + if (x.QuestionType == "Completion") + detail.answer1 = answers1.Where(x => x.IsCorrect == true).Select(x => "").ToList(); + + if (x.QuestionType != "Completion") + + detail.answerList = answers1.Select(x => new FromGhre_QuestionQuestionAnswerList() + { + No = x.QuestionNo, + label = x.AnswerContent, + imageUrl = x.ImageUrl, + imgWidthPc = x.ImageWidthPc, + imgWidthApp = x.ImageWidthApp, + }).ToList(); x.detail = detail;