otree

Disable all cookies in oTree

吃可爱长大的小学妹 提交于 2021-02-10 14:24:00
问题 In oTree, two cookies are created: sessionId and csrf_token . I want to disable both; however, I don't know how to do that. I know that when I use participant_label in the URL, I can avoid the sessionId -cookie. However, then I still have the csrf_token -cookie. Do you know how to unset it? I heard that django-cookieless should be a solution, but I don't know how to use that. 回答1: Ok, it's a bit untrivial. For injecting csrftoken in Django (which oTree is based on) they use CsrfViewMiddleware

Mandatory slider in oTree/django

China☆狼群 提交于 2019-12-19 10:49:06
问题 I want to use oTree as an alternative for conducting experiments. For this purpose I am looking for a possibility to include mandatory slider questions in forms, i. e. sliders you are required to move before you are able to proceed to the next question. As a start I tried to modify oTrees survey template to achieve a solution for future usage but wasn't able to integrate common approaches like a fieldtracker into the project. Here are two modified (yet currently after a number of unsuccessful

Mandatory slider in oTree/django

吃可爱长大的小学妹 提交于 2019-12-01 12:23:55
I want to use oTree as an alternative for conducting experiments. For this purpose I am looking for a possibility to include mandatory slider questions in forms, i. e. sliders you are required to move before you are able to proceed to the next question. As a start I tried to modify oTrees survey template to achieve a solution for future usage but wasn't able to integrate common approaches like a fieldtracker into the project. Here are two modified (yet currently after a number of unsuccessful try-outs not really functioning) versions of the models.py and views.py files which give a hint in

How to read Python list in Javascript [in a Django template]

我的未来我决定 提交于 2019-11-30 09:51:27
问题 I'm programming in oTree (which is a Django based environment for social experiments) and I have the following problem. I defined some lists in Python and I'd like to import them and use them in an HTML template. If I print them in HTML I manage to see them without any problem, however, once I need to use them in Javascript, the program fails to read them and the single quotes of the elements of the list are converted in ' . The list is imported like this var filtered_elements = {{ array }};