hashbrown

Question

A question put to a decision model.

  • choice: pick one option; options maps option ids to optional descriptions.
  • score: rate on an ordered scale; levels maps level ids (numeric strings) to descriptions. The scale order is the numeric order of the ids, not the record's key order.
  • yesNo: a boolean question.

API

export type Question =
  | {
      type: "choice";
      instructions: string;
      options:  Record <string, string | null>;
    }
  | {
      type: "score";
      instructions: string;
      levels:  Record <string, string>;
    }
  | {
      type: "yesNo";
      instructions: string;
    };