Question
backend.question.models:#
Choice
#
Bases: Model
Choice objects are tied to Questions via ChoiceLists.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
slug
|
Unique identifier |
text |
str
|
Choice text |
index |
int
|
Index of choice within Question |
choicelist |
ChoiceList
|
ChoiceList that the Choice is associated with |
Source code in backend/question/models.py
ChoiceList
#
Bases: Model
A resusable list of choices for a question
Attributes:
| Name | Type | Description |
|---|---|---|
key |
str
|
the key by which this choice list can be identified |
from_python |
bool
|
whether this ChoiceList was added through a Python fixture (not editable) |
Source code in backend/question/models.py
Question
#
Bases: Model
Model for question asked during experiment
Attributes:
| Name | Type | Description |
|---|---|---|
key |
slug
|
Unique identifier |
text |
str
|
Question text |
from_python |
bool
|
whether this Question was added through a Python fixture (not editable) |
explainer |
str
|
Question explainer text |
is_skippable |
bool
|
If question can be skipped during experiment |
type |
str
|
Question type {“AutoCompleteQuestion”, “ButtonArrayQuestion”, “CheckboxQuestion”, “DropdownQuestion”, “IconRangeQuestion”, “NumberQuestion”, “RadiosQuestion”, “RangeQuestion”, “TextQuestion”, “TextRangeQuestion”} |
profile_scoring_rule |
str
|
Profile scoring rule {“”, “LIKERT”, “REVERSE_LIKERT”, “CATEGORIES_TO_LIKERT”} (ChoiceQuestion, LikertQuestion) |
min_value |
float
|
Minimal value (NumberQuestion) |
max_value |
float
|
Maximal value (NumberQuestion) |
max_length |
int
|
Maximal length (TextQuestion) |
min_values |
int
|
Minimum number of values to choose (CheckboxQuestion) |
Source code in backend/question/models.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
convert_to_action()
#
convert this Question instance to a serializable experiment.question.action
Source code in backend/question/models.py
set_optional_field(field, question_action)
#
set optional field of the QuestionAction
Attributes:
| Name | Type | Description |
|---|---|---|
field(str) |
field to set |
|
question_action(QuestionAction) |
the experiment.question.action object to modify |
Source code in backend/question/models.py
QuestionInList
#
Bases: Model
Question with its index in QuestionList
Attributes:
| Name | Type | Description |
|---|---|---|
questionlist |
QuestionList
|
QuestionList that contains the Question |
question |
Question
|
Question linked to QuestionList |
index |
int
|
Index of Question within QuestionList |
Source code in backend/question/models.py
QuestionList
#
Bases: Model
List of Questions asked in a Block
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the QuestionList |
block |
Block
|
Block that contains QuestionList |
index |
int
|
Index of QuestionList within Block |
questions |
Queryset[Question]
|
ManyToManyField to Questions that the QuestionList contains |
randomize |
bool
|
Randomize questions within QuestionList |