Commit 56a1a3bc authored by 黄奎's avatar 黄奎

页面修改

parent 2b10185c
...@@ -466,7 +466,7 @@ namespace Edu.Module.Exam ...@@ -466,7 +466,7 @@ namespace Edu.Module.Exam
//题库难易程度随机选题 //题库难易程度随机选题
else if (item.ChooseType == 2) else if (item.ChooseType == 2)
{ {
foreach (var subItem in item.ChooseList) foreach (var subItem in item.ChooseList.Where(qitem=>qitem.ChooseNum>0))
{ {
var tempList = tempQuestioinList?.Where(qitem => qitem.DifficultyType == subItem.DifficultyType)?.OrderBy(qitem => Guid.NewGuid())?.Take(subItem.ChooseNum)?.ToList(); var tempList = tempQuestioinList?.Where(qitem => qitem.DifficultyType == subItem.DifficultyType)?.OrderBy(qitem => Guid.NewGuid())?.Take(subItem.ChooseNum)?.ToList();
if (tempList != null && tempList.Count > 0) if (tempList != null && tempList.Count > 0)
...@@ -477,12 +477,15 @@ namespace Edu.Module.Exam ...@@ -477,12 +477,15 @@ namespace Edu.Module.Exam
} }
else if (item.ChooseType == 3) else if (item.ChooseType == 3)
{ {
foreach (var subItem in item.CategoryList) if (item.CategoryList != null && item.CategoryList.Count > 0)
{ {
var tempList = tempQuestioinList?.Where(qitem => qitem.Category == subItem.Category)?.OrderBy(qitem => Guid.NewGuid())?.Take(subItem.ChooseNum)?.ToList(); foreach (var subItem in item.CategoryList.Where(qitem => qitem.ChooseNum > 0))
if (tempList != null && tempList.Count > 0)
{ {
subTempQuestionList.AddRange(tempList); var tempList = tempQuestioinList?.Where(qitem => qitem.Category == subItem.Category)?.OrderBy(qitem => Guid.NewGuid())?.Take(subItem.ChooseNum)?.ToList();
if (tempList != null && tempList.Count > 0)
{
subTempQuestionList.AddRange(tempList);
}
} }
} }
} }
......
...@@ -59,7 +59,7 @@ WHERE 1=1 ...@@ -59,7 +59,7 @@ WHERE 1=1
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT QuestionTypeId,DifficultyType,Category,Count(QuestionId) AS QuestionCount SELECT QuestionTypeId,DifficultyType,Category,Count(QuestionId) AS QuestionCount
FROM RB_Question FROM RB_Question
WHERE 1=1 WHERE 1=1 AND `Status`=0
"); ");
if (query == null) if (query == null)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment