Commit f447a06ea281f4af12e654a0e5048d96713043a2
1 parent
a8551bb1
1.修复bug
Showing
3 changed files
with
40 additions
and
19 deletions
WebRoot/WEB-INF/jsp/sunvote/paper/test_list2.jsp
| ... | ... | @@ -114,9 +114,9 @@ |
| 114 | 114 | maxFractionDigits="2" />%</span> |
| 115 | 115 | </c:if> |
| 116 | 116 | <c:if test="${right>50}"> |
| 117 | - <span style="color:red"><fmt:formatNumber type="number" | |
| 117 | + <fmt:formatNumber type="number" | |
| 118 | 118 | value="${right}" |
| 119 | - maxFractionDigits="2" />%</span> | |
| 119 | + maxFractionDigits="2" />% | |
| 120 | 120 | </c:if> |
| 121 | 121 | |
| 122 | 122 | |
| ... | ... | @@ -127,15 +127,29 @@ |
| 127 | 127 | value="${var.ANSWERNUM == 0 ? 0: (var.RIGHTNUM / var.ANSWERNUM)*var.QUESTION_SCORE}" |
| 128 | 128 | maxFractionDigits="2" /> |
| 129 | 129 | </td> |
| 130 | - <c:forEach items="${var.optin_info}" begin="0" end="${pd.MAX}" var="var1" varStatus="vs"> | |
| 131 | - <td>${var1}</td> | |
| 132 | - <td> | |
| 133 | - <fmt:formatNumber type="number" | |
| 134 | - value="${var.ANSWERNUM == 0 ? 0: (var1 / var.ANSWERNUM * 100)}" | |
| 135 | - maxFractionDigits="2" />% | |
| 136 | - </td> | |
| 130 | + <c:set var="lth" value="${fn:length(var.optin_info)-1}"></c:set> | |
| 131 | + <c:set var="optin_info" value="${var.optin_info}"></c:set> | |
| 132 | + <c:forEach begin="0" end="${pd.MAX}" varStatus="vs"> | |
| 133 | + <c:if test="${lth>vs.index}"> | |
| 134 | + <td>${optin_info[vs.index]}</td> | |
| 135 | + <td> | |
| 136 | + <fmt:formatNumber type="number" | |
| 137 | + value="${var.ANSWERNUM == 0 ? 0: (optin_info[vs.index] / var.ANSWERNUM * 100)}" | |
| 138 | + maxFractionDigits="2" />% | |
| 139 | + </td> | |
| 140 | + </c:if> | |
| 141 | + <c:if test="${lth<vs.index}"> | |
| 142 | + <td>--</td> | |
| 143 | + <td>--</td> | |
| 144 | + </c:if> | |
| 145 | + | |
| 137 | 146 | </c:forEach> |
| 138 | - | |
| 147 | + <td>${var.optin_info[lth]}</td> | |
| 148 | + <td> | |
| 149 | + <fmt:formatNumber type="number" | |
| 150 | + value="${var.ANSWERNUM == 0 ? 0: (var.optin_info[lth] / var.ANSWERNUM * 100)}" | |
| 151 | + maxFractionDigits="2" />% | |
| 152 | + </td> | |
| 139 | 153 | </tr> |
| 140 | 154 | |
| 141 | 155 | </c:forEach> | ... | ... |
src/com/fh/controller/sunvote/paper/PaperController.java
| ... | ... | @@ -609,15 +609,19 @@ public class PaperController extends BaseController { |
| 609 | 609 | s = s.replace("]", ""); |
| 610 | 610 | List<String> optoin = Arrays.asList(s.split(",")); |
| 611 | 611 | for(int y = 0 ;y<max;y++){ |
| 612 | - Integer nn = Integer.valueOf(optoin.get(y)); | |
| 613 | - nn = (nn==null?0:nn); | |
| 612 | + Integer nn = 0; | |
| 613 | + if((optoin.size()-1)>y){ | |
| 614 | + nn = Integer.valueOf(optoin.get(y)); | |
| 615 | + }else{ | |
| 616 | + break; | |
| 617 | + } | |
| 614 | 618 | vpd.put("var"+(8+2*y), nn); //8 |
| 615 | 619 | vpd.put("var"+(9+2*y), decimalFormat.format(nn*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))+"%"); //9 |
| 616 | 620 | |
| 617 | 621 | } |
| 618 | 622 | |
| 619 | - vpd.put("var"+(max*2+8), Integer.valueOf(optoin.get(max))); //8 | |
| 620 | - vpd.put("var"+(max*2+9), decimalFormat.format(Integer.valueOf(optoin.get(max))*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))+"%"); //9 | |
| 623 | + vpd.put("var"+(max*2+8), Integer.valueOf(optoin.get(optoin.size()-1))); //8 | |
| 624 | + vpd.put("var"+(max*2+9), decimalFormat.format(Integer.valueOf(optoin.get(optoin.size()-1))*100/Integer.valueOf(varOList.get(i).getString("ANSWERNUM")))+"%"); //9 | |
| 621 | 625 | |
| 622 | 626 | varList.add(vpd); |
| 623 | 627 | } | ... | ... |
src/com/fh/controller/sunvote/report/ReportController.java
| ... | ... | @@ -99,7 +99,7 @@ public class ReportController extends BaseController { |
| 99 | 99 | if(studentPd != null && item.get("STUDENT_ID").equals(studentPd.get("STUDENT_ID"))){ |
| 100 | 100 | // |
| 101 | 101 | String score = item.getString("SCORE"); |
| 102 | - if(!"0".equals(score)){ | |
| 102 | + if(!"".equals(score)){ | |
| 103 | 103 | studentPd.put(item.get("TEST_ID"), item.get("SCORE")); |
| 104 | 104 | }else{ |
| 105 | 105 | studentPd.put(item.get("TEST_ID"), "--"); |
| ... | ... | @@ -131,7 +131,7 @@ public class ReportController extends BaseController { |
| 131 | 131 | studentPd.put("STUDENT_ID", item.get("STUDENT_ID")); |
| 132 | 132 | studentPd.put("NAME", item.get("NAME")); |
| 133 | 133 | String score = item.getString("SCORE"); |
| 134 | - if(!"0".equals(score)){ | |
| 134 | + if(!"".equals(score)){ | |
| 135 | 135 | studentPd.put(item.get("TEST_ID"), item.get("SCORE")); |
| 136 | 136 | }else{ |
| 137 | 137 | studentPd.put(item.get("TEST_ID"), "--"); |
| ... | ... | @@ -274,9 +274,9 @@ public class ReportController extends BaseController { |
| 274 | 274 | studentTestList.add(tmp); |
| 275 | 275 | }else{ |
| 276 | 276 | if(studentPd != null){ |
| 277 | - if(getScore > maxScore){ | |
| 278 | - maxScore = getScore ; | |
| 279 | - } | |
| 277 | +// if(getScore > maxScore){ | |
| 278 | +// maxScore = getScore ; | |
| 279 | +// } | |
| 280 | 280 | studentPd.put("GETSCORE", getScore); |
| 281 | 281 | studentPd.put("testList", studentTestList); |
| 282 | 282 | studentList.add(studentPd); |
| ... | ... | @@ -301,6 +301,9 @@ public class ReportController extends BaseController { |
| 301 | 301 | studentTestList.add(tmp); |
| 302 | 302 | |
| 303 | 303 | } |
| 304 | + if(getScore > maxScore){ | |
| 305 | + maxScore = getScore ; | |
| 306 | + } | |
| 304 | 307 | } |
| 305 | 308 | if(studentPd != null){ |
| 306 | 309 | studentPd.put("GETSCORE", getScore); | ... | ... |