|
|
|
@ -82,9 +82,9 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public SysCaseQuestionStep selectCaseStepDetails(String caseStepId) {
|
|
|
|
|
SysCaseQuestionStep sysCaseQuestionStep = caseQuestionStepMapper.selectByPrimaryKey(caseStepId);
|
|
|
|
|
return sysCaseQuestionStep;
|
|
|
|
|
public TestTestSysCaseQuestionStepWithBLOBs selectCaseStepDetails(String caseStepId) throws IOException {
|
|
|
|
|
TestTestSysCaseQuestionStepWithBLOBs testTestSysCaseQuestionStepWithBLOBs = CaseApi.selectCaseStepDetails(caseStepId);
|
|
|
|
|
return testTestSysCaseQuestionStepWithBLOBs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -93,8 +93,8 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
|
|
|
|
|
StuTrainingStepRecordExample example = new StuTrainingStepRecordExample();
|
|
|
|
|
example.createCriteria().andUserIdEqualTo(commitCaseDto.getUserId()).andCaseStepIdEqualTo(commitCaseDto.getCaseStepId());
|
|
|
|
|
List<StuTrainingStepRecord> stuTrainingStepRecords = trainingStepRecordMapper.selectByExample(example);
|
|
|
|
|
if(stuTrainingStepRecords==null){ //未答过该步骤题目 新增数据到stepRecord表中
|
|
|
|
|
SysCaseQuestionStep dbCaseQuestionStep = selectCaseStepDetails(commitCaseDto.getCaseStepId());
|
|
|
|
|
if(stuTrainingStepRecords.isEmpty()){ //未答过该步骤题目 新增数据到stepRecord表中
|
|
|
|
|
TestTestSysCaseQuestionStepWithBLOBs dbCaseQuestionStep = selectCaseStepDetails(commitCaseDto.getCaseStepId());
|
|
|
|
|
StuTrainingStepRecord stepRecord = new StuTrainingStepRecord();
|
|
|
|
|
stepRecord.setRecordId(String.valueOf(UUID.randomUUID()));
|
|
|
|
|
stepRecord.setUserId(commitCaseDto.getUserId());
|
|
|
|
@ -128,7 +128,7 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
|
|
|
|
|
stepRecord.setScore("0");
|
|
|
|
|
//再修改学生实训表中的部分参数 先获取学生实训表中的数据
|
|
|
|
|
StuTrainingWithBLOBs training = trainingMapper.selectByPrimaryKey(commitCaseDto.getStuTrainingId());
|
|
|
|
|
//如果案例题学生的实验实训完成情况=0 则实训进度+1否则 实训进度不加 并累加案例题学生得分 修改实验实训完成状态
|
|
|
|
|
//如果案例题学生的实验实训完成情况=0 则实训进度+1否则 实训进度不加 修改实验实训完成状态
|
|
|
|
|
if(training.getExpTrainingCompleteStatus()==null){
|
|
|
|
|
if(training.getProgress()==null){
|
|
|
|
|
training.setProgress(BigDecimal.ONE);
|
|
|
|
@ -139,8 +139,6 @@ public class TeaCaseStepServiceImpl implements ITeaCaseStepService {
|
|
|
|
|
}
|
|
|
|
|
if(training.getCaseStuScore()==null){
|
|
|
|
|
training.setCaseStuScore(sysCaseQuestionStep.getScore());
|
|
|
|
|
}else {
|
|
|
|
|
training.setCaseStuScore(training.getCaseStuScore().add(sysCaseQuestionStep.getScore()));
|
|
|
|
|
}
|
|
|
|
|
trainingMapper.updateByPrimaryKeyWithBLOBs(training);
|
|
|
|
|
}
|
|
|
|
|