survey/app/views/surveys/_answer_success.erb

15 lines
499 B
Plaintext
Raw Permalink Normal View History

<% @survey.result_type.inspect %>
<% if @survey.result_type == 3 %>
var scoredPoints = <%= @answer_model.scored_points %>,
msg = "";
<% @survey.result_criteria.each do |criteria| %>
<% if (criteria[0].to_i..criteria[1].to_i).cover?(@answer_model.scored_points) %>
msg = "<%= criteria[2] %>";
<% end %>
<% end %>
alert("Your total score is " + scoredPoints + "; " + msg);
<% else %>
alert("<%= t('survey.answer_success')%>");
<% end %>
2014-10-06 05:55:25 +00:00
window.location.href = "<%= page_for_survey %>";