This commit is contained in:
parent
331172c12b
commit
0aac9cb8fc
|
@ -583,35 +583,43 @@ namespace WebAPI.Controllers
|
||||||
string returnTestRecordId = string.Empty;
|
string returnTestRecordId = string.Empty;
|
||||||
////考试分数
|
////考试分数
|
||||||
decimal getTestScores = APITestRecordService.getSubmitTestRecord(getTestRecord);
|
decimal getTestScores = APITestRecordService.getSubmitTestRecord(getTestRecord);
|
||||||
////及格分数
|
|
||||||
int getPassScores = 80;
|
if (!string.IsNullOrEmpty(getTestRecord.TestPlanId))
|
||||||
var testRule = db.Sys_TestRule.FirstOrDefault();
|
{ ////及格分数
|
||||||
if (testRule != null)
|
int getPassScores = 80;
|
||||||
{
|
var testRule = db.Sys_TestRule.FirstOrDefault();
|
||||||
getPassScores = testRule.PassingScore;
|
if (testRule != null)
|
||||||
}
|
|
||||||
if (getTestScores <= getPassScores)
|
|
||||||
{
|
|
||||||
int testCount = db.Training_TestRecord.Where(x => x.TestPlanId == getTestRecord.TestPlanId && x.TestManId == getTestRecord.TestManId).Count();
|
|
||||||
if (testCount < 2)
|
|
||||||
{
|
{
|
||||||
////重新生成一条考试记录 以及考试试卷
|
getPassScores = testRule.PassingScore;
|
||||||
returnTestRecordId = APITestRecordService.getResitTestRecord(getTestRecord);
|
}
|
||||||
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,您将进入补考。";
|
if (getTestScores <= getPassScores)
|
||||||
|
{
|
||||||
|
int testCount = db.Training_TestRecord.Where(x => x.TestPlanId == getTestRecord.TestPlanId && x.TestManId == getTestRecord.TestManId).Count();
|
||||||
|
if (testCount < 2)
|
||||||
|
{
|
||||||
|
////重新生成一条考试记录 以及考试试卷
|
||||||
|
returnTestRecordId = APITestRecordService.getResitTestRecord(getTestRecord);
|
||||||
|
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,您将进入补考。";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
APITestRecordService.updateAll(getTestRecord.TestPlanId);
|
||||||
|
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,请再次参加培训后补考。";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
APITestRecordService.updateAll(getTestRecord.TestPlanId);
|
APITestRecordService.updateAll(getTestRecord.TestPlanId);
|
||||||
responeData.message = "考试不合格!您的成绩为:【" + getTestScores.ToString() + "】,请再次参加培训后补考。";
|
responeData.message = "恭喜考试通过!您的成绩为:【" + getTestScores.ToString() + "】。";
|
||||||
}
|
} responeData.data = new { getTestScores, getPassScores, returnTestRecordId };
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
APITestRecordService.updateAll(getTestRecord.TestPlanId);
|
responeData.data = new { getTestScores };
|
||||||
responeData.message = "恭喜考试通过!您的成绩为:【" + getTestScores.ToString() + "】。";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
responeData.data = new { getTestScores, getPassScores, returnTestRecordId };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue