Created
August 6, 2013 10:18
-
-
Save imsickofmaps/6163368 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.add_state(new FreeText( | |
| "reg_school_classrooms", | |
| "reg_school_teachers", | |
| "How many classrooms do you have in your school?" | |
| )); | |
| self.add_creator('reg_school_teachers', function(state_name, im) { | |
| var input = parseInt(im.get_user_answer('reg_school_classrooms')); | |
| if (!isNaN(input)) { | |
| return new FreeText( | |
| "reg_school_teachers", | |
| "reg_school_teachers_g1", | |
| "How many teachers in total do you have in your school?" | |
| ); | |
| } else { | |
| return self.make_bad_data_state( | |
| 'reg_school_classrooms_error', | |
| 'reg_school_classrooms', | |
| 'a number'); | |
| } | |
| }); | |
| self.add_creator('reg_school_classrooms_error', function(state_name, im) { | |
| return self.make_bad_data_state( | |
| 'reg_school_classrooms_error', | |
| 'reg_school_classrooms', | |
| 'a number'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment