Commit 05f4feee791e233ff835c104530d691d0985218c
1 parent
6de2192e
删除无用代码
Showing
1 changed file
with
0 additions
and
69 deletions
src/com/fh/controller/sunvote/homework/HomeworkController.java
@@ -322,75 +322,6 @@ public class HomeworkController extends BaseController { | @@ -322,75 +322,6 @@ public class HomeworkController extends BaseController { | ||
322 | return modelAndView; | 322 | return modelAndView; |
323 | } | 323 | } |
324 | 324 | ||
325 | - /** | ||
326 | - * 传入homework_id | ||
327 | - * index 第几题 | ||
328 | - * @return | ||
329 | - * @throws Exception | ||
330 | - */ | ||
331 | - @RequestMapping(value = "/homeworkindexview") | ||
332 | - public ModelAndView homeworkindexview() throws Exception { | ||
333 | - PageData pageData = this.getPageData(); | ||
334 | - ModelAndView modelAndView = getModelAndView(); | ||
335 | - | ||
336 | - String homeworkId = pageData.getString("HOMEWORK_ID"); | ||
337 | - String index = pageData.getString("INDEX"); | ||
338 | - int indexint = Integer.parseInt(index); | ||
339 | - List<PageData> data = homeworkReporkService.findNoAnswerByHomeworkID(pageData); | ||
340 | - List<PageData> result = new ArrayList(); | ||
341 | - PageData aresult = new PageData(); | ||
342 | - aresult.put("ANSWER", "A"); | ||
343 | - PageData bresult = new PageData(); | ||
344 | - bresult.put("ANSWER", "B"); | ||
345 | - PageData cresult = new PageData(); | ||
346 | - cresult.put("ANSWER", "C"); | ||
347 | - PageData dresult = new PageData(); | ||
348 | - dresult.put("ANSWER", "D"); | ||
349 | - PageData eresult = new PageData(); | ||
350 | - eresult.put("ANSWER", ""); | ||
351 | - result.add(aresult); | ||
352 | - result.add(bresult); | ||
353 | - result.add(cresult); | ||
354 | - result.add(dresult); | ||
355 | - result.add(eresult); | ||
356 | - for(PageData pd : data){ | ||
357 | - String answer = pd.getString("ANSWER"); | ||
358 | - if(!StringUtils.isEmpty(answer)){ | ||
359 | - String[] answers = answer.split(";"); | ||
360 | - if(answers.length >= indexint -1){ | ||
361 | - String ans = answers[indexint - 1]; | ||
362 | - String[] anss = ans.split(":"); | ||
363 | - if(anss != null && anss.length == 2){ | ||
364 | - PageData tresult = null; | ||
365 | - for(PageData ptd : result){ | ||
366 | - if(anss[0].toUpperCase().equals(anss[0].toUpperCase())){ | ||
367 | - tresult = ptd; | ||
368 | - } | ||
369 | - } | ||
370 | - if(tresult == null){ | ||
371 | - tresult = new PageData(); | ||
372 | - result.add(tresult); | ||
373 | - } | ||
374 | - List<String> list = (List)tresult.get("STUDENTS"); | ||
375 | - if(list == null){ | ||
376 | - list = new ArrayList(); | ||
377 | - } | ||
378 | - list.add(pd.getString("STUDENT_NAME")); | ||
379 | - tresult.put("ANSWER", anss[0].toUpperCase()); | ||
380 | - tresult.put("STUDENTS", list); | ||
381 | - tresult.put("RIGHT", !"0".equals(anss[1])); | ||
382 | - } | ||
383 | - } | ||
384 | - } | ||
385 | - } | ||
386 | - | ||
387 | - modelAndView.addObject("datas", new Gson().toJson(result)); | ||
388 | -// modelAndView.addObject("datas",result); | ||
389 | - | ||
390 | - modelAndView.setViewName(""); | ||
391 | - return modelAndView; | ||
392 | - } | ||
393 | - | ||
394 | 325 | ||
395 | /** | 326 | /** |
396 | * 传入homework_id | 327 | * 传入homework_id |