Smart answers are a great tool for content designers to present complex information in a quick and simple way. Defining what they are – decision trees? calculators? tools? is immaterial – what they do is provide a reusable technical framework to build a quick and simple answer to a complex question.
Read more in Lisa Scott's GDS blog post.
- Look up Meursing code
- Maternity and paternity calculator for employers
- Towing: licence and age requirements
-
Smart Answer: The flow, questions and outcomes.
-
Flow: Defines the questions, outcomes and the rules for navigating between them.
-
Landing page: Contains a description of the Smart Answer and the "Start now" button that leads to the first question.
-
Question page: Contains an individual question that's asked in order to help arrive at at an outcome.
-
Outcome page: Contains the result of the Smart Answer based on responses to individual questions.
This is a Ruby on Rails application that contains:
- A Rails application to serve Smart Answers
- A DSL for creating Smart Answers
- The Smart Answers that appear on GOV.UK
NOTE. This application doesn't use a database and as such it does not include the ActiveRecord Railtie in application.rb.
- alphagov/static: provides static assets (JS/CSS) and the GOV.UK templates.
- nodejs/node: provides JS runtime for precompiling assets for deployment
See:
$ bundle exec rake
### Smart Answer flow development
- Development principles
- Deploying changes for Factcheck
- Merging pull requests from the content team
- Refactoring existing Smart Answers
- Adding content-ids to Smart Answers
- Creating a new Smart Answer
- Archiving a Smart Answer
- Updating worldwide fixture data
- Development workflow
- Common errors you might run into during development
- Environments
- Continuous integration
- Describing pull requests
- Deploying
- Handling exceptions with Errbit
- Rubocop
- Testing
- New-style Testing
- Issues and Todo
- Custom Google Analytics accounts and Tracking IDs
- Viewing landing pages and outcomes as Govspeak
- Viewing state of a Smart Answer
- Visualising flows
bundle exec rake publishing_api:publish
will send smart answers to the publishing-api.
bundle exec rake rummager:index
will send the data to Rummager for indexing in search.