Commit 3af710a4 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents f91611c6 032c14de
This diff is collapsed.
......@@ -636,6 +636,7 @@ namespace Edu.Module.Exam
return flag;
}
/// <summary>
/// 根据试卷编号获取试卷实体
/// </summary>
......@@ -1253,10 +1254,33 @@ namespace Edu.Module.Exam
foreach (var sItem in stuTempList)
{
var questionModel = gItem.DetailsList.Where(qitem => qitem.Id == sItem.DetailsId)?.FirstOrDefault();
var QuestionContentObj = analysisQuestion.ParsingQuestion(questionModel.QuestionTypeKey, sItem.StudentContent,isEdit:true);
var QuestionContentObj = new object();
if (isShowAnswer)
{
QuestionContentObj = analysisQuestion.ParsingQuestion(questionModel.QuestionTypeKey, questionModel.QuestionContent, isEdit: true);
}
else
{
QuestionContentObj = analysisQuestion.ParsingQuestion(questionModel.QuestionTypeKey, sItem.StudentContent, isEdit: true);
}
List<object> answerList = new List<object>();
//填空题、分录题、资料题
if (questionModel.QuestionTypeKey == "fill-in" || questionModel.QuestionTypeKey == "entry-problem" || questionModel.QuestionTypeKey == "data-question")
{
var tempList = sItem.StundetAnswer.Split('★');
if (tempList != null && tempList.Count() > 0)
{
foreach (var tItem in tempList)
{
answerList.Add(tItem);
}
}
}
var qObj = new
{
PaperDetailsId= sItem.DetailsId,//试卷问题编号
PaperDetailsId = sItem.DetailsId,//试卷问题编号
StundetDetailsId = sItem.Id,//考生答题编号
sItem.PaperId,
questionModel.Title,
......@@ -1266,10 +1290,12 @@ namespace Edu.Module.Exam
questionModel.QuestionTypeKey,
questionModel.DifficultyType,
questionModel.Score,
Answer =sItem.StundetAnswer,
Answer = isShowAnswer ? questionModel.Answer : sItem.StundetAnswer,
sItem.StundetAnswer,
AnswerParse = "",
StundetScore = 0,
AnswerList = isShowAnswer ? answerList : new List<object> (),
AnswerParse = questionModel.AnswerParse,
StundetScore = sItem.StundetScore,
sItem.IsMarking
};
questionList.Add(qObj);
}
......@@ -1306,6 +1332,7 @@ namespace Edu.Module.Exam
StundetAnswer = "",
AnswerParse = "",
StundetScore = 0,
IsMarking=0,
};
questionList.Add(qObj);
}
......@@ -1313,6 +1340,8 @@ namespace Edu.Module.Exam
paperTypeList.Add(new
{
gItem.GId,
gItem.QuestionTypeKey,
gItem.QuestionTypeId,
gItem.GroupName,
gItem.GScore,
DetailsList = questionList
......
......@@ -160,7 +160,7 @@ namespace Edu.Module.Question
var diffTypeList = dataList.Where(qitem => qitem.QuestionTypeId == item.QuestionTypeId)
.Select(qitem => new
{
DifficultyType = qitem.DifficultyType,
qitem.DifficultyType,
DifficultyTypeName = qitem.DifficultyType.ToName(),
DifficultyTypeCount = qitem.QuestionCount,
ChooseNum = 0
......
......@@ -60,14 +60,6 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.AreaId), query.AreaId);
}
//if (query.StuStatus > 0)
//{
// builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.StuStatus), query.StuStatus);
//}
//else
//{
// builder.AppendFormat(" AND t.{0} in({1}) ", nameof(RB_Student_ViewModel.StuStatus), "1,2");
//}
}
return Get<RB_Student_ViewModel>(builder.ToString(),parameters).ToList();
}
......@@ -142,9 +134,11 @@ WHERE 1=1
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat($@"SELECT c.*,rbc.ClassName from rb_student as c
builder.AppendFormat($@"
SELECT c.*,rbc.ClassName
FROM rb_student as c
LEFT JOIN rb_student_orderguest as sog on sog.Student_Id=c.StuId
LEFT JOIN rb_class as rbc on rbc.ClassId=sog.ClassId
LEFT JOIN rb_class as rbc on rbc.ClassId=sog.ClassId
where sog.ClassId in(SELECT a.ClassId from rb_student_orderguest as a LEFT JOIN rb_class as b on a.ClassId=b.ClassId
LEFT JOIN rb_student as c on c.StuId =a.Student_Id
LEFT JOIN rb_order as o on a.OrderId=o.OrderId
......@@ -164,14 +158,16 @@ where b.`Status`=0 and b.ClassStatus in(1,2) and a.status=0 and a.Account_Id={
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat($@"SELECT s.*,sog.GuestId,o.OrderState,cou.CourseName,cou.CourseId,c.ClassName,c.ClassId,c.ClassStatus,sch.SName,sch.SId,t.TeacherName,o.EnterID,(og.TotalHours-og.CompleteHours) as SurplusHours from rb_student as s LEFT JOIN rb_student_orderguest as sog on s.StuId=sog.Student_Id
LEFT JOIN rb_order_guest as og on og.Id=sog.GuestId
LEFT JOIN rb_order as o on og.OrderId=o.OrderId
LEFT JOIN rb_course as cou on o.CourseId=cou.CourseId
LEFT JOIN rb_class as c on c.ClassId=o.ClassId
LEFT JOIN rb_school as sch on sch.SId=c.School_Id
LEFT JOIN rb_teacher as t on t.TId=c.Teacher_Id
where o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 and cou.`Status`=0 and c.`Status`=0 and s.`Status`=0 and s.StuId={Student_Id} and s.Group_Id={Group_Id}");
builder.AppendFormat($@"
SELECT s.*,sog.GuestId,o.OrderState,cou.CourseName,cou.CourseId,c.ClassName,c.ClassId,c.ClassStatus,sch.SName,sch.SId,t.TeacherName,o.EnterID,(og.TotalHours-og.CompleteHours) as SurplusHours
FROM rb_student as s LEFT JOIN rb_student_orderguest as sog on s.StuId=sog.Student_Id
LEFT JOIN rb_order_guest as og on og.Id=sog.GuestId
LEFT JOIN rb_order as o on og.OrderId=o.OrderId
LEFT JOIN rb_course as cou on o.CourseId=cou.CourseId
LEFT JOIN rb_class as c on c.ClassId=o.ClassId
LEFT JOIN rb_school as sch on sch.SId=c.School_Id
LEFT JOIN rb_teacher as t on t.TId=c.Teacher_Id
WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 and cou.`Status`=0 and c.`Status`=0 and s.`Status`=0 and s.StuId={Student_Id} and s.Group_Id={Group_Id}");
return Get<RB_Student_ViewModel>(builder.ToString(), parameters).ToList();
}
}
......
......@@ -554,7 +554,16 @@ namespace Edu.WebApi.Controllers.Applet
var PaperId = base.ParmJObj.GetInt("PaperId");
var Id = base.ParmJObj.GetInt("Id");
var GuestId = base.ParmJObj.GetInt("GuestId", 0);
var data = paperModule.AppGetExamPaperInfoModule(PaperId, isShowAnswer: false, GuestId: GuestId, PublishId: Id);
var isShowAnswer = base.ParmJObj.GetBoolValue("isShowAnswer");
if (Id <= 0)
{
return ApiResult.ParamIsNull(message: "请传递考试编号!");
}
if (GuestId <= 0)
{
return ApiResult.ParamIsNull(message: "请传递学员编号!");
}
var data = paperModule.AppGetExamPaperInfoModule(PaperId, isShowAnswer: isShowAnswer, GuestId: GuestId, PublishId: Id);
return ApiResult.Success(data: data);
}
......
......@@ -87,7 +87,7 @@ namespace Edu.WebApi.Controllers.Course
x.ClassStyle,
ClassStyleName = x.ClassStyle.ToName(),
OpenTime = x.OpenTime.ToString("yyyy年MM月dd日"),
EndOrderTime = x.EndOrderTime.HasValue ? x.EndOrderTime.Value.ToString("yyyy年MM月dd日") : "",
EndOrderTime =Common.ConvertHelper.FormatDate2(x.EndOrderTime),
IsCanApply = x.EndOrderTime >= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")) && x.ClassPersion > x.OrderStudentCount ? 1 : 0,
OriginalPrice = x.CourseOriginalPrice,
SellPrice = x.CourseSellPrice,
......
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