survey/app/views/surveys/answer_success.html.erb

18 lines
494 B
Plaintext

<%
data = action_data
@survey = data['survey']
@answer_model = data['answer']
%>
<% if @survey.result_type == 3 %>
<h3>Your total score is <%= @answer_model.scored_points %> </h3>
<% @survey.result_criteria.each do |criteria| %>
<% if (criteria[0].to_i..criteria[1].to_i).cover?(@answer_model.scored_points) %>
<div> <%= criteria[2].html_safe %> </div>
<% end %>
<% end %>
<% else %>
<h3><%= t('survey.answer_success')%></h3>
<% end %>
<a href="<%= data['url'] %>">Go Back</a>