A question rating the state on an ordered scale of levels.
Answered by Omni.Answer.Score, whose score is the probability-weighted
average of the level indices (the first level is 0). Build one with
new/2, or Omni.score/2.
Struct fields
:instructions- the question, as parts (seeOmni.Question):levels- the levels from lowest to highest, as{key, description}pairs. Keys are atoms or strings and come back as given in the answer; anildescription means the key itself describes the level
Summary
Functions
Creates a score question from a keyword list or map of fields.
Creates a question rating the state on an ordered scale.
Types
@type t() :: %Omni.Question.Score{ instructions: Omni.Question.instructions(), levels: [Omni.Question.option()] }
A question rating the state on an ordered scale.
Functions
@spec new(Enumerable.t()) :: t()
Creates a score question from a keyword list or map of fields.
Instructions are built into parts (see Omni.Question) and levels into
{key, description} pairs, as in new/2.
Omni.Question.Score.new(instructions: "...", levels: [:a, :b])
@spec new(Omni.Question.instructions_input(), [ Omni.Question.key() | Omni.Question.option() ]) :: t()
Creates a question rating the state on an ordered scale.
Levels run from lowest to highest. Each is a key, or a {key, description}
pair; the answer's score is the probability-weighted average of the level
indices, starting at 0.
Omni.Question.Score.new("How angry is the customer?", ["Calm", "Frustrated", "Very angry"])
Omni.Question.Score.new("How urgent is this?",
low: "Can wait",
medium: "Needs attention this week",
high: "Needs attention today"
)