BETA This is a new service – your feedback will help us to improve it.

Before you begin

Doop technology demo

Doop is a rails ruby gem which provides a generator to get you quickly started converting govuk paper forms into online applications. This is a demo of how a Child Benefit paper application form could be realized as an online questionnaire, where questions are progresively asked and question flows altered based on responses.




The code

As you progress through the questionnaire, you can follow along in the code:

demo_controller.rb
_before_you_begin.html.erb
_preamble.html.erb
_about_you.html.erb
_children.html.erb
_declaration.html.erb
demo_spec.rb

The YAML

The question structure is described using YAML. As questions are answered, the YAML structure is updated to reflect the current state of the questionnaire. The YAML structure is then sent back to the browser and stored in a hidden field. When the next question is answered the submission include the hidden YAML, which is then updated to reflect the next answer... and so on. In production, the hidden field is encrypted and signed, to guarentee its authenticity. Since the data is stored in the users browser, the application can be considered stateless , which makes it very scalable.

View the saved YAML

For the demo, at any point you can view the current YAML by hitting Ctrl-Y

Testing with Rspec

Doop defines a set of Rspec extensions, to make acceptance testing more natural. See demo_spec.rb for the acceptance tests covering the demo.

Test Harness

The demo includes a test harness, which allows you to directly render a YAML config. The quickest way to try this put is to hit Ctrl-Y, copy the YAML, then paste it into the test harness.

Yaml

Res