Commit b1303d7d authored by 黄奎's avatar 黄奎

页面修改

parent ebdf85f6
......@@ -37,5 +37,14 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public string StuIcon { get; set; }
/// <summary>
/// 考试开始时间
/// </summary>
public DateTime ExamStartTime { get; set; }
/// <summary>
/// 考试结束时间
/// </summary>
public DateTime EndTime { get; set; }
}
}
\ No newline at end of file
......@@ -24,11 +24,12 @@ namespace Edu.Repository.Exam
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,c.ClassName,b.Mobile,s.StuIcon
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,c.ClassName,b.Mobile,s.StuIcon,p.ExamStartTime ,p.ExamEndTime AS EndTime
FROM RB_Examination_Student AS A LEFT JOIN rb_order_guest AS B ON A.GuestId=B.Id
LEFT JOIN rb_class as c on c.ClassId=a.ClassId
LEFT JOIN rb_student_orderguest as sog on sog.GuestId=a.GuestId
LEFT JOIN rb_student as s on s.StuId = sog.Student_Id
LEFT JOIN rb_examination_publish AS p ON A.PublishId=P.Id
WHERE 1=1
");
if (query != null)
......
......@@ -2,6 +2,7 @@
using Edu.Common;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.Exam;
using Edu.Common.Enum.Question;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Exam;
......@@ -814,6 +815,24 @@ namespace Edu.WebApi.Controllers.Exam
var list = paperModule.GetExaminationStudentPageRepository(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.ExamStartTime > System.DateTime.Now)
{
item.ExamStatus = ExamTestStatusEnum.NotStarted;
}
else if (item.ExamStartTime < System.DateTime.Now && item.EndTime > System.DateTime.Now)
{
if (item.ExamStatus != ExamTestStatusEnum.FinishTest && item.ExamStatus != ExamTestStatusEnum.FinishScoring)
{
item.ExamStatus = ExamTestStatusEnum.FinishStarted;
}
}
else if (item.EndTime < System.DateTime.Now)
{
if (item.ExamStatus != ExamTestStatusEnum.FinishTest && item.ExamStatus != ExamTestStatusEnum.FinishScoring)
{
item.ExamStatus = ExamTestStatusEnum.MissedTest;
}
}
var obj = new
{
item.Id,
......@@ -830,6 +849,8 @@ namespace Edu.WebApi.Controllers.Exam
CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "",
item.ExamStatus,
ExamStatusName = item.ExamStatus.ToName(),
ExamStartTime = Common.ConvertHelper.FormatTime(item.ExamStartTime),
EndTime = Common.ConvertHelper.FormatTime(item.EndTime),
};
result.Add(obj);
}
......
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