增加poll统计结果的显示

sw_new_course
sw 11 years ago
parent 1bba235ca0
commit 25b3772520

@ -7,21 +7,21 @@
<td class="td287"><%= l(:label_poll_proportion) %> </td> <td class="td287"><%= l(:label_poll_proportion) %> </td>
</tr> </tr>
<% poll_question.poll_answers.each do |poll_answer| %> <% poll_question.poll_answers.each do |poll_answer| %>
<tr> <tr>
<td class="td327"><%= poll_answer.answer_text %> </td> <td class="td327"><%= poll_answer.answer_text %> </td>
<td class="td42"><%= poll_answer.poll_votes.count %> </td> <td class="td42"><%= poll_answer.poll_votes.count %> </td>
<td class="td287"> <td class="td287">
<div class="Bar"> <div class="Bar">
<span style="width:<%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>%;" id="choice_percentage_<%= poll_answer.id %>"></span> <span style="width:<%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>%;" id="choice_percentage_<%= poll_answer.id %>"></span>
</div> </div>
<%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>%</td> <%= statistics_result_percentage(poll_answer.poll_votes.count, total_answer(poll_question.id)) %>%</td>
</tr> </tr>
<% end %> <% end %>
<tr class="table_bluebg"> <tr class="table_bluebg">
<td class="td327"><%= l(:label_poll_valid_commit) %> </td> <td class="td327"><%= l(:label_poll_valid_commit) %> </td>
<td class="td42"><%= total_answer(poll_question.id) %></td> <td class="td42"><%= total_answer(poll_question.id) %></td>
<td class="td287">&nbsp; </td> <td class="td287">&nbsp; </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>

@ -1,16 +1,20 @@
<div class="ur_table_result"> <div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" > <table border="0" cellspacing="0" cellpadding="0" class="full_width">
<tbody> <tbody>
<tr class="table_bluebg"> <tr class="table_bluebg">
<td class="td327" ><%= l(:label_answer) %> </td> <td class="td_full"><%= l(:label_answer) %> </td>
</tr> </tr>
<% poll_question.poll_votes.each do |poll_vote| %> <% poll_question.poll_votes.each do |poll_vote| %>
<tr> <tr>
<td class="td111"><%= poll_vote.vote_text.html_safe %> </td> <td class="td_full"><%= poll_vote.vote_text.html_safe %> </td>
</tr> </tr>
<% end %> <% end %>
<tr class="table_bluebg"> <tr class="table_bluebg">
<td class="td327"><%= l(:label_poll_answer_valid_result) %> <%= l(:label_answer_total) %><%= poll_question.poll_votes.count %></td> <td class="td_full">
<%= l(:label_poll_answer_valid_result) %>
<%= l(:label_answer_total) %>
<%= poll_question.poll_votes.count %>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

@ -1,46 +1,35 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%= stylesheet_link_tag 'polls', :media => 'all' %>
<html xmlns="http://www.w3.org/1999/xhtml"> <div class="polls_content polls_box" id="polls">
<head> <div class="ur_page_head" >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <h1 class="ur_page_title">
<title> <%= @poll.polls_name %>
<%= l(:label_poll_result) %> <%= l(:label_poll) %>
</title> </h1>
<%= stylesheet_link_tag 'polls', :media => 'all' %> </div>
</head> <div>
<body> <% @poll_questions.each do |poll_question| %>
<div class="polls_content polls_box" id="polls"> <ol>
<div class="ur_page_head" > <li class="ur_question_item">
<h1 class="ur_page_title"> <div class="ur_title_result">
<%= @poll.polls_name %>
<%= l(:label_poll) %>
</h1>
</div>
<div>
<% @poll_questions.each do |poll_question| %>
<ol style="margin-left: -40px;">
<li class="ur_question_item">
<div class="ur_title_result">
<span class="title_index"> <span class="title_index">
第<%= poll_question.question_number %>题: 第<%= poll_question.question_number %>题:
</span> </span>
<%= poll_question.question_title %> <%= poll_question.question_title %>
<span class="title_index"> <span class="title_index">
[<%= options_show(poll_question.question_type) %>] [<%= options_show(poll_question.question_type) %>]
</span> </span>
</div> </div>
<% if poll_question.question_type == 1 || poll_question.question_type == 2 %> <% if poll_question.question_type == 1 || poll_question.question_type == 2 %>
<%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %> <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
<% else %> <% else %>
<%= render :partial =>'quiz_answers', :locals =>{ :poll_question => poll_question } %> <%= render :partial =>'quiz_answers', :locals =>{ :poll_question => poll_question } %>
<% end %> <% end %>
</li> </li>
</ol> </ol>
<% end %> <% end %>
<ul class="wlist"> <ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul> </ul>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</body>
</html>

@ -52,6 +52,8 @@ a:hover.ur_button{ background:#0fa9bb; text-decoration:none;}
.ur_table_result tr td{ border-left:1px solid #cbcbcb;border-top:1px solid #cbcbcb; height:20px;} .ur_table_result tr td{ border-left:1px solid #cbcbcb;border-top:1px solid #cbcbcb; height:20px;}
.table_bluebg{ background:#e9f1f6; color:#2f3a40; height:24px;} .table_bluebg{ background:#e9f1f6; color:#2f3a40; height:24px;}
.td327{ width:300px; padding-left:5px;} .td327{ width:300px; padding-left:5px;}
.full_width{width:100%;}
.td_full{ width:100%; padding-left:5px;}
.td42{ width:42px; text-align:center;} .td42{ width:42px; text-align:center;}
.td287{ width:259px;padding-left:5px; } .td287{ width:259px;padding-left:5px; }
.Bar{ position: relative; width: 120px; border: 1px solid #cbcbcb; float:left; height:10px; margin-top:5px; margin-right:3px; } .Bar{ position: relative; width: 120px; border: 1px solid #cbcbcb; float:left; height:10px; margin-top:5px; margin-right:3px; }

Loading…
Cancel
Save