from otreeutils.surveys import generate_likert_field, generate_likert_table
# define a Likert 5-point scale with its labels
likert_5_labels = (
'Strongly disagree', # value: 1
'Disagree', # value: 2
'Neutral', # value: 3
'Agree', # value: 4
'Strongly agree' # value: 5
)
ibt = {
'page_title': 'Survey Questions',
'survey_fields': [
# create a table of Likert scale choices
# we use the same 5-point scale a before and specify four rows for the table,
# each with a tuple (field name, label)
generate_likert_table(likert_5_labels,
[
('ibt_01', '
I often buy things spontaneously.
'),
('ibt_02', '"Just do it" describes the way I buy things.'),
('ibt_03', 'I often buy things without thinking.'),
('ibt_04', '"I see it, I buy it" describes me.'),
('ibt_05', '"Buy now, think about it later" describes me.'),
('ibt_06', 'Sometimes I feel like buying things on the spur-of-the-moment.'),
('ibt_07', 'I buy things according to how I feel at the moment.'),
('ibt_08', 'I carefully plan most of my purchases.'),
('ibt_09', 'Sometimes I am a bit reckless about what I buy.'),
],
form_help_initial='
Please rate the following statements.
', # HTML to be placed on top of form form_help_final='', # HTML to be placed below form table_row_header_width_pct=15, # width of row header (first column) in percent. default: 25 table_rows_randomize=True, # randomize order of displayed rows table_cols_equal_width=False, # adjust form columns so that they have equal width table_cells_highlight= True, # highlight form cells on mouse-over table_rows_highlight= False, # highlight form rows on mouse-over ) ] }