Merge pull request #531 from differentreality/questions_fixed_answers_for_yes_no

Do not require answers if it is a yes or no question.
This commit is contained in:
Stella Rouzi 2014-11-12 13:43:02 +02:00
commit dfc7fccc07
2 changed files with 17 additions and 1 deletions

View file

@ -5,6 +5,18 @@
= f.input :question_type
= f.input :global, label: 'Make Global',
hint: '(Global questions are available for selection to all conferences)'
.col-md-6
.col-md-6.hidden{id: 'answers_col'}
= dynamic_association :answers, 'Answers', f,
hint: 'Insert your answers in the order you want them to appear'
:javascript
$("#question_question_type_id").change(function () {
var selected_type = $(this).find('option:selected').text();
if (selected_type == 'Yes/No')
$('#answers_col').addClass('hidden');
else
$('#answers_col').removeClass('hidden');
end
});