%
data = action_data
@survey = data["survey"]
@chart_data = data["chart_data"]
@survey_questions = data["survey_questions"]
@survey_answers = data["survey_answers"]
%>
<% case @survey.result_type %>
<% when QuestionnaireSurvey::ResultChart %>
<%= @survey.title %> <%= t('survey.chart') %>
<%= t 'survey.results_count' %>: <%= @survey.survey_answers.count %>
<% index = 1 %>
<% @survey_questions.each do |question| %>
<% case question.type %>
<% when SurveyQuestion::Radio, SurveyQuestion::Check, ::SurveyQuestion::Select %>
-
- <%= "#{index}. #{question.title}" %>
-
<% index += 1%>
<% when SurveyQuestion::Radiogroup %>
<% question.survey_question_options.each_with_index do |option,i| %>
-
- <%= "#{index}. #{question.title} - #{option.name}" %>
-
<% index += 1%>
<% end %>
<% when SurveyQuestion::DoubleLevelOption %>
-
- <%= "#{index}. #{question.title}" %>
-
<% index += 1%>
<% end %>
<% end %>
<%= stylesheet_link_tag "survey-result-chart.css" %>
<% when QuestionnaireSurvey::ResultExtern %>
<% when QuestionnaireSurvey::ResultFile %>
<%= @survey.title %> <%= t('survey.upload_file') %>
<%= link_to t(:view), @survey.upload_file.url, {:class => 'for_preview btn', :target => '_blank', :title => t(:view), "data-trigger" => :hover} if !@survey.upload_file.blank? %>
<% end %>