Commit aa853175906b48561f786d83d8c1544828357470

Authored by jack
1 parent 1102ee1e

1.更新代码

WebRoot/WEB-INF/jsp/sunvote/homework/homework_report.jsp
@@ -91,10 +91,12 @@ @@ -91,10 +91,12 @@
91 margin:0 10px; 91 margin:0 10px;
92 } 92 }
93 .ans_list p{ 93 .ans_list p{
  94 + margin:auto;
94 margin-bottom:0; 95 margin-bottom:0;
95 margin-top:5px; 96 margin-top:5px;
96 line-height:20px; 97 line-height:20px;
97 text-align:center; 98 text-align:center;
  99 +
98 } 100 }
99 .ans_option{ 101 .ans_option{
100 cursor: pointer; 102 cursor: pointer;
@@ -165,9 +167,11 @@ @@ -165,9 +167,11 @@
165 <col style="width: 20%" /> 167 <col style="width: 20%" />
166 <tbody> 168 <tbody>
167 <tr> 169 <tr>
168 - <td>提交情况:25/30</td> 170 + <td>提交情况:${page_data.COMPLETE_DESC}</td>
169 <td>题量:${page_data.QUESTION_COUNT}</td> 171 <td>题量:${page_data.QUESTION_COUNT}</td>
170 - <td>最高得分率:${page_data.GET_MAX_SCORE*100/page_data.ALL_SCORE}%</td> 172 + <td>最高得分率:<fmt:formatNumber type="number"
  173 + value="${page_data.ALL_SCORE == 0 ? 0: (page_data.GET_MAX_SCORE*100 / page_data.ALL_SCORE )}"
  174 + maxFractionDigits="2" />%</td>
171 <td>最低得分率:10%</td> 175 <td>最低得分率:10%</td>
172 <td>平均得分率:${page_data.GET_SCORE_PERSENT}</td> 176 <td>平均得分率:${page_data.GET_SCORE_PERSENT}</td>
173 </tr> 177 </tr>
@@ -442,7 +446,40 @@ @@ -442,7 +446,40 @@
442 446
443 447
444 $(document).on("click",".list",function(){ 448 $(document).on("click",".list",function(){
445 - $('#myModal').modal('toggle') 449 + $.ajax({
  450 + url:"<%=basePath%>homework/homeworkindex",
  451 + type:"post",
  452 + data:{HOMEWORK_ID:'${page_data.HOMEWORK_ID}',INDEX:($(this).index()+1)},
  453 + success:function(res){
  454 + res = JSON.parse(res);
  455 + console.log(res);
  456 + var stundent_num=[];
  457 + var _html='';
  458 + for(i=0;i<res.length;i++){
  459 + if(typeof(res[i].STUDENTS) =="undefined"){
  460 + stundent_num[i]=0;
  461 + }else{
  462 + stundent_num[i]=res[i].STUDENTS.length;
  463 + }
  464 + }
  465 + max_num=Math.max.apply(null,stundent_num);
  466 + for(i=0;i<res.length;i++){
  467 + if(typeof(res[i].RIGHT) =="undefined"){
  468 + _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">'+stundent_num[i]+'人</p></div><p class="ans_option">'+res[i].ANSWER+'</p></div>';
  469 +
  470 + }else{
  471 + if(res[i].RIGHT == true)
  472 + _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">'+stundent_num[i]+'人</p></div><p class="ans_option">'+res[i].ANSWER+'</p></div>'
  473 + else
  474 + _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">'+stundent_num[i]+'人</p></div><p class="ans_option">'+res[i].ANSWER+'</p></div>';
  475 + }
  476 + }
  477 + $(".q_charts").html(_html);
  478 + //console.log(max_num);
  479 + $('#myModal').modal('toggle')
  480 + }
  481 + })
  482 +
446 }); 483 });
447 484
448 $(document).on("click",".ans_option",function(){ 485 $(document).on("click",".ans_option",function(){