|
@@ -135,7 +135,7 @@ public class ReviewController {
|
|
|
|
|
|
@RequestMapping(value = "/saveCorrectAnswer", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/saveCorrectAnswer", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public void updateCorrectAnswer(String itemId,String reportId, String workerId,String paperId,String jobId,String answer,@RequestParam("attachment_location") List<String> file_url, String grade, HttpServletResponse response) {
|
|
|
|
|
|
+ public void updateCorrectAnswer(String itemId,String reportId, String workerId,String paperId,String jobId,@RequestParam("answer")List<String> answer,@RequestParam("attachment_location") List<String> file_url, String grade, HttpServletResponse response) {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
if (iservice.saveCorrectAnswer(itemId, reportId, workerId, paperId, jobId, answer, file_url, grade)) {
|
|
if (iservice.saveCorrectAnswer(itemId, reportId, workerId, paperId, jobId, answer, file_url, grade)) {
|
|
result.put("status", "200");
|
|
result.put("status", "200");
|
|
@@ -168,4 +168,24 @@ public class ReviewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "/saveAnswer", method = RequestMethod.POST)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public void saveAnswer(String itemId, String reportId, String workerId,String grade, HttpServletResponse response){
|
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
|
+ if(iservice.setGrade(itemId,reportId,workerId,grade)){
|
|
|
|
+ result.put("status", "200");
|
|
|
|
+ } else {
|
|
|
|
+ result.put("status", "500");
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ PrintWriter out = response.getWriter();
|
|
|
|
+ out.print(result);
|
|
|
|
+ out.flush();
|
|
|
|
+ out.close();
|
|
|
|
+ }catch (IOException e) {
|
|
|
|
+ // TODO Auto-generated catch block
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|