Commit 99f9ec08 authored by 黄奎's avatar 黄奎

页面修改

parent b5e9eae8
......@@ -40,11 +40,11 @@ namespace Edu.Model.ViewModel.Exam
/// <summary>
/// 考试开始时间
/// </summary>
public DateTime ExamStartTime { get; set; }
public DateTime PaperStartTime { get; set; }
/// <summary>
/// 考试结束时间
/// </summary>
public DateTime EndTime { get; set; }
public DateTime PaperEndTime { get; set; }
}
}
\ No newline at end of file
......@@ -33,6 +33,7 @@ namespace Edu.Module.Exam
CourseId = CourseId,
QChapterIds = ChapterId + "," + NextChapterId
});
List<object> GroupList = new List<object>();
var reviewList = list?.Where(qitem => qitem.ChapterId == ChapterId)?.OrderBy(qitem => Guid.NewGuid())?.ToList();
var prepList = list?.Where(qitem => qitem.ChapterId == NextChapterId)?.OrderBy(qitem => Guid.NewGuid())?.ToList();
if (reviewList != null && reviewList.Count > 0)
......@@ -41,10 +42,25 @@ namespace Edu.Module.Exam
{
//选择题
if (i % 2 == 0)
{
}
{
GroupList.Add(new
{
GroupName = "单选题",
QuestionTypeId = 1,
QuestionTypeKey = "single",
});
}
//填空题
else
{
GroupList.Add(new
{
GroupName = "填空题",
QuestionTypeId = 3,
QuestionTypeKey = "fill-in",
});
}
}
}
......
......@@ -1634,17 +1634,30 @@ namespace Edu.Module.Exam
/// <returns></returns>
public virtual bool SetStuExamStartTimeModule(int PublishId, int GuestId, int PaperId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
bool flag = false;
var model = examination_StudentRepository.GetExaminationStudentListRepository(new RB_Examination_Student_ViewModel()
{
{nameof(RB_Examination_Student_ViewModel.ExamStartTime), DateTime.Now},
};
List<WhereHelper> wheres = new List<WhereHelper>()
PaperId = PaperId,
PublishId = PublishId,
GuestId = GuestId
})?.FirstOrDefault();
if (model != null)
{
new WhereHelper(nameof(RB_Examination_Student_ViewModel.PaperId),PaperId),
new WhereHelper(nameof(RB_Examination_Student_ViewModel.PublishId),PublishId),
new WhereHelper(nameof(RB_Examination_Student_ViewModel.GuestId),GuestId),
};
bool flag = examination_StudentRepository.Update(fileds, wheres);
if (model.ExamStartTime == null)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Examination_Student_ViewModel.ExamStartTime), DateTime.Now},
};
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper(nameof(RB_Examination_Student_ViewModel.PaperId),PaperId),
new WhereHelper(nameof(RB_Examination_Student_ViewModel.PublishId),PublishId),
new WhereHelper(nameof(RB_Examination_Student_ViewModel.GuestId),GuestId),
};
flag = examination_StudentRepository.Update(fileds, wheres);
}
}
return flag;
}
......
......@@ -24,7 +24,7 @@ namespace Edu.Repository.Exam
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,c.ClassName,b.Mobile,s.StuIcon,p.ExamStartTime ,p.ExamEndTime AS EndTime
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,c.ClassName,b.Mobile,s.StuIcon,p.ExamStartTime AS PaperStartTime,p.ExamEndTime AS PaperEndTime
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
......
......@@ -110,7 +110,7 @@ namespace Edu.WebApi.Controllers.Applet
classModel = new Model.ViewModel.Grade.RB_Class_Time_Extend();
}
#region 我的试卷
List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel> examinationPublishList = new List<Model.ViewModel.Exam.RB_Examination_Publish_ViewModel>();
List<RB_Examination_Publish_ViewModel> examinationPublishList = new List<RB_Examination_Publish_ViewModel>();
if (studentModel != null && studentModel.GuestId > 0)
{
examinationPublishList = paperModule.GetGuestExaminationPublishPage(1, 5, out long rowsCount,
......
......@@ -854,18 +854,18 @@ 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)
if (item.PaperStartTime > System.DateTime.Now)
{
item.ExamStatus = ExamTestStatusEnum.NotStarted;
}
else if (item.ExamStartTime < System.DateTime.Now && item.EndTime > System.DateTime.Now)
else if (item.PaperStartTime < System.DateTime.Now && item.PaperEndTime > System.DateTime.Now)
{
if (item.ExamStatus != ExamTestStatusEnum.FinishTest && item.ExamStatus != ExamTestStatusEnum.FinishScoring)
{
item.ExamStatus = ExamTestStatusEnum.FinishStarted;
}
}
else if (item.EndTime < System.DateTime.Now)
else if (item.PaperEndTime < System.DateTime.Now)
{
if (item.ExamStatus != ExamTestStatusEnum.FinishTest && item.ExamStatus != ExamTestStatusEnum.FinishScoring)
{
......@@ -888,8 +888,10 @@ 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),
ExamStartTime= Common.ConvertHelper.FormatTime(item.ExamStartTime),
ExamEndTime = Common.ConvertHelper.FormatTime(item.ExamEndTime),
PaperStartTime = Common.ConvertHelper.FormatTime(item.PaperStartTime),
PaperEndTime = Common.ConvertHelper.FormatTime(item.PaperEndTime),
};
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