A question with one answer from a fixed set of choices.
Answered by Omni.Answer.Choice. Build one with new/2, or Omni.choice/2.
Struct fields
:instructions- the question, as parts (seeOmni.Question):choices- the options in order, as{key, description}pairs. Keys are atoms or strings and come back as given in the answer; anildescription means the model judges the option by its key alone
Summary
Functions
Creates a choice question from a keyword list or map of fields.
Creates a question with one answer from a set of choices.
Types
@type t() :: %Omni.Question.Choice{ choices: [Omni.Question.option()], instructions: Omni.Question.instructions() }
A question with one answer from a set of choices.
Functions
@spec new(Enumerable.t()) :: t()
Creates a choice question from a keyword list or map of fields.
Instructions are built into parts (see Omni.Question) and choices into
{key, description} pairs, as in new/2.
Omni.Question.Choice.new(instructions: "...", choices: [:a, :b])
@spec new(Omni.Question.instructions_input(), [ Omni.Question.key() | Omni.Question.option() ]) :: t()
Creates a question with one answer from a set of choices.
Each choice is a key, or a {key, description} pair; a choice without a
description is judged by its key alone.
Omni.Question.Choice.new("Which team owns this?", [:billing, :infra, :other])
Omni.Question.Choice.new("Which team owns this?",
billing: "Payments and refunds",
infra: "Outages",
other: nil
)