MDL-57139 survey: fix promise return
authorDan Poltawski <dan@moodle.com>
Thu, 1 Jun 2017 13:22:35 +0000 (14:22 +0100)
committerDan Poltawski <dan@moodle.com>
Thu, 1 Jun 2017 13:54:39 +0000 (14:54 +0100)
mod/survey/amd/src/validation.js

index 75880c2..5439e68 100644 (file)
@@ -49,11 +49,10 @@ define(['jquery', 'core/str', 'core/modal_factory', 'core/notification'], functi
                 if (form.find('input:radio[data-survey-default="true"]:checked').length !== 0) {
                     e.preventDefault();
                     // Display the modal error.
-                    modalPromise.then(function(modal) {
+                    return modalPromise.then(function(modal) {
                         modal.show();
-                        return;
+                        return false;
                     });
-                    return false;
                 }
 
                 return true;