import random from django.utils.safestring import mark_safe from otree.api import ( models, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range, widgets, ) from pprint import pprint from random import randint import os author = 'Ankit Shanker' doc = """ Exposure to the fake news """ class Constants(BaseConstants): name_in_url = 'NormElicitation' players_per_group = None num_rounds = 6 Plausibility_choices = { - 2: "Extremely Unlikely", -1: "Unlikely", 0: "Neutral", 1: "Likely", 2: "extremely likely" } Familiarity_choices = { -2: " Completely Unfamiliar", -1: "Unfamiliar", 0: "Unsure", 1: "Somewhat familiar", 2: "very familiar" } class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): Plausibility = models.IntegerField( label="What is the likelihood that the above headline is true?", choices=[[k, v] for k, v in Constants.Plausibility_choices.items()], widget=widgets.RadioSelectHorizontal, blank=False, ) Familiarity = models.IntegerField( label="Are you familiar with the above headline (have you seen or heard about it before)?", choices=[[k, v] for k, v in Constants.Familiarity_choices.items()], widget=widgets.RadioSelectHorizontal, blank=False, )