Commit a6d1e1e8 authored by 黄奎's avatar 黄奎

页面修改

parent 4e220fb6
......@@ -129,5 +129,10 @@ namespace Edu.Model.ViewModel.Question
/// 题库类型(见枚举)
/// </summary>
public LevelTypeEnum BankType { get; set; }
/// <summary>
/// 开始问题编号
/// </summary>
public int StartId { get; set; }
}
}
\ No newline at end of file
......@@ -683,12 +683,16 @@ namespace Edu.Module.Exam
object obj = new object();
int readingTotalCount = 0;
int readingFinishCount = 0;
int readingStartId = 0;
int listeningTotalCount = 0;
int listeningFinishCount = 0;
int listeningStartId = 0;
int grammarTotalCount = 0;
int grammarFinishCount = 0;
int grammarStartId = 0;
int wordsTotalCount = 0;
int wordsFinishCount = 0;
int wordsStartId = 0;
var sQuery = new RB_Student_Practice_Extend()
{
StudentId = StudentId,
......@@ -697,14 +701,25 @@ namespace Edu.Module.Exam
var finishList = student_PracticeRepository.GetStudentPracticeListRepository(sQuery);
if (finishList != null && finishList.Count > 0)
{
readingFinishCount = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ReadingChoose)?.Count() ?? 0;
listeningFinishCount = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.Listening)?.Count() ?? 0;
grammarFinishCount = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseGrammarUse)?.Count() ?? 0;
wordsFinishCount = finishList?.Where(qitem =>
qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWord
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseMean
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWordUse
)?.Count() ?? 0;
var tempReadingList = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ReadingChoose)?.ToList();
readingFinishCount = tempReadingList?.Count() ?? 0;
readingStartId = tempReadingList != null && tempReadingList.Count > 0 ? (tempReadingList?.Max(qitem => qitem.QuestionId) ?? 0) : 0;
var tempListeningList = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.Listening)?.ToList();
listeningFinishCount = tempListeningList?.Count() ?? 0;
listeningStartId = tempListeningList != null && tempListeningList.Count>0?( tempListeningList?.Max(qitem=>qitem.QuestionId) ?? 0):0;
var tempGrammarList = finishList?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseGrammarUse)?.ToList();
grammarFinishCount = tempGrammarList?.Count() ?? 0;
grammarStartId = tempGrammarList != null && tempGrammarList.Count > 0 ? (tempGrammarList?.Max(qitem => qitem.QuestionId) ?? 0) : 0;
var tempWordsList = finishList?.Where(qitem =>
qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWord
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseMean
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWordUse
)?.ToList();
wordsFinishCount = tempWordsList?.Count() ?? 0;
wordsStartId = tempWordsList != null && tempWordsList.Count > 0 ? (tempWordsList?.Max(qitem => qitem.QuestionId) ?? 0) : 0;
}
var list = questionRepository.GetQuestionCategoryListRepository(query);
if (list != null && list.Count > 0)
......@@ -713,7 +728,7 @@ namespace Edu.Module.Exam
listeningTotalCount = list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.Listening)?.Sum(qitem => qitem.QuestionCount) ?? 0;
grammarTotalCount = list?.Where(qitem => qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseGrammarUse)?.Sum(qitem => qitem.QuestionCount) ?? 0;
wordsTotalCount = list?.Where(qitem =>
qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWord
qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWord
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseMean
|| qitem.Category == Common.Enum.Course.QuestionCategoryEnum.ChooseWordUse
)?.Sum(qitem => qitem.QuestionCount) ?? 0;
......@@ -722,12 +737,16 @@ namespace Edu.Module.Exam
{
readingFinishCount,
readingTotalCount,
readingStartId,
listeningFinishCount,
listeningTotalCount,
listeningStartId,
grammarTotalCount,
grammarFinishCount,
grammarStartId,
wordsTotalCount,
wordsFinishCount
wordsFinishCount,
wordsStartId,
};
return obj;
}
......
......@@ -197,6 +197,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND C.{0}={1} ", nameof(RB_Question_ViewModel.BankType), (int)query.BankType);
}
if (query.StartId > 0)
{
builder.AppendFormat(" AND A.{0}>{1} ", nameof(RB_Question_ViewModel.QuestionId), query.StartId);
}
builder.AppendFormat(" ORDER BY A.{0} ASC ", nameof(RB_Question_ViewModel.SortNum));
return GetPage<RB_Question_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
......
......@@ -991,6 +991,7 @@ namespace Edu.WebApi.Controllers.Exam
{
BankType = (LevelTypeEnum)base.ParmJObj.GetInt("BankType"),
QCategoryId = string.Format("{0},{1},{2}", (int)QuestionCategoryEnum.ChooseWord, (int)QuestionCategoryEnum.ChooseMean, (int)QuestionCategoryEnum.ChooseWordUse),
StartId = base.ParmJObj.GetInt("StartId"),
};
var list = courseExamModule.GetAppQuestionCategoryListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
......@@ -1010,6 +1011,7 @@ namespace Edu.WebApi.Controllers.Exam
{
BankType = (LevelTypeEnum)base.ParmJObj.GetInt("BankType"),
QCategoryId = string.Format("{0}", (int)QuestionCategoryEnum.ChooseGrammarUse),
StartId = base.ParmJObj.GetInt("StartId"),
};
var list = courseExamModule.GetAppQuestionCategoryListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
......@@ -1029,6 +1031,7 @@ namespace Edu.WebApi.Controllers.Exam
{
BankType = (LevelTypeEnum)base.ParmJObj.GetInt("BankType"),
QCategoryId = string.Format("{0}", (int)QuestionCategoryEnum.Listening),
StartId = base.ParmJObj.GetInt("StartId"),
};
var list = courseExamModule.GetAppQuestionCategoryListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
......@@ -1048,6 +1051,7 @@ namespace Edu.WebApi.Controllers.Exam
{
BankType = (LevelTypeEnum)base.ParmJObj.GetInt("BankType"),
QCategoryId = string.Format("{0}", (int)QuestionCategoryEnum.ReadingChoose),
StartId = base.ParmJObj.GetInt("StartId"),
};
var list = courseExamModule.GetAppQuestionCategoryListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
......
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