|
@@ -7,6 +7,9 @@ import java.util.Map;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
+import net.sf.json.JSONArray;
|
|
|
+import net.sf.json.JSONObject;
|
|
|
+
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -18,14 +21,15 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import cn.com.qmth.stmms.biz.campus.model.Campus;
|
|
|
import cn.com.qmth.stmms.biz.campus.service.CampusService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
+import cn.com.qmth.stmms.common.enums.ExamType;
|
|
|
import cn.com.qmth.stmms.common.utils.PictureUrlBuilder;
|
|
|
-import net.sf.json.JSONArray;
|
|
|
-import net.sf.json.JSONObject;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping("/admin/exam/check/answer")
|
|
@@ -40,6 +44,9 @@ public class AnswerCheckController extends BaseExamController {
|
|
|
@Autowired
|
|
|
private CampusService campusService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ExamService examService;
|
|
|
+
|
|
|
@Value("${sheet.image.server}")
|
|
|
private String sheetServer;
|
|
|
|
|
@@ -47,7 +54,11 @@ public class AnswerCheckController extends BaseExamController {
|
|
|
public ModelAndView index(HttpServletRequest request) {
|
|
|
int examId = getSessionExamId(request);
|
|
|
if (examId > 0) {
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
ModelAndView view = new ModelAndView("modules/exam/checkAnswer");
|
|
|
+ if (ExamType.MULTI_MEDIA.equals(exam.getType())) {
|
|
|
+ view = new ModelAndView("modules/exam/permission");
|
|
|
+ }
|
|
|
return view;
|
|
|
} else {
|
|
|
return new ModelAndView("redirect:/admin/exam/list");
|
|
@@ -128,13 +139,15 @@ public class AnswerCheckController extends BaseExamController {
|
|
|
result.accumulate("absent", student.isAbsent());
|
|
|
|
|
|
Campus campus = campusService.findBySchoolAndName(student.getSchoolId(), student.getCampusName());
|
|
|
- result.accumulate("sheetUrls", PictureUrlBuilder.getSheetUrls(student.getExamId(), campus.getId(),
|
|
|
- student.getSubjectCode(), student.getExamNumber(), student.getSheetCount()));
|
|
|
+ result.accumulate(
|
|
|
+ "sheetUrls",
|
|
|
+ PictureUrlBuilder.getSheetUrls(student.getExamId(), campus.getId(), student.getSubjectCode(),
|
|
|
+ student.getExamNumber(), student.getSheetCount()));
|
|
|
|
|
|
JSONArray array = new JSONArray();
|
|
|
Map<Integer, String> titles = new HashMap<Integer, String>();
|
|
|
- List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjectiveAndPaperType(student.getExamId(),
|
|
|
- student.getSubjectCode(), true, student.getPaperType());
|
|
|
+ List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjectiveAndPaperType(
|
|
|
+ student.getExamId(), student.getSubjectCode(), true, student.getPaperType());
|
|
|
List<String> answers = student.getAnswerList();
|
|
|
if (questions.isEmpty()) {
|
|
|
// 未设置客观题或无客观题
|