Skip to content

Commit

Permalink
delete useless file and pass mypy testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lwaekfjlk committed Feb 29, 2024
1 parent ec3584e commit 34802ea
Show file tree
Hide file tree
Showing 20 changed files with 144 additions and 325 deletions.
File renamed without changes.
3 changes: 0 additions & 3 deletions human_eval/_rooms/econ101.txt

This file was deleted.

7 changes: 0 additions & 7 deletions human_eval/_templates/global/Page.html

This file was deleted.

5 changes: 3 additions & 2 deletions human_eval/official_study_payment_info/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from otree.api import *
from otree.api import BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Page
from typing import Dict



Expand Down Expand Up @@ -30,7 +31,7 @@ class Player(BasePlayer):
# PAGES
class PaymentInfo(Page):
@staticmethod
def vars_for_template(player: Player):
def vars_for_template(player: Player) -> Dict[str, str]:
participant = player.participant
return dict(redemption_code=participant.label or participant.code)

Expand Down
17 changes: 8 additions & 9 deletions human_eval/pilot_study_payment_info/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from otree.api import *


from otree.api import BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Page
from typing import Dict

doc = """
This application provides a webpage instructing participants how to get paid.
Expand All @@ -9,9 +8,9 @@


class C(BaseConstants):
NAME_IN_URL = 'pilot_study_payment_info'
PLAYERS_PER_GROUP = None
NUM_ROUNDS = 1
NAME_IN_URL: str = 'pilot_study_payment_info'
PLAYERS_PER_GROUP: None = None
NUM_ROUNDS: int = 1


class Subsession(BaseSubsession):
Expand All @@ -26,13 +25,13 @@ class Player(BasePlayer):
pass


# FUNCTIONS
# PAGES
class PaymentInfo(Page):
@staticmethod
def vars_for_template(player: Player):
def vars_for_template(player: Player) -> Dict[str, str]:
participant = player.participant
return dict(redemption_code=participant.label or participant.code)
redemption_code: str = participant.label or participant.code # Assuming both label and code are strings.
return dict(redemption_code=redemption_code)


page_sequence = [PaymentInfo]
99 changes: 46 additions & 53 deletions human_eval/settings.py
Original file line number Diff line number Diff line change
@@ -1,63 +1,56 @@
from os import environ


SESSION_CONFIGS = [
dict(
name='sotopia_pilot_study',
display_name='social interaction qualification test',
app_sequence=['sotopia_pilot_study', 'pilot_study_payment_info'],
num_demo_participants=1,
),
dict(
name='sotopia_official_study',
display_name='social interaction official test',
app_sequence=['sotopia_official_study', 'official_study_payment_info'],
num_demo_participants=1,
)
from typing import List, Dict, Any

DEBUG: bool = False # control user can see the debug info or not

SESSION_CONFIGS: List[Dict[str, Any]] = [
{
'name': 'sotopia_pilot_study',
'display_name': 'social interaction qualification test',
'app_sequence': ['sotopia_pilot_study', 'pilot_study_payment_info'],
'num_demo_participants': 1,
},
{
'name': 'sotopia_official_study',
'display_name': 'social interaction official test',
'app_sequence': ['sotopia_official_study', 'official_study_payment_info'],
'num_demo_participants': 1,
}
]



# if you set a property in SESSION_CONFIG_DEFAULTS, it will be inherited by all configs
# in SESSION_CONFIGS, except those that explicitly override it.
# the session config can be accessed from methods in your apps as self.session.config,
# e.g. self.session.config['participation_fee']

SESSION_CONFIG_DEFAULTS = dict(
real_world_currency_per_point=1.00, participation_fee=0.00, doc=""
)

PARTICIPANT_FIELDS = ['expiry'] # to use the timer (haofei)
SESSION_FIELDS = []

# ISO-639 code
# for example: de, fr, ja, ko, zh-hans
LANGUAGE_CODE = 'en'

DEBUG = False # TODO(haofeiyu): to control whether the annotators could see the debug_info or not

# e.g. EUR, GBP, CNY, JPY
REAL_WORLD_CURRENCY_CODE = 'USD'
USE_POINTS = True

ROOMS = [
dict(
name='econ101',
display_name='Econ 101 class',
participant_label_file='_rooms/econ101.txt',
),
dict(name='live_demo', display_name='Room for live demo (no participant labels)'),
SESSION_CONFIG_DEFAULTS: Dict[str, Any] = {
'real_world_currency_per_point': 1.00,
'participation_fee': 0.00,
'doc': ""
}

PARTICIPANT_FIELDS: List[str] = ['expiry']
SESSION_FIELDS: List[str] = []

LANGUAGE_CODE: str = 'en'

REAL_WORLD_CURRENCY_CODE: str = 'USD'
USE_POINTS: bool = True

ROOMS: List[Dict[str, Any]] = [
{
'name': 'econ101',
'display_name': 'Econ 101 class',
'participant_label_file': '_rooms/econ101.txt',
},
{
'name': 'live_demo',
'display_name': 'Room for live demo (no participant labels)',
},
]

ADMIN_USERNAME = 'admin'
# for security, best to set admin password in an environment variable
ADMIN_PASSWORD = environ.get('OTREE_ADMIN_PASSWORD')
ADMIN_USERNAME: str = 'admin'
ADMIN_PASSWORD: str = environ.get('OTREE_ADMIN_PASSWORD', '')

DEMO_PAGE_INTRO_HTML = """
DEMO_PAGE_INTRO_HTML: str = """
Here are some oTree games.
"""

SECRET_KEY: str = '4197606110806'

SECRET_KEY = '4197606110806'

INSTALLED_APPS = ['otree']
INSTALLED_APPS: List[str] = ['otree']

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 34802ea

Please sign in to comment.