|
|
|
@ -326,27 +326,41 @@ namespace Tiobon.Core.Services |
|
|
|
|
previews.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
var answers1 = answers.Where(y => y.QuestionId == x.QuestionId).ToList(); |
|
|
|
|
var detail = questions1.Select(o => |
|
|
|
|
new FromGhre_QuestionQuestionTypeDetail() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//var detail = questions1.Select(o => |
|
|
|
|
//new FromGhre_QuestionQuestionTypeDetail() |
|
|
|
|
//{ |
|
|
|
|
// Id = o.Id, |
|
|
|
|
// difficulty = o.DifficultyLevel, |
|
|
|
|
// RemarkSz = o.QuestionAnalysis, |
|
|
|
|
// content = o.QuestionContent, |
|
|
|
|
//}).ToList(); |
|
|
|
|
//detail.ForEach(y => |
|
|
|
|
//{ |
|
|
|
|
// y.answer = answers1.Where(x => x.IsCorrect == true).FirstOrDefault()?.QuestionNo; |
|
|
|
|
// y.answer1 = answers1.Where(x => x.IsCorrect == true).Select(x => x.QuestionNo).ToList(); |
|
|
|
|
// y.answerList = answers.Select(x => new FromGhre_QuestionQuestionAnswerList() |
|
|
|
|
// { |
|
|
|
|
// No = x.QuestionNo, |
|
|
|
|
// label = x.AnswerContent, |
|
|
|
|
// imageUrl = x.ImageUrl, |
|
|
|
|
// imgWidthPc = x.ImageWidthPc, |
|
|
|
|
// imgWidthApp = x.ImageWidthApp, |
|
|
|
|
// }).ToList(); |
|
|
|
|
//}); |
|
|
|
|
|
|
|
|
|
var detail = new FromGhre_QuestionQuestionTypeDetail(); |
|
|
|
|
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 = answers.Select(x => new FromGhre_QuestionQuestionAnswerList() |
|
|
|
|
{ |
|
|
|
|
Id = o.Id, |
|
|
|
|
difficulty = o.DifficultyLevel, |
|
|
|
|
RemarkSz = o.QuestionAnalysis, |
|
|
|
|
content = o.QuestionContent, |
|
|
|
|
No = x.QuestionNo, |
|
|
|
|
label = x.AnswerContent, |
|
|
|
|
imageUrl = x.ImageUrl, |
|
|
|
|
imgWidthPc = x.ImageWidthPc, |
|
|
|
|
imgWidthApp = x.ImageWidthApp, |
|
|
|
|
}).ToList(); |
|
|
|
|
detail.ForEach(y => |
|
|
|
|
{ |
|
|
|
|
y.answer = answers1.Where(x => x.IsCorrect == true).FirstOrDefault()?.QuestionNo; |
|
|
|
|
y.answer1 = answers1.Where(x => x.IsCorrect == true).Select(x => x.QuestionNo).ToList(); |
|
|
|
|
y.answerList = answers.Select(x => new FromGhre_QuestionQuestionAnswerList() |
|
|
|
|
{ |
|
|
|
|
No = x.QuestionNo, |
|
|
|
|
label = x.AnswerContent, |
|
|
|
|
imageUrl = x.ImageUrl, |
|
|
|
|
imgWidthPc = x.ImageWidthPc, |
|
|
|
|
imgWidthApp = x.ImageWidthApp, |
|
|
|
|
}).ToList(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
x.detail = detail; |
|
|
|
|
}); |
|
|
|
@ -383,6 +397,8 @@ namespace Tiobon.Core.Services |
|
|
|
|
Id = x.Id, |
|
|
|
|
parentId = parentId, |
|
|
|
|
QuestionId = x.Id, |
|
|
|
|
QuestionType = x.QuestionType, |
|
|
|
|
QuestionContent = x.QuestionContent, |
|
|
|
|
}).ToList(); |
|
|
|
|
var questionIds = previews.Select(x => x.QuestionId).Distinct().ToList(); |
|
|
|
|
var questions1 = await _ghre_QuestionServices.Query(x => questionIds.Contains(x.Id)); |
|
|
|
@ -391,29 +407,18 @@ namespace Tiobon.Core.Services |
|
|
|
|
previews.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
var answers1 = answers.Where(y => y.QuestionId == x.QuestionId).ToList(); |
|
|
|
|
var detail = questions1.Select(o => |
|
|
|
|
new FromGhre_QuestionQuestionTypeDetail() |
|
|
|
|
var detail = new FromGhre_QuestionQuestionTypeDetail(); |
|
|
|
|
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() |
|
|
|
|
{ |
|
|
|
|
Id = o.Id, |
|
|
|
|
difficulty = o.DifficultyLevel, |
|
|
|
|
RemarkSz = o.QuestionAnalysis, |
|
|
|
|
content = o.QuestionContent, |
|
|
|
|
|
|
|
|
|
No = x.QuestionNo, |
|
|
|
|
label = x.AnswerContent, |
|
|
|
|
imageUrl = x.ImageUrl, |
|
|
|
|
imgWidthPc = x.ImageWidthPc, |
|
|
|
|
imgWidthApp = x.ImageWidthApp, |
|
|
|
|
}).ToList(); |
|
|
|
|
detail.ForEach(y => |
|
|
|
|
{ |
|
|
|
|
y.answer = answers1.Where(x => x.IsCorrect == true).FirstOrDefault()?.QuestionNo; |
|
|
|
|
y.answer1 = answers1.Where(x => x.IsCorrect == true).Select(x => x.QuestionNo).ToList(); |
|
|
|
|
y.answerList = answers.Select(x => new FromGhre_QuestionQuestionAnswerList() |
|
|
|
|
{ |
|
|
|
|
No = x.QuestionNo, |
|
|
|
|
label = x.AnswerContent, |
|
|
|
|
imageUrl = x.ImageUrl, |
|
|
|
|
imgWidthPc = x.ImageWidthPc, |
|
|
|
|
imgWidthApp = x.ImageWidthApp, |
|
|
|
|
}).ToList(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
detail.content = x.QuestionContent; |
|
|
|
|
x.detail = detail; |
|
|
|
|
}); |
|
|
|
|
input.previewList = previews; |
|
|
|
|