from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants from utils import composer_fc #Throws error in IDE but works ;) class Questionnaire_Trust(Page): def vars_for_template(self): questions = self.participant.vars['questions_trust'] question_order = self.participant.vars['questions_trust_order'] (num_questions, questionnaire_table) = composer_fc.buildLikertScale(questions, question_order) self.player.questions_trust_order = str(question_order) return{ 'questionnaire_1' : questionnaire_table, 'num_questions' : num_questions } form_model = 'player' form_fields = ['questions_trust_answers', 'gender', 'age', 'education'] class Payoff(Page): def vars_for_template(self): payoff_table = composer_fc.getPayoffTable(self) questions = self.participant.vars['questions_hit'] question_order = self.participant.vars['questions_hit_order'] (num_questions, questionnaire_table) = composer_fc.buildLikertScale(questions, question_order) self.player.questions_hit_order = str(question_order) return{ 'payoff_table' : payoff_table, 'questionnaire_1' : questionnaire_table, 'num_questions' : num_questions } form_model = 'player' form_fields = ['questions_hit_answers', 'general_comments'] class Completion_Code(Page): pass page_sequence = [Questionnaire_Trust, Payoff, Completion_Code]