From 9dab63582d8a30c6caebca43cfb9a918bc565c5c Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 9 Aug 2024 17:54:05 +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_ExamRecordServices.cs | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) 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;