from otree.api import * # Abwandlung vom Aufbau von Survey von author = 'Lingguo Xu' in https://www.otreehub.com/projects/feedback-ekx/ doc = """ Your app description """ class C(BaseConstants): NAME_IN_URL = 'Fragebogen' PLAYERS_PER_GROUP = None NUM_ROUNDS = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): feedback = models.LongStringField( label="Haben Sie noch weitere Anmerkungen oder Feedback?", blank=True, ) geburtstag = models.IntegerField( label="In welchem Jahr wurden Sie geboren?", min=1900, max=2006, blank=True, ) gender = models.IntegerField( label="Geben Sie ihr Geschlecht an?", choices=[ [0, 'Mann'], [1, 'Frau'], [2, 'Divers'], [3, 'Möchte ich nicht angeben'], ] ) bildung = models.IntegerField( label="Was ist Ihr höchster Bildungsabschluss?", choices=[ [0, 'Kein Schulabschluss'], [1, 'Hauptschulabschluss'], [2, 'Mittlere Reife/Realschulabschluss'], [3, 'Fachhochschulreife'], [4, 'Allgemeine Hochschulreife (Abitur)'], [5, 'Bachelor'], [6, 'Master/Diplom'], [7, 'Promotion'], [8, 'Sonstige Bildungsabschlüsse'] ] ) nationalitaet = models.StringField( label="Welche Nationalität haben Sie?" ) def make_intfield(): return models.IntegerField( choices=[[1, 'Stimme überhaupt nicht zu'], [2, ''], [3, ''], [4, ''], [5, 'Stimme vollkommen zu']], label="", widget=widgets.RadioSelectHorizontal, ) anticipation_1 = make_intfield() anticipation_2 = make_intfield() anticipation_3 = make_intfield() anticipation_4 = make_intfield() anticipation_5 = make_intfield() anticipation_6 = make_intfield() anticipation_7 = make_intfield() anticipation_8 = make_intfield() anticipation_9 = make_intfield() anticipation_10 = make_intfield() anticipation_11 = make_intfield() anticipation_12 = make_intfield() anticipation_13 = make_intfield() anticipation_14 = make_intfield() # PAGES class Demografie(Page): form_model = 'player' form_fields = ['gender', 'geburtstag', 'bildung', 'nationalitaet'] class ResultsWaitPage(WaitPage): pass class Fragebogen(Page): form_model = 'player' form_fields = ['anticipation_1', 'anticipation_2', 'anticipation_3', 'anticipation_4', 'anticipation_5', 'anticipation_6', 'anticipation_7', 'anticipation_8', 'anticipation_9', 'anticipation_10', 'anticipation_11', 'anticipation_12','anticipation_13', 'anticipation_14', 'feedback'] class Ende(Page): pass page_sequence = [Demografie, Fragebogen, Ende]