|
@@ -177,9 +177,7 @@ public class EPaperStudentService {
|
177
|
177
|
**/
|
178
|
178
|
public Map startPaperForAndroid(EPaperStudent eps) throws Exception {
|
179
|
179
|
Integer epsid = eps.getEpsid();
|
180
|
|
- /*Integer pstate = ePaperStudentMapper.getSubjectStateByEpsid(epsid);
|
181
|
|
- if(pstate == 2) throw new MissingParametersException("考试已结束禁止操作");
|
182
|
|
-*/
|
|
180
|
+
|
183
|
181
|
Map ssmap = ePaperStudentMapper.getSubjectStateAndSstageByEpsid(epsid);
|
184
|
182
|
Integer pstate = Integer.parseInt(ssmap.get("pstate").toString());
|
185
|
183
|
if(pstate == 2) throw new MissingParametersException("考试已结束禁止操作");
|
|
@@ -187,6 +185,17 @@ public class EPaperStudentService {
|
187
|
185
|
Integer sstate = Integer.parseInt(ssmap.get("sstate").toString());
|
188
|
186
|
if(sstate >= 2) throw new MissingParametersException("试卷已提交");
|
189
|
187
|
|
|
188
|
+ String sdate = ssmap.get("sdate").toString();
|
|
189
|
+ String sbegintime = ssmap.get("begintime").toString();
|
|
190
|
+ int nowstamp = N_Utils.getSecondTimestamp();
|
|
191
|
+ long beginstamp = ExamUtil.getTimestrToTimetamp(sdate + " " + sbegintime + " 00");
|
|
192
|
+ if(nowstamp < beginstamp){
|
|
193
|
+ long diff = (beginstamp - nowstamp)/60;
|
|
194
|
+ if(diff > 5){
|
|
195
|
+ throw new MissingParametersException("距离开考超过5分钟,请耐心等待");
|
|
196
|
+ }
|
|
197
|
+ }
|
|
198
|
+
|
190
|
199
|
Map rtnmap = new HashMap();
|
191
|
200
|
//获取试卷基本信息
|
192
|
201
|
EPaperStudentVo psvo = ePaperStudentMapper.getExamSubjectByEpsid(epsid);
|
|
@@ -258,8 +267,6 @@ public class EPaperStudentService {
|
258
|
267
|
**/
|
259
|
268
|
public Map startPaperForWeb(EPaperStudent eps) throws Exception {
|
260
|
269
|
Integer epsid = eps.getEpsid();
|
261
|
|
-// Integer examstate = ePaperStudentMapper.getExamStateByEpsId(epsid);
|
262
|
|
-// if (2 <= examstate) throw new MissingParametersException("考试已结束禁止操作");
|
263
|
270
|
Map ssmap = ePaperStudentMapper.getSubjectStateAndSstageByEpsid(epsid);
|
264
|
271
|
Integer pstate = Integer.parseInt(ssmap.get("pstate").toString());
|
265
|
272
|
if(pstate == 2) throw new MissingParametersException("考试已结束禁止操作");
|
|
@@ -267,6 +274,17 @@ public class EPaperStudentService {
|
267
|
274
|
Integer sstate = Integer.parseInt(ssmap.get("sstate").toString());
|
268
|
275
|
if(sstate >= 2) throw new MissingParametersException("试卷已提交");
|
269
|
276
|
|
|
277
|
+ String sdate = ssmap.get("sdate").toString();
|
|
278
|
+ String sbegintime = ssmap.get("begintime").toString();
|
|
279
|
+ int nowstamp = N_Utils.getSecondTimestamp();
|
|
280
|
+ long beginstamp = ExamUtil.getTimestrToTimetamp(sdate + " " + sbegintime + ":00");
|
|
281
|
+ if(nowstamp < beginstamp){
|
|
282
|
+ long diff = beginstamp - nowstamp;
|
|
283
|
+ if(diff > 300){
|
|
284
|
+ throw new MissingParametersException("未到考试时间,请耐心等待");
|
|
285
|
+ }
|
|
286
|
+ }
|
|
287
|
+
|
270
|
288
|
//获取试卷基本信息
|
271
|
289
|
// EPaperStudentVo psvo = ePaperStudentMapper.getExamSubjectByEpsid(epsid);
|
272
|
290
|
Map map = ePaperStudentMapper.getExamSubjectPaperByEpsid(epsid);
|