Sha256: 7a5c7c3efba92fe51bab80e1919650a4bf3c39a8f77d011d9168001bc1e0c122
Contents?: true
Size: 1.43 KB
Versions: 84
Compression:
Stored size: 1.43 KB
Contents
$(document).ready(function() { function updateAssessmentFormState() { var numberOfQuestions = $('#assessment .legend').length; var numberOfCheckedAnswers = $('#assessment input:checked').length; var numberOfUnansweredQuestions = numberOfQuestions - numberOfCheckedAnswers; var unansweredQuestionsBadge = $('#assessment .badge'); if (numberOfUnansweredQuestions > 0) { if (numberOfUnansweredQuestions == 1) { unansweredQuestionsBadgeText = '<%= I18n.t 'woople_theme.assessment_form.unanswered_questions.one' %>'; } else { unansweredQuestionsBadgeText = '<%= I18n.t 'woople_theme.assessment_form.unanswered_questions.other' %>'.replace('%{count}', numberOfUnansweredQuestions); } unansweredQuestionsBadge.text(unansweredQuestionsBadgeText); } else { if (phone()) { unansweredQuestionsBadge.hide(); } unansweredQuestionsBadge.fadeOut(); $('#assessment input[type=submit]').removeAttr('disabled'); $('.touch #assessment .span4').addClass('collapse-height'); } } $('#assessment').on('click', 'input[type=radio]', updateAssessmentFormState); var cancelButton = $('#assessment input[type=button]'); cancelButton.click(function() { location.href = cancelButton.attr('data-course-path'); }); $('.touch #assessment label').click(function() { $(this).children('input').attr('checked', 'checked'); updateAssessmentFormState(); }); });
Version data entries
84 entries across 84 versions & 1 rubygems