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

ModuleNotFoundError: No module named 'otree.db'

When I try to run oTree with `otree devserver' command in my project folder's shell, I get the following error: Traceback (most recent call last): File…
john
  • 11
  • 2
0
votes
0 answers

Attaching oTree(Django) to IIS with Windows VM using Hypercorn or equivalent?

I have been looking into adding oTree to a website hosted in Windows 2012 IIS on a Windows 10 VM. To run locally I just run otree prodserver inside the directory of the apps folder. The app runs on localhost:8000 unless specified otherwise, which…
0
votes
1 answer

if condition doesn't work but else condition works

When I run the following code in a python console, it works as expected. However, when I run it in oree, only the else condition is taken into consideration. So even if the conditions are fulfilled, I only get results with the values 3.85 and 0.1…
0
votes
3 answers

I have an if-else statement with over 100 "elses". Any ideas on how to condense this?

I've coded a game in oTree for research purposes and the code below does exactly what I intend. The problem is that some games have over 100 rounds so you can see how the code could get ridiculously long. For people who are going to use this code in…
0
votes
1 answer

Distribution of users onto sessions according to specific rule

for a simple app I try to develop a function that distributes player to different sessions (or treatments). For that purpose, I use a in built "creating_session" function. At first, every session 1 to 3 should contain in this example 4 participants.…
0
votes
1 answer

OTree / Django send player to results/ exit page if StringField input not in my dict

I’m working with OTree with self: https://otree.readthedocs.io/en/self/ On the first page of my experiment, I ask the players to provide an access code / their matriculation number via StringField. If their input is not in my dict in Constants, I…
Julian
  • 9
  • 3
0
votes
1 answer

customized tooltip and linking values to formfields -- highcharts / columnrange

High everyone, I am trying to get two things to happen. First, I want to create a custom tooltip for a columnrange-type series where the tooltip shows something like HIGH: 'this.point.high' and on a new line "LOW:" 'this.point.low'. Second, I would…
0
votes
0 answers

jQuery Selector and JS works on local server but not on web server

I have developed an online experiment with oTree which is a framework for developing experiments. I have implemented the following codes for the measurement of the input values in a form field: $('document').ready(function () { …
0
votes
1 answer

How to fix the correct value of span form?

I have the following script calculating a simple sum. If sum exceed or is below 100 a display error is shown. Despite the error message the user is still allow to proceed to the following page. I would like that until the value is == 100 he can't…
0
votes
1 answer

Python: Construct class (and variable names) through a function?

I recently started to work with Python's classes, since I need to work with it through the use of OTree, a Python framework used for online experiment. In one file, I define the pages that I want to be created, using classes. So essentially, in the…
0
votes
0 answers

Create external link containing Mturk "workerId" but called "participant_label" in Turkprime(Cloudresearch)

I am using oTree and want to publish my MTurk experiment with Turkprime (Cloudresearch). I want the external link to contain the Mturk workerId . However, I want the workerId be called participant_label. How is that possible? I already…
Poza
  • 336
  • 1
  • 16
0
votes
1 answer

Apache reverse proxy issue with otree/django

I am trying to set up apache with SSL as a reverse proxy for an oTree application. oTree is a framework for social science experiment that is build on django and also uses django channels. The reverse proxy generally works but I am having issues…
umbal
  • 25
  • 4
0
votes
1 answer

Progressbar with vertical line

I am implementing a simulation of a Dutch- and an English-auction in otree. For the interface, I am using a progress bar for the price that the supplier gets. In the English-auction the price increases every half second and in the Dutch-auction the…
Mo_Sunshine
  • 15
  • 1
  • 4
0
votes
1 answer

Index error in code to show image random without repetion

I am trying to display a series of images randomly but I want to avoid repeating the images. The code below works on startup but there comes a time when the following error simply appears: pop index out of range sufijos_png = list(range(1,…
0
votes
1 answer

Conda can't find environment

I cloned an Otree project from a colleague via GitHub and want to set up the survey. When i follow her instructions by typing conda activate otree_env i get the error: Could not find conda environment: otree_env. When i type the complete path, like…
Soaring
  • 13
  • 1
  • 4