|
@@ -35,80 +35,80 @@ public class EPaperStudentController {
|
35
|
35
|
|
36
|
36
|
//学生考试列表
|
37
|
37
|
@PostMapping("/list")
|
38
|
|
- public ResultVo listExamPapersForStudent(@RequestBody EPaperStudent eps){
|
39
|
|
- N_Utils.validation(new Object[]{eps.getStudentid(),"学生id",1});
|
40
|
|
- if(eps.getSstate() == 1){
|
41
|
|
- //进行中
|
|
38
|
+ public ResultVo listExamPapersForStudent(@RequestBody EPaperStudent eps) {
|
|
39
|
+ N_Utils.validation(new Object[]{eps.getStudentid(), "学生id", 1});
|
|
40
|
+ if (eps.getSstate() == 1) {
|
|
41
|
+ //进行中
|
42
|
42
|
List<Map> rtnlst = ePaperStudentService.listExamPapersForStudent(eps);
|
43
|
|
- return new ResultVo(0,"成功获取考试列表",rtnlst);
|
44
|
|
- }else{
|
|
43
|
+ return new ResultVo(0, "成功获取考试列表", rtnlst);
|
|
44
|
+ } else {
|
45
|
45
|
Integer page = eps.getPage();
|
46
|
46
|
Integer pageSize = eps.getPageSize();
|
47
|
|
- N_Utils.validation(new Object[]{page,"显示页码",1,pageSize,"显示条数",1});
|
|
47
|
+ N_Utils.validation(new Object[]{page, "显示页码", 1, pageSize, "显示条数", 1});
|
48
|
48
|
PageHelper.startPage(page, pageSize);
|
49
|
49
|
List<Map> rtnlst = ePaperStudentService.listExamsEndForStudent(eps);
|
50
|
50
|
PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(rtnlst));
|
51
|
|
- return new ResultVo(0,"成功获取考试列表",pageResult);
|
|
51
|
+ return new ResultVo(0, "成功获取考试列表", pageResult);
|
52
|
52
|
}
|
53
|
53
|
}
|
54
|
54
|
|
55
|
55
|
//学生开始考试(android)
|
56
|
56
|
@PostMapping("/spa")
|
57
|
|
- public ResultVo startPaperForAndroid(@RequestBody EPaperStudent eps){
|
58
|
|
- N_Utils.validation(new Object[]{eps.getEpsid(),"学生试卷id",1});
|
|
57
|
+ public ResultVo startPaperForAndroid(@RequestBody EPaperStudent eps) {
|
|
58
|
+ N_Utils.validation(new Object[]{eps.getEpsid(), "学生试卷id", 1});
|
59
|
59
|
List<Map> list = ePaperStudentService.startPaperForAndroid(eps);
|
60
|
|
- return new ResultVo(0,"成功获取学生试卷",list);
|
|
60
|
+ return new ResultVo(0, "成功获取学生试卷", list);
|
61
|
61
|
}
|
|
62
|
+
|
62
|
63
|
//学生开始考试(web)
|
63
|
64
|
@PostMapping("/spw")
|
64
|
|
- public ResultVo startPaperForWeb(@RequestBody EPaperStudent eps){
|
65
|
|
- N_Utils.validation(new Object[]{eps.getEpsid(),"学生试卷id",1});
|
|
65
|
+ public ResultVo startPaperForWeb(@RequestBody EPaperStudent eps) {
|
|
66
|
+ N_Utils.validation(new Object[]{eps.getEpsid(), "学生试卷id", 1});
|
66
|
67
|
EPaperStudentVo psvo = ePaperStudentService.startPaperForWeb(eps);
|
67
|
|
- return new ResultVo(0,"成功获取学生试卷",psvo);
|
|
68
|
+ return new ResultVo(0, "成功获取学生试卷", psvo);
|
68
|
69
|
}
|
69
|
70
|
|
70
|
71
|
//提交单题
|
71
|
72
|
@PostMapping("/scq")
|
72
|
|
- public ResultVo saveCommitQuestion(@RequestBody EPaperStudentQuestion sq){
|
73
|
|
- try {
|
74
|
|
- N_Utils.validation(new Object[]{sq.getEpsqid(),"试题id",1});
|
75
|
|
- ePaperStudentService.saveCommitQuestion(sq);
|
76
|
|
- return new ResultVo(0,"成功提交试题");
|
77
|
|
- }catch (Exception e){
|
78
|
|
- return new ResultVo(1,"提交试题失败");
|
79
|
|
- }
|
|
73
|
+ public ResultVo saveCommitQuestion(@RequestBody EPaperStudentQuestion sq) {
|
|
74
|
+ try {
|
|
75
|
+ N_Utils.validation(new Object[]{sq.getEpsqid(), "试题id", 1});
|
|
76
|
+ ePaperStudentService.saveCommitQuestion(sq);
|
|
77
|
+ return new ResultVo(0, "成功提交试题");
|
|
78
|
+ } catch (Exception e) {
|
|
79
|
+ return new ResultVo(1, "提交试题失败");
|
|
80
|
+ }
|
80
|
81
|
}
|
|
82
|
+
|
81
|
83
|
//提交试卷
|
82
|
84
|
@PostMapping("/scp")
|
83
|
|
- public ResultVo saveCommitPaper(@RequestBody EPaperStudent ps){
|
|
85
|
+ public ResultVo saveCommitPaper(@RequestBody EPaperStudent ps) {
|
84
|
86
|
try {
|
85
|
|
- N_Utils.validation(new Object[]{ps.getEpsid(),"试卷id",1});
|
|
87
|
+ N_Utils.validation(new Object[]{ps.getEpsid(), "试卷id", 1});
|
86
|
88
|
ePaperStudentService.saveCommitPaper(ps.getEpsid());
|
87
|
|
- return new ResultVo(0,"成功提交试卷");
|
88
|
|
- }catch (Exception e){
|
89
|
|
- log.error("提交试卷失败:"+e.getMessage());
|
90
|
|
- return new ResultVo(1,"提交失败");
|
|
89
|
+ return new ResultVo(0, "成功提交试卷");
|
|
90
|
+ } catch (Exception e) {
|
|
91
|
+ log.error("提交试卷失败:" + e.getMessage());
|
|
92
|
+ return new ResultVo(1, "提交失败");
|
91
|
93
|
}
|
92
|
94
|
}
|
93
|
95
|
|
94
|
96
|
//提交试卷--网页端
|
95
|
97
|
@PostMapping("/scpw")
|
96
|
|
- public ResultVo saveCommitPaperWeb(@RequestBody PaperStudentWebVo ps){
|
|
98
|
+ public ResultVo saveCommitPaperWeb(@RequestBody PaperStudentWebVo ps) {
|
97
|
99
|
try {
|
98
|
|
- N_Utils.validation(new Object[]{ps.getEpsid(),"试卷id",1});
|
|
100
|
+ N_Utils.validation(new Object[]{ps.getEpsid(), "试卷id", 1});
|
99
|
101
|
List<EPaperStudentQuestion> qlist = ps.getQuestions();
|
100
|
|
- if(N_Utils.isListEmpty(qlist)){
|
101
|
|
- return new ResultVo(1,"试题");
|
|
102
|
+ if (N_Utils.isListEmpty(qlist)) {
|
|
103
|
+ return new ResultVo(1, "试题");
|
102
|
104
|
}
|
103
|
105
|
ePaperStudentService.saveCommitPaperForWeb(ps);
|
104
|
|
- return new ResultVo(0,"成功提交试卷");
|
105
|
|
- }catch (Exception e){
|
106
|
|
- log.error("提交试卷(web)失败:"+e.getMessage());
|
107
|
|
- return new ResultVo(1,"提交失败");
|
|
106
|
+ return new ResultVo(0, "成功提交试卷");
|
|
107
|
+ } catch (Exception e) {
|
|
108
|
+ log.error("提交试卷(web)失败:" + e.getMessage());
|
|
109
|
+ return new ResultVo(1, "提交失败");
|
108
|
110
|
}
|
109
|
111
|
}
|
110
|
112
|
|
111
|
113
|
|
112
|
|
-
|
113
|
|
-
|
114
|
114
|
}
|