-
Create a new project in toloka, copying content
toloka_inner/project_htmlinto html section, andtoloka_inner/project.jsto js section of a new project. -
Create two fields - one input field called
session_url, one output field calledotree_code: -
Add JQuery and bootstrap to your project dependencies:
NB: Adding JS is crucial, because it let otree know the assignment id, generated by Toloka and that is the way we later process the payments, accept/reject the assignments etc.
-
Set environmental variables listed in
env_examplefile, or put them into.envfile (remember, **do not share.envfile on github or anywhere else, because that would expose your api keys) -
add
requestsand optionally (if you use .env file)django-dotenvtorequirements_base.txt. -
Add two variables to your session config:
tolokaandtoloka_sandbox:dict( name='example', num_demo_participants=1, app_sequence=['example', 'last'], toloka=True, toloka_sandbox=True ),
-
Add following lines to
settings.py:INSTALLED_APPS = ['otree' ] EXTENSION_APPS = ['tolokaregister'] TOLOKA_API = environ.get('TOLOKA_API') SANDBOX_TOLOKA_API = environ.get('SANDBOX_TOLOKA_API')
-
You are good to go. As soon as you start your session with
toloka = True, it will be recognized bytolokaregisteras a potential toloka session, and it will list it in a data section. If you run session in Toloka sandbox, settoloka_sandboxtoTrue, otherwise set it toFalse.
You can check/update the status, check if the code they provided at the end of the study is correct, accept the assignment and pay the bonus
THE BONUS IS PAID IN USD. SO IF YOU USE ANOTHER CURRENCY THIS CODE WILL NOT DO ANY CURRENCY CONVERSION. THAT MEANS THAT IF THEIR PAYOFF IS 100 RUBLES, AND YOU PAY THEM IT VIA THIS INTERFACE, THEY WILL GET $100.




