MDL-52651 htmlpurifier: Append rel=noreferrer to links.
[moodle.git] / mod / survey / survey.js
blob9f28c741db93e58dc2e4a9bd79bee93839f8110f
2 M.mod_survey = {};
4 M.mod_survey.init = function(Y) {
5     if (document.getElementById('surveyform')) {
6         var surveyform = document.getElementById('surveyform');
7         Y.YUI2.util.Event.addListener('surveyform', "submit", function(e) {
8             var error = false;
9             if (document.getElementById('surveyform')) {
10                 var surveyform = document.getElementById('surveyform');
11                 for (var i=0; i < surveycheck.questions.length; i++) {
12                     var tempquestion = surveycheck.questions[i];
13                     if (surveyform[tempquestion['question']][tempquestion['default']].checked) {
14                         error = true;
15                     }
16                 }
17             }
18             if (error) {
19                 alert(M.str.survey.questionsnotanswered);
20                 Y.YUI2.util.Event.preventDefault(e);
21                 return false;
22             } else {
23                 return true;
24             }
25         });
26     }