Commit a1869fd90ebb3a0fbc3a45fd45c857e6a54e0fee
1 parent
9006450d
1.修改课后练图表bug
Showing
2 changed files
with
6 additions
and
3 deletions
WebRoot/WEB-INF/jsp/sunvote/homework/homework_list.jsp
WebRoot/WEB-INF/jsp/sunvote/homework/homework_report.jsp
... | ... | @@ -295,11 +295,14 @@ |
295 | 295 | stundent_num[j]=res.DATA[j].length; |
296 | 296 | } |
297 | 297 | max_num=Math.max.apply(null,stundent_num); |
298 | + if(max_num==0){ | |
299 | + _html='<div style="height:200px;"></div>'; | |
300 | + } | |
298 | 301 | for(i=0;i<res.DATA.length;i++){ |
299 | 302 | if(res.ANSWER.indexOf(String.fromCharCode(65+i))>-1){ |
300 | - _html += '<div class="ans_list" style="height:'+(stundent_num[i]*200/max_num).toFixed(2)+'px;"><div class="rel ans_correct"><p class="p_num">'+res.DATA[i].length+'人</p></div><p class="ans_option">'+String.fromCharCode(65+i)+'</p></div>' | |
303 | + _html += '<div class="ans_list" style="height:'+(max_num==0?0:(stundent_num[i]*200/max_num).toFixed(2))+'px;"><div class="rel ans_correct"><p class="p_num">'+res.DATA[i].length+'人</p></div><p class="ans_option">'+String.fromCharCode(65+i)+'</p></div>' | |
301 | 304 | }else{ |
302 | - _html += '<div class="ans_list" style="height:'+(stundent_num[i]*200/max_num).toFixed(2)+'px;"><div class="rel ans_error"><p class="p_num">'+res.DATA[i].length+'人</p></div><p class="ans_option">'+String.fromCharCode(65+i)+'</p></div>'; | |
305 | + _html += '<div class="ans_list" style="height:'+(max_num==0?0:(stundent_num[i]*200/max_num).toFixed(2))+'px;"><div class="rel ans_error"><p class="p_num">'+res.DATA[i].length+'人</p></div><p class="ans_option">'+String.fromCharCode(65+i)+'</p></div>'; | |
303 | 306 | } |
304 | 307 | } |
305 | 308 | var student_option_list=''; | ... | ... |