|
@@ -27,7 +27,6 @@ public class PaperController {
|
|
|
@Autowired
|
|
|
PaperService paperService;
|
|
|
|
|
|
-
|
|
|
|
|
|
* 新增试卷
|
|
|
* @param paper
|
|
@@ -35,14 +34,12 @@ public class PaperController {
|
|
|
*/
|
|
|
@PostMapping(value = "/paper")
|
|
|
public ResponseEntity CreatePaper(@ModelAttribute Paper paper){
|
|
|
- Paper tempPaper = paperService.savePaper(paper);
|
|
|
- ResponseEntity rse = new ResponseEntity(tempPaper,HttpStatus.OK);
|
|
|
- return rse;
|
|
|
+ return new ResponseEntity(paperService.savePaper(paper),HttpStatus.OK);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
* 根据Id获取试卷
|
|
|
- * @param id
|
|
|
+ * @param paper_id
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value="获取单张试卷",notes="获取单张试卷")
|
|
@@ -50,18 +47,19 @@ public class PaperController {
|
|
|
public Paper getPaperById(@PathVariable String paper_id){
|
|
|
return paperService.findById(paper_id);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
* 获取卷库考试试卷
|
|
|
- * @param paper_id
|
|
|
+ * @param exam_id
|
|
|
+ * @param course_code
|
|
|
+ * @param group_code
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping(value = "/paper/list/{exam_id}/{course_code}/{group_code}")
|
|
|
- public List<Paper> listPaperById(
|
|
|
- @PathVariable String exam_id,
|
|
|
- @PathVariable String course_code,
|
|
|
- @PathVariable String group_code){
|
|
|
+ public List<Paper> listPaperById(@PathVariable String exam_id,
|
|
|
+ @PathVariable String course_code,
|
|
|
+ @PathVariable String group_code){
|
|
|
return paperService.listExamPapers(Long.parseLong(exam_id), course_code, group_code);
|
|
|
}
|
|
|
|
|
@@ -75,12 +73,12 @@ public class PaperController {
|
|
|
*/
|
|
|
@PostMapping(value = "/paper/join/{exam_id}/{course_code}/{group_code}/{paper_id}")
|
|
|
public ResponseEntity joinExamPaper(@PathVariable String exam_id,
|
|
|
- @PathVariable String course_code,
|
|
|
- @PathVariable String group_code,
|
|
|
- @PathVariable String paper_id){
|
|
|
- boolean falg = paperService.joinToExamPaper(Long.parseLong(exam_id), course_code, group_code, paper_id);
|
|
|
- ResponseEntity rse = new ResponseEntity(falg,HttpStatus.OK);
|
|
|
- return rse;
|
|
|
+ @PathVariable String course_code,
|
|
|
+ @PathVariable String group_code,
|
|
|
+ @PathVariable String paper_id){
|
|
|
+ paperService.joinToExamPaper(Long.parseLong(exam_id),
|
|
|
+ course_code, group_code, paper_id);
|
|
|
+ return new ResponseEntity(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -93,12 +91,13 @@ public class PaperController {
|
|
|
*/
|
|
|
@DeleteMapping(value = "/paper/release/{exam_id}/{course_code}/{group_code}/{paper_id}")
|
|
|
public ResponseEntity releaseExamPaper(@PathVariable String exam_id,
|
|
|
- @PathVariable String course_code,
|
|
|
- @PathVariable String group_code,
|
|
|
- @PathVariable String paper_id){
|
|
|
- boolean falg = paperService.releaseExamPaper(Long.parseLong(exam_id), course_code, group_code, paper_id);
|
|
|
- ResponseEntity rse = new ResponseEntity(falg,HttpStatus.OK);
|
|
|
- return rse;
|
|
|
+ @PathVariable String course_code,
|
|
|
+ @PathVariable String group_code,
|
|
|
+ @PathVariable String paper_id){
|
|
|
+
|
|
|
+ paperService.releaseExamPaper(Long.parseLong(exam_id),
|
|
|
+ course_code, group_code, paper_id);
|
|
|
+ return new ResponseEntity(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -121,11 +120,10 @@ public class PaperController {
|
|
|
* @return
|
|
|
*/
|
|
|
@DeleteMapping(value = "/paper/deleteCode/{exam_id}/{course_code}/{group_code}")
|
|
|
- public ResponseEntity deleteGropu(@PathVariable String exam_id,
|
|
|
- @PathVariable String course_code,
|
|
|
- @PathVariable String group_code){
|
|
|
- boolean falg = paperService.deletGroupCode(Long.parseLong(exam_id), course_code, group_code);
|
|
|
- ResponseEntity rse = new ResponseEntity(falg,HttpStatus.OK);
|
|
|
- return rse;
|
|
|
+ public ResponseEntity deleteGroup(@PathVariable String exam_id,
|
|
|
+ @PathVariable String course_code,
|
|
|
+ @PathVariable String group_code){
|
|
|
+ paperService.deletGroupCode(Long.parseLong(exam_id), course_code, group_code);
|
|
|
+ return new ResponseEntity(HttpStatus.OK);
|
|
|
}
|
|
|
}
|