from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class TaskQvInstructions(Page): template_name = 'quadratic_voting/QVInstructions.html' def vars_for_template(self): return {'num_questions': len(self.participant.vars['qv_questions'])} class TaskQv(Page): template_name = 'quadratic_voting/QV.html' form_model = 'player' form_fields = ['quadratic_voting'] def vars_for_template(self): return { 'num_questions': len(self.participant.vars['qv_questions']), 'questions': self.participant.vars['qv_questions'], 'credits': Constants.vote_credits } page_sequence = [ TaskQvInstructions, TaskQv ]