from otree.api import * from ._builtin import Page, WaitPage from .models import Constants, Player c = cu doc = '' def custom_export(players): yield ['participant_code', 'id_in_group'] for p in players: pp = p.participant yield [pp.code, p.id_in_group] class Past(Page): form_model = 'player' form_fields = ['influence_society', 'influence_like_you', 'open_ended_past'] def vars_for_template(self): player = self.player influence_society_label_dict = {"B":"benefits","H":"harms","I":"influences"} return dict( influence_society_label = f'In general, how do you think SOCIETY has been influenced by decisions of the Supreme Court in the past {player.time_frame_past} years? ', influence_like_you_label = f'In general, how do you think PEOPLE LIKE YOU have been influenced by decisions of the Supreme Court in the past {player.time_frame_past} years? ', open_ended_past_label= f'What do you see as three greatest {influence_society_label_dict[player.influence_type] } from court decisions over this period', player_time_frame_future=player.time_frame_future, player_influence_type=player.influence_type, options_influence=influence_society_label_dict, options_time_frame=str([15,75])) class Future(Page): form_model = 'player' form_fields = ['future_influence_society', 'future_like_you', 'open_ended_future'] def vars_for_template(self): player = self.player print(dir(player)) print(dir(player.values_dicts)) influence_society_label_dict={"B":"benefit from","H":"be hurt by","I":"be influenced by"} return dict( future_influence_society_label = f'How much do you think SOCIETY is likely to { influence_society_label_dict[player.influence_type] } from decisions of the Supreme Court in the NEXT {player.time_frame_future} years? Note: the order of responses was reversed for the “be hurt by” conditions.years? ', future_like_you_label = f'How much do you think PEOPLE LIKE YOU is likely to {influence_society_label_dict[player.influence_type] } from decisions of the Supreme Court in the NEXT {player.time_frame_future} years? Note: the order of responses was reversed for the “be hurt by” conditions.years? ', player_time_frame_future=player.time_frame_future, player_influence_type=player.influence_type, options_influence=str(influence_society_label_dict), options_future_time_frame=str([15,75])) class CourtDecision(Page): form_model = 'player' form_fields = ['court_decision'] class END(Page): form_model = 'player' class Intro(Page): form_model = 'player' form_fields = ['specific_decision_quality'] def get_form_fields(self): player = self.player if player.specific_decision=='CG': return [] else: return ['specific_decision_quality'] def vars_for_template(self): player = self.player decision_dict = { 'Speech': 'Not everyone always agrees with the Court, but some people argue that one of the most important things the court does is protect the rights of Israelis. ' + 'For instance, in a recent decision the court upheld the free speech rights of (religious jews / secular jews) protesting governmental enforcement of strict dietary restrictions ' + 'in public facilities, specifically of Kosher food in Pesach in public hospitals.', 'Movement': 'Not everyone always agrees with the Court, but some people think that one of the most important things the court does is protect the rights of individuals. For instance,' ' in a decision from 1998 the Court upheld the right of (Arab /Jewish) people to enter (settle freely in??) previously restricted areas.', 'Reasonableness': 'Not everyone always agrees with the Court, but some people think that one of the most important things the court does is constrain the action of government officials. ' 'For instance, in a recent decision the court struck down an action of the (Netanyahu / Lapid) government because' 'the government failed to meet the standard of reasonableness.', 'CG':'CG' } return dict( decision_text=decision_dict[player.specific_decision], control_decision = player.specific_decision=='CG' ).update(decision_dict) page_sequence = [Past, Future]