Skip to main content

review.page.Question

review.page.Question(
    key,
    label,
    kind='radio',
    choices=(),
    required=True,
    differs=None,
    help='',
)

One field of a field set.

Attributes

Name Type Description
key str The state key; it is also the key of the export column that reads it.
label str The question as shown.
kind str radio (one of choices), line (one line of text) or text (several lines).
choices tuple[Term, …] The options of a radio; never pre-selected.
required bool Whether an answer is needed to save.
differs tuple[str, str] | None Two keys; the answer is also needed when the values of these two keys differ (a reason for a changed answer). A key is read from the answers of the item and, if it is not a question of the page, from Item.consts.
help str A small hint under the label.

Examples

from babregen.review.page import Question
from babregen.review.vocab import CONFIDENCE

print(Question("confidence", "Confidence", choices=CONFIDENCE).kind)
radio