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 %>
|
2021-07-08 13:31:27 +00:00
|
|
|
<% SurveysHelper.set_locale(I18n.locale) %>
|
2015-11-27 11:55:47 +00:00
|
|
|
<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">
|
2021-11-04 09:52:57 +00:00
|
|
|
<% if @survey_answer.consent_used %>
|
|
|
|
<div class="qa" style="font-size: 1.5em;">
|
|
|
|
<%= t('survey.consent_to_be_used_for_research') %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2015-11-27 11:55:47 +00:00
|
|
|
<% @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>
|
2021-07-08 13:31:27 +00:00
|
|
|
<% case sq.type %>
|
2021-09-12 12:20:03 +00:00
|
|
|
<% when SurveyQuestion::Radio, SurveyQuestion::Select %>
|
2021-07-08 13:31:27 +00:00
|
|
|
<%= SurveysHelper.parse_value(@survey_answer[sq.id.to_s]) %>
|
|
|
|
<% when SurveyQuestion::Check %>
|
|
|
|
<%= SurveysHelper.parse_checkbox_value_html(@survey_answer[sq.id.to_s]) %>
|
|
|
|
<% when SurveyQuestion::Radiogroup %>
|
|
|
|
<div class="radiogroup">
|
|
|
|
<% sq.survey_question_options.each do |sqo| %>
|
|
|
|
<% if !@survey_answer[sq.id.to_s].nil? %>
|
|
|
|
<% if sq.custom_option_each_option %>
|
|
|
|
<%= @survey_answer[sq.id.to_s]["#{sqo.id}_custom_group_field"].blank? ? sqo.name : @survey_answer[sq.id.to_s]["#{sqo.id}_custom_group_field"] %> :
|
|
|
|
<% else %>
|
|
|
|
<%= sqo.name %> :
|
|
|
|
<% end %>
|
|
|
|
<%= SurveysHelper.parse_value(@survey_answer[sq.id.to_s][sqo.id.to_s]) %> <br />
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% if sq.custom_option_new_option %>
|
|
|
|
<%= sq.custom_option_title %> <%= @survey_answer[sq.id.to_s]['custom_option'] %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% when SurveyQuestion::Oneline, SurveyQuestion::Multiline %>
|
|
|
|
<%= @survey_answer[sq.id.to_s] rescue "" %>
|
|
|
|
<% when SurveyQuestion::DoubleLevelOption %>
|
|
|
|
<span style="display: inline-block;">
|
|
|
|
<%= @survey_answer[sq.id.to_s].collect{|v| SurveysHelper.parse_double_level_value(v,sq.custom_option_title.to_s)}.join('<br>').html_safe %>
|
|
|
|
</span>
|
2015-11-27 11:55:47 +00:00
|
|
|
<% 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|