smart-answers icon indicating copy to clipboard operation
smart-answers copied to clipboard

Serves smart answers on GOV.UK

Smart Answers

A tool for content designers to present complex information as a flow of questions, leading to an outcome. While the app is mostly self-contained, some Smart Answers use Imminence for Post Code lookup, and Whitehall to get data on countries and worldwide organisations.

Live examples

Nomenclature

  • 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.

Technical documentation

This is a Ruby on Rails app, and should follow our Rails app conventions.

You can use the GOV.UK Docker environment or the local startup.sh script to run the app. Read the guidance on local frontend development to find out more about each approach, before you get started.

If you are using GOV.UK Docker, remember to combine it with the commands that follow. See the GOV.UK Docker usage instructions for examples.

Smart Answer design

  • File structure
  • Flow definition
  • Question types
  • Next node rules
  • Storing data
  • ERB templates
    • Landing page template
    • Question templates
    • Outcome templates

Smart Answer tasks

  • Development principles
  • Deploying changes for fact-check
  • Creating a new Smart Answer
  • Publishing a Smart Answer

Further guidance is available in docs/tasks.

Further documentation

Licence

MIT License