|
@@ -1,11 +1,14 @@
|
|
package cn.com.qmth.stmms.admin.exam;
|
|
package cn.com.qmth.stmms.admin.exam;
|
|
|
|
|
|
|
|
+import java.text.DecimalFormat;
|
|
import java.util.LinkedList;
|
|
import java.util.LinkedList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
+import net.sf.json.JSONObject;
|
|
|
|
+
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -51,7 +54,6 @@ import cn.com.qmth.stmms.common.utils.ExportExcel;
|
|
import cn.com.qmth.stmms.common.utils.ExportExcel2;
|
|
import cn.com.qmth.stmms.common.utils.ExportExcel2;
|
|
import cn.com.qmth.stmms.common.utils.PictureUrlBuilder;
|
|
import cn.com.qmth.stmms.common.utils.PictureUrlBuilder;
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
-import net.sf.json.JSONObject;
|
|
|
|
|
|
|
|
@Controller
|
|
@Controller
|
|
@RequestMapping("/admin/exam/score")
|
|
@RequestMapping("/admin/exam/score")
|
|
@@ -133,8 +135,7 @@ public class ScoreController extends BaseParameterController {
|
|
buildSheetUrl(student);
|
|
buildSheetUrl(student);
|
|
buildPackageUrl(student);
|
|
buildPackageUrl(student);
|
|
buildAnswerUrl(student);
|
|
buildAnswerUrl(student);
|
|
- student.setSubjectRemark(
|
|
|
|
- subjectService.find(student.getExamId(), student.getSubjectCode()).getRemark());
|
|
|
|
|
|
+ student.setSubjectRemark(subjectService.find(student.getExamId(), student.getSubjectCode()).getRemark());
|
|
student.setMarked(isMarked(student));
|
|
student.setMarked(isMarked(student));
|
|
Marker marker = markerService.findByStudentId(student.getId());
|
|
Marker marker = markerService.findByStudentId(student.getId());
|
|
if (marker != null) {
|
|
if (marker != null) {
|
|
@@ -288,6 +289,22 @@ public class ScoreController extends BaseParameterController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequestMapping("/getProcess")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public JSONObject getProcess(HttpServletRequest request) {
|
|
|
|
+ int examId = getSessionExamId(request);
|
|
|
|
+ Exam exam = examService.findById(examId);
|
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
|
+ obj.accumulate("running", exam.getStatus().equals(ExamStatus.CALCULATING)?true:false);
|
|
|
|
+ if (exam.getProcess() != null) {
|
|
|
|
+ DecimalFormat format = new DecimalFormat("##.##");
|
|
|
|
+ obj.accumulate("process", format.format(exam.getProcess() * 100));
|
|
|
|
+ } else {
|
|
|
|
+ obj.accumulate("process", 0);
|
|
|
|
+ }
|
|
|
|
+ return obj;
|
|
|
|
+ }
|
|
|
|
+
|
|
private List<ScoreItem> buildScoreList(ExamStudent student) {
|
|
private List<ScoreItem> buildScoreList(ExamStudent student) {
|
|
List<ScoreItem> scoreList = new LinkedList<ScoreItem>();
|
|
List<ScoreItem> scoreList = new LinkedList<ScoreItem>();
|
|
|
|
|