Questions tagged [otree]

oTree is a Python framework for multiplayer decision games, behavioral experiments, and surveys

oTree is a Python framework for multiplayer decision games, behavioral experiments, and surveys.

104 questions
0
votes
1 answer

FileNotFoundError while calling heroku run "otree resetdb"

so I receive a FileNotFoundError: [Errno 2] No such file or directory error and I honestly don't know what to do since the file is certainly there. The error occurs when I try to deploy an oTree experiment with heroku and git after command heroku…
linap-al
  • 1
  • 1
0
votes
1 answer

I am having some difficulty using "git push heroku master" on a recently installed python+otree combination on a Windows 10 system

thanks for your help. It seems that when I attempt to git push heroku master, I get the following error: remote: -----> Installing python-3.6.12 remote: -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2 remote: -----> Installing…
0
votes
0 answers

Execute Django command within Django variable

I would like to read a string from an excel-file with both HTML- and Django-Tags (e.g. "Your current < b > account balance is: {{ current_balance }}"). I then pass the variable from the python-file to the Django-template (name e.g.…
Leo
  • 1
  • 1
0
votes
1 answer

django.core.exceptions.ImproperlyConfigured: ('Setting RECAPTCHA_PUBLIC_KEY is not of type', )

Good morning, I am trying to use a Google captcha in Otree, I installed recaptcha and create an account that gave me the keys, but when I run the powershell it shows me the following error: Traceback (most recent call last): File…
0
votes
1 answer

How to add participant.var to data set

New to oTree, so I apologize if this is a super trivial question. I was trying to figure out how to pass my participant.var variable into the admin and exported data fields. My model.py subsession class has the following: def…
user9026298
0
votes
1 answer

Count errors using Otree

I am trying to create a simple counter in Otree that give a message when I don't have the correct answer in an 0tree form and also count the total attempts that a subject did before he/she got the right answer (I am trying to count the mistakes for…
0
votes
0 answers

Count the number of responses for each option a likert scale on Otree

I have the next code. I want to count the number of responses for each option in the Likert scale. I have a general model form that only save the response for each participant, but don't count the total of responses of all the participants. I need…
0
votes
1 answer

Submit two button with different keycodes

I have the following code to save a person's timestamps when he clicks on one of two buttons. On the screen they must choose which button they prefer if A or B. function myFunction() { var n = Date.now(); document.getElementById("c1").value…
0
votes
1 answer

I am trying to add a value , when a person have the right answer

I am trying to make a code in Python for a Otree aplication. The main idea is to add $20 to a fixed payment when a person have the same answer that I put in my constants. For example in this code I have a value of 3 in Constants.retemv if a person…
0
votes
1 answer

How to access the human-readable name using get_FOO_display

Hello I have the next code to show to my participants the text of the response that the gave me in a anterior session. J11 = models.IntegerField( choices=[ [-2, 'Muy moralmente inapropiado'], [-1, 'Moralmente…
0
votes
0 answers

'int' object is not subscriptable in Otree

i am trying to compare the response that someone give me in a questionarie with a predetermined value, can someone give me a expleneation I have the next code. class CRT(Page): form_model = 'player' form_fields = ['CRT1','CRT2','CRT3','CRT4',] def…
0
votes
1 answer

No 'Access-Control-Allow-Origin' header on the requested resource in Django

I have read relevant question and understand what is cors. I followed each step. Install pip install django-cors-headers Add MIDDLEWARE =…
Pay C.
  • 1,048
  • 1
  • 13
  • 20
0
votes
1 answer

Can I pass data through two different django projects?

After an otree survey, I start with subprocess another django app, specially a django-oscar shop. It runs on another port. Now, I want to pass some data from the survey (first app, otree) to the shop (second app, django-oscar). I tried this in…
alexrogo
  • 522
  • 3
  • 17
0
votes
1 answer

How can i sum the values of an attribute only for the players of a role in Otree

I am programming a version of the public goods game but using roles. Because of that, i cant obtain the sum of the total contributions of the players who are from a determined role. I tried with the following code: self.total_contribution1 =…
0
votes
1 answer

ImportError: cannot import name 'Page'

I have written a game in an Otree Project, but every time i want to clean my database or start the server, this message appears. It only happens with my game, but not when an example game is using that command.