|
|
|
@ -143,7 +143,7 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
return ServiceResult.OprateFailed("该考试管理的试卷已被删除,暂不可变更调整分!"); |
|
|
|
|
|
|
|
|
|
entity.AdjustScore = edit.AdjustScore; |
|
|
|
|
entity.Score += entity.AdjustScore; |
|
|
|
|
//entity.Score += entity.AdjustScore; |
|
|
|
|
|
|
|
|
|
string score1 = Regex.Replace(entity.Score.ToString(), @"\.(0+)$", "") + "/" + Regex.Replace(entity.Score.ToString(), @"\.(0+)$", ""); |
|
|
|
|
if (entity.Score < 0) |
|
|
|
@ -151,6 +151,11 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
if (entity.Score > paper.TotalScore) |
|
|
|
|
return ServiceResult.OprateFailed($"调整后得分为【{score1}】,不可大于卷面总分【{Regex.Replace(paper.TotalScore.ToString(), @"\.(0+)$", "") + "/" + Regex.Replace(paper.TotalScore.ToString(), @"\.(0+)$", "")}】!"); |
|
|
|
|
|
|
|
|
|
var paperId = entity.ExamPaperId; |
|
|
|
|
var examPaper = await Db.Queryable<Ghre_ExamPaper>().Where(x => x.Id == paperId).FirstAsync(); |
|
|
|
|
if (examPaper != null) |
|
|
|
|
entity.IsPass = examPaper.PassScore > (entity.Score + entity.AdjustScore) ? false : true; |
|
|
|
|
|
|
|
|
|
await Update(entity); |
|
|
|
|
|
|
|
|
|
return ServiceResult.OprateSuccess("修改成功!"); |
|
|
|
@ -329,6 +334,11 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
recordDetail.IsCorrect = x.Score == x.RealScore ? true : false; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var paperId = record.ExamPaperId; |
|
|
|
|
var examPaper = await Db.Queryable<Ghre_ExamPaper>().Where(x => x.Id == paperId).FirstAsync(); |
|
|
|
|
if (examPaper != null) |
|
|
|
|
record.IsPass = examPaper.PassScore > (record.Score + record.AdjustScore) ? false : true; |
|
|
|
|
|
|
|
|
|
await Db.Updateable(record).ExecuteCommandAsync(); |
|
|
|
|
await Db.Updateable(details).ExecuteCommandAsync(); |
|
|
|
|
|
|
|
|
|