Skip to content

Instantly share code, notes, and snippets.

@chrisroos
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisroos/1c28a23826004e942977 to your computer and use it in GitHub Desktop.
Save chrisroos/1c28a23826004e942977 to your computer and use it in GitHub Desktop.
Comparison of Smart Answer visualisation, using next_node_if and next_node with permitted_next_nodes

Comparison of the visualisation of two Smart Answers: one using next_node_if and one using a combination of next_node and permitted_next_nodes.

The Smart Answer using next_node_if can be visualised correctly while the one using next_node and permitted_next_nodes cannot. See the attached screenshots for both visualisations.

status :published
multiple_choice :question_1 do
option :A
option :B
next_node do |response|
response == :A ? :outcome_a : :outcome_b
end
permitted_next_nodes :outcome_a, :outcome_b
end
outcome :outcome_a
outcome :outcome_b
status :published
multiple_choice :question_1 do
option :A
option :B
next_node_if(:outcome_a, responded_with(:A))
next_node_if(:outcome_b, responded_with(:B))
end
outcome :outcome_a
outcome :outcome_b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment