2015-11-27 11:55:47 +00:00
|
|
|
<% content_for :page_specific_css do %>
|
|
|
|
<style>
|
|
|
|
.answer-set .title{
|
|
|
|
margin-bottom: 15px;
|
|
|
|
}
|
|
|
|
.answer-set .title i{
|
|
|
|
margin-right: 10px;
|
|
|
|
}
|
|
|
|
.answer-set .set{
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
padding: 15px 0px;
|
|
|
|
}
|
|
|
|
.set {
|
|
|
|
color: #7E7D7D;
|
|
|
|
}
|
|
|
|
.set .qa{
|
|
|
|
padding: 15px 10px;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
|
|
|
.set .qa .init{
|
|
|
|
margin-right: 5px;
|
|
|
|
width: 30px;
|
|
|
|
border-right: 3px solid #7E7D7D;
|
|
|
|
display: inline-block;
|
|
|
|
font-weight: bold;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
|
|
|
.set .question{
|
|
|
|
font-size: 16px;
|
|
|
|
border-bottom: 1px solid #cecece;
|
|
|
|
padding-bottom: 5px;
|
|
|
|
}
|
|
|
|
.set .answer{
|
|
|
|
font-size: 16px;
|
|
|
|
padding-top: 5px;
|
|
|
|
word-break: break-all;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
.set .radiogroup{
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="answer-set">
|
|
|
|
<div class="title">
|
|
|
|
<h3><%= @survey.title %></h3>
|
|
|
|
<% if !@user.nil? %>
|
|
|
|
<h5><i class="icon icons-user"></i><%= @user.name %></h5>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="set">
|
|
|
|
<% @survey.survey_questions.each_with_index do |sq, index| %>
|
|
|
|
<div class="qa">
|
|
|
|
<div class="question">
|
|
|
|
<span class="init">Q<%= (index + 1).to_s %></span> <%= sq.title %>
|
|
|
|
</div>
|
|
|
|
<div class="answer">
|
|
|
|
<span class="init">A</span>
|
|
|
|
<% case sq.type %>
|
|
|
|
<% when SurveyQuestion::Radio, SurveyQuestion::Select %>
|
|
|
|
<%= @survey_answer[sq.id.to_s] rescue "" %>
|
|
|
|
<% when SurveyQuestion::Check %>
|
|
|
|
<%= @survey_answer[sq.id.to_s].join(", ") rescue "" %>
|
|
|
|
<% when SurveyQuestion::Radiogroup %>
|
|
|
|
<div class="radiogroup">
|
|
|
|
<% sq.survey_question_options.each do |sqo| %>
|
|
|
|
<% if !@survey_answer[sq.id.to_s].nil? %>
|
|
|
|
<%= sqo.name %> : <%= @survey_answer[sq.id.to_s][sqo.id.to_s] %> <br />
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% when SurveyQuestion::Oneline, SurveyQuestion::Multiline %>
|
|
|
|
<%= @survey_answer[sq.id.to_s] rescue "" %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2015-11-30 10:11:58 +00:00
|
|
|
<% if can_edit_or_delete?(@survey) %>
|
2015-11-27 11:55:47 +00:00
|
|
|
<div class="action">
|
|
|
|
<a href="/admin/surveys/<%= @survey.id.to_s %>/answer_sets" class="btn btn-primary">Back to answer sets</a>
|
|
|
|
</div>
|
2015-11-30 10:11:58 +00:00
|
|
|
<% end %>
|
2015-11-27 11:55:47 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|