成长路径图,考试同步,限制事务范围

This commit is contained in:
yang
2024-07-10 16:55:17 +08:00
parent 91b0b899b0
commit bd25fc1d1a
3 changed files with 12 additions and 6 deletions

View File

@@ -547,7 +547,8 @@ public class AloneExamApi extends ApiBaseController {
//Float realScore=this.calculateScore(answer); //Float realScore=this.calculateScore(answer);
//转化成百分数 //转化成百分数
//answer.setScore(this.calculateScore(detail)); //answer.setScore(this.calculateScore(detail));
service.submit(answer,scoreType,request); service.submit(answer,scoreType);
service.syncExamScoreToCourseSuite(answer, request);
return success(map); return success(map);
} catch (Exception e) { } catch (Exception e) {
log.error("提交答卷错误", e); log.error("提交答卷错误", e);

View File

@@ -96,10 +96,16 @@ public interface IAloneExamService {
* 提交考试 * 提交考试
* *
* @param aea * @param aea
*/
void submit(AloneExamAnswer aea, Integer scoreType);
/**
* 同步考试成绩
* @param aea
* @param request * @param request
*/ */
void submit(AloneExamAnswer aea, Integer scoreType, HttpServletRequest request); void syncExamScoreToCourseSuite(AloneExamAnswer aea, HttpServletRequest request);
/** /**
* 更新答案 * 更新答案
* @param id * @param id

View File

@@ -73,7 +73,7 @@ public class AloneExamServiceImpl implements IAloneExamService{
@Override @Override
@Transactional(propagation = Propagation.REQUIRES_NEW) @Transactional(propagation = Propagation.REQUIRES_NEW)
public void submit(AloneExamAnswer aea, Integer scoreType, HttpServletRequest request){ public void submit(AloneExamAnswer aea, Integer scoreType){
//dao.update(aea); //dao.update(aea);
aea.setStatus(AloneExamAnswer.STATUS_FINISH); aea.setStatus(AloneExamAnswer.STATUS_FINISH);
LocalDateTime now=LocalDateTime.now(); LocalDateTime now=LocalDateTime.now();
@@ -120,9 +120,8 @@ public class AloneExamServiceImpl implements IAloneExamService{
// //这种情况汶是不存在的 // //这种情况汶是不存在的
// } // }
} }
syncExamScoreToCourseSuite(aea, request);
} }
@Override
public void syncExamScoreToCourseSuite(AloneExamAnswer aea, HttpServletRequest request) { public void syncExamScoreToCourseSuite(AloneExamAnswer aea, HttpServletRequest request) {
String token = request.getHeader("Xboe-Access-Token"); String token = request.getHeader("Xboe-Access-Token");
if (StringUtils.isEmpty(token)) { if (StringUtils.isEmpty(token)) {