2016-08-18 13:18:02 +00:00
|
|
|
<% @survey.result_type.inspect %>
|
|
|
|
|
2021-10-13 09:15:47 +00:00
|
|
|
<% if @survey.result_type == QuestionnaireSurvey::ResultCriteria %>
|
2016-08-18 13:18:02 +00:00
|
|
|
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 %>";
|