|
@@ -102,6 +102,31 @@ namespace Hotline.Application.Exam.QueryExtensions.TestPapers
|
|
|
expression = ExpressionableUtility.CreateExpression<Question>()
|
|
|
.AndIF(tagQuestionCountRequest.QuestionType.IsNotNull(), x => tagQuestionCountRequest.QuestionType ==x.QuestionType)
|
|
|
.AndIF(tagQuestionCountRequest.DifficultyLevel.IsNotNull(),x=> tagQuestionCountRequest.DifficultyLevel == x.DifficultyLevel)
|
|
|
+ .AndIF(tagQuestionCountRequest.QuestionIds.IsNotNull() && tagQuestionCountRequest.QuestionIds.Any(), x => !tagQuestionCountRequest.QuestionIds.Contains(x.Id))
|
|
|
+ .ToExpression();
|
|
|
+
|
|
|
+ return expression;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Expression<Func<QuestionTag, bool>> GetExpression(this TestPaperQuestionRequest testPaperQuestionRequest)
|
|
|
+ {
|
|
|
+ Expression<Func<QuestionTag, bool>> expression = m => m.Id != null;
|
|
|
+
|
|
|
+ expression = ExpressionableUtility.CreateExpression<QuestionTag>()
|
|
|
+ .AndIF(testPaperQuestionRequest.TagIds.IsNotNull() && testPaperQuestionRequest.TagIds.Any(), x => testPaperQuestionRequest.TagIds.Contains(x.TagId))
|
|
|
+ .ToExpression();
|
|
|
+
|
|
|
+ return expression;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Expression<Func<Question, bool>> GetQuestionExpression(this TestPaperQuestionRequest testPaperQuestionRequest)
|
|
|
+ {
|
|
|
+ Expression<Func<Question, bool>> expression = m => m.Id != null;
|
|
|
+
|
|
|
+ expression = ExpressionableUtility.CreateExpression<Question>()
|
|
|
+ .AndIF(testPaperQuestionRequest.QuestionType.IsNotNull(), x => testPaperQuestionRequest.QuestionType == x.QuestionType)
|
|
|
+ .AndIF(testPaperQuestionRequest.DifficultyLevel.IsNotNull(), x => testPaperQuestionRequest.DifficultyLevel == x.DifficultyLevel)
|
|
|
+ .AndIF(testPaperQuestionRequest.QuestionIds.IsNotNull() && testPaperQuestionRequest.QuestionIds.Any(), x => !testPaperQuestionRequest.QuestionIds.Contains(x.Id))
|
|
|
.ToExpression();
|
|
|
|
|
|
return expression;
|