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

页面修改

parent 2b10185c
......@@ -466,7 +466,7 @@ namespace Edu.Module.Exam
//题库难易程度随机选题
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();
if (tempList != null && tempList.Count > 0)
......@@ -477,12 +477,15 @@ namespace Edu.Module.Exam
}
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();
if (tempList != null && tempList.Count > 0)
foreach (var subItem in item.CategoryList.Where(qitem => qitem.ChooseNum > 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
builder.AppendFormat(@"
SELECT QuestionTypeId,DifficultyType,Category,Count(QuestionId) AS QuestionCount
FROM RB_Question
WHERE 1=1
WHERE 1=1 AND `Status`=0
");
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