This commit is contained in:
huang 2015-01-14 16:36:30 +08:00
parent feb6dc139d
commit b63b4974eb
4 changed files with 83 additions and 182 deletions

View File

@ -76,6 +76,7 @@ class PollController < ApplicationController
end
def statistics_result
@poll_questions = PollQuestion.all
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@ -114,4 +115,5 @@ class PollController < ApplicationController
def is_course_teacher
render_403 unless(@course && User.current.allowed_to?(:as_teacher,@course))
end
end

View File

@ -0,0 +1,24 @@
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327">选项 </td>
<td class="td42">小计 </td>
<td class="td287">比例 </td>
</tr>
<% poll_question.poll_answers.each do |poll_answer| %>
<tr>
<td class="td327"><%= poll_answer.answer_text %> </td>
<td class="td42">24 </td>
<td class="td287"><div class="Bar"><span style="width:75%;"></span></div> 75% </td>
</tr>
<% end %>
<tr class="table_bluebg">
<td class="td327">本题有效填写人次 </td>
<td class="td42">26</td>
<td class="td287">&nbsp; </td>
</tr>
</tbody>
</table>
</div>

View File

@ -12,190 +12,17 @@
<h1 class="ur_page_title">某问卷统计</h1>
</div>
<% @poll_questions.each do |poll_question| %>
<div class="">
<ol>
<li class="ur_question_item">
<div class="ur_title_result">
<span class="title_index">第1题</span>问题描述问题描述 <span class="title_index">[单选题]</span>
</div>
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327">选项 </td>
<td class="td42">小计 </td>
<td class="td287">比例 </td>
</tr>
<tr>
<td class="td327">第一选项 </td>
<td class="td42">24 </td>
<td class="td287"><div class="Bar"><span style="width:75%;"></span></div> 75% </td>
</tr>
<tr>
<td class="td327">第二选项 </td>
<td class="td42">1 </td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr>
<td class="td327">第三选项 </td>
<td class="td42">1</td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr class="table_bluebg">
<td class="td327">本题有效填写人次 </td>
<td class="td42">26</td>
<td class="td287">&nbsp; </td>
</tr>
</tbody>
</table>
</div>
</li>
<li class="ur_question_item">
<div class="ur_title_result">
<span class="title_index">第1题</span>问题描述问题描述 <span class="title_index">[单选题]</span>
</div>
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327">选项 </td>
<td class="td42">小计 </td>
<td class="td287">比例 </td>
</tr>
<tr>
<td class="td327">第一选项 </td>
<td class="td42">24 </td>
<td class="td287"><div class="Bar"><span style="width:75%;"></span></div> 75% </td>
</tr>
<tr>
<td class="td327">第二选项 </td>
<td class="td42">1 </td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr>
<td class="td327">第三选项 </td>
<td class="td42">1</td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr class="table_bluebg">
<td class="td327">本题有效填写人次 </td>
<td class="td42">26</td>
<td class="td287">&nbsp; </td>
</tr>
</tbody>
</table>
</div>
</li>
<li class="ur_question_item">
<div class="ur_title_result">
<span class="title_index">第1题</span>问题描述问题描述 <span class="title_index">[单选题]</span>
</div>
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327">选项 </td>
<td class="td42">小计 </td>
<td class="td287">比例 </td>
</tr>
<tr>
<td class="td327">第一选项 </td>
<td class="td42">24 </td>
<td class="td287"><div class="Bar"><span style="width:75%;"></span></div> 75% </td>
</tr>
<tr>
<td class="td327">第二选项 </td>
<td class="td42">1 </td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr>
<td class="td327">第三选项 </td>
<td class="td42">1</td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr class="table_bluebg">
<td class="td327">本题有效填写人次 </td>
<td class="td42">26</td>
<td class="td287">&nbsp; </td>
</tr>
</tbody>
</table>
</div>
</li>
<li class="ur_question_item">
<div class="ur_title_result">
<span class="title_index">第1题</span>问题描述问题描述 <span class="title_index">[单选题]</span>
</div>
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327">选项 </td>
<td class="td42">小计 </td>
<td class="td287">比例 </td>
</tr>
<tr>
<td class="td327">第一选项 </td>
<td class="td42">24 </td>
<td class="td287"><div class="Bar"><span style="width:75%;"></span></div> 75% </td>
</tr>
<tr>
<td class="td327">第二选项 </td>
<td class="td42">1 </td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr>
<td class="td327">第三选项 </td>
<td class="td42">1</td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr class="table_bluebg">
<td class="td327">本题有效填写人次 </td>
<td class="td42">26</td>
<td class="td287">&nbsp; </td>
</tr>
</tbody>
</table>
</div>
</li>
<li class="ur_question_item">
<div class="ur_title_result">
<span class="title_index">第1题</span>问题描述问题描述 <span class="title_index">[单选题]</span>
</div>
<div class="ur_table_result">
<table border="0" cellspacing="0" cellpadding="0" >
<tbody>
<tr class="table_bluebg">
<td class="td327">选项 </td>
<td class="td42">小计 </td>
<td class="td287">比例 </td>
</tr>
<tr>
<td class="td327">第一选项 </td>
<td class="td42">24 </td>
<td class="td287"><div class="Bar"><span style="width:75%;"></span></div> 75% </td>
</tr>
<tr>
<td class="td327">第二选项 </td>
<td class="td42">1 </td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr>
<td class="td327">第三选项 </td>
<td class="td42">1</td>
<td class="td287"><div class="Bar"><span style="width:3.13%;"></span></div>3.13% </td>
</tr>
<tr class="table_bluebg">
<td class="td327">本题有效填写人次 </td>
<td class="td42">26</td>
<td class="td287">&nbsp; </td>
</tr>
</tbody>
</table>
<span class="title_index">第1题</span>问题描述问题描述<%= poll_question.question_title %> <span class="title_index">[单选题]<% poll_question.poll_answers %></span>
</div>
<%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
</li>
</ol>
<% end %>
<div class="ur_buttons">
<!--<a href="#" class=" ur_button" >上一页</a>-->
<!--<a href="#" class="ur_button" >下一页</a>-->
@ -205,8 +32,6 @@
</div>
</div><!--问卷内容end-->
</body>
</html>

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150112024820) do
ActiveRecord::Schema.define(:version => 20150112090810) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -23,6 +23,18 @@ ActiveRecord::Schema.define(:version => 20150112024820) do
add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
create_table "api_keys", :force => true do |t|
t.string "access_token"
t.datetime "expires_at"
t.integer "user_id"
t.boolean "active", :default => true
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
create_table "applied_projects", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
@ -1055,6 +1067,14 @@ ActiveRecord::Schema.define(:version => 20150112024820) do
t.string "description"
end
create_table "social_groups", :force => true do |t|
t.string "name"
t.text "description"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "softapplications", :force => true do |t|
t.string "name"
t.text "description"
@ -1270,6 +1290,36 @@ ActiveRecord::Schema.define(:version => 20150112024820) do
add_index "versions", ["project_id"], :name => "versions_project_id"
add_index "versions", ["sharing"], :name => "index_versions_on_sharing"
create_table "voting_choices", :force => true do |t|
t.integer "poll_id", :null => false
t.string "text", :null => false
t.datetime "created_on", :null => false
t.integer "position", :default => 1
end
add_index "voting_choices", ["poll_id"], :name => "choices_poll_id"
create_table "voting_polls", :force => true do |t|
t.integer "project_id", :null => false
t.string "question", :null => false
t.datetime "created_on", :null => false
t.boolean "revote"
end
add_index "voting_polls", ["project_id"], :name => "polls_project_id"
create_table "voting_votes", :force => true do |t|
t.integer "user_id", :null => false
t.integer "poll_id", :null => false
t.integer "choice_id", :null => false
t.datetime "created_on", :null => false
end
add_index "voting_votes", ["choice_id"], :name => "votes_choice_id"
add_index "voting_votes", ["poll_id"], :name => "votes_poll_id"
add_index "voting_votes", ["user_id", "poll_id"], :name => "votes_user_poll_unique", :unique => true
add_index "voting_votes", ["user_id"], :name => "votes_user_id"
create_table "watchers", :force => true do |t|
t.string "watchable_type", :default => "", :null => false
t.integer "watchable_id", :default => 0, :null => false