first commit
This commit is contained in:
commit
73fc2121bf
30 changed files with 13308 additions and 0 deletions
42
Finish/Comments.html
Normal file
42
Finish/Comments.html
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{{ extends "_static/global/Page.html" }}
|
||||
{{ block title }}
|
||||
Comments
|
||||
{{ endblock }}
|
||||
{{ block styles}}
|
||||
|
||||
|
||||
{{ endblock }}
|
||||
{{ block scripts}}
|
||||
|
||||
|
||||
|
||||
{{ endblock }}
|
||||
|
||||
{{ block content }}
|
||||
|
||||
<p>
|
||||
We would like to know more about your thought process when doing the task.
|
||||
Namely,
|
||||
<br>
|
||||
- How did you decide which option to choose?
|
||||
<br>
|
||||
- What was important in guessing how your opponent chose?
|
||||
<br>
|
||||
- How sure were you that you were choosing well?
|
||||
<br>
|
||||
<br>
|
||||
Any feedback you have will be useful for us.
|
||||
</p>
|
||||
|
||||
{{ formfields }}
|
||||
|
||||
<p>
|
||||
Click 'Next' to complete the task. You must do this to receive your payment.
|
||||
<br>
|
||||
<br>
|
||||
Thank you for participating.
|
||||
</p>
|
||||
|
||||
{{ next_button }}
|
||||
|
||||
{{ endblock }}
|
||||
31
Finish/Demographics.html
Normal file
31
Finish/Demographics.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{{ extends "_static/global/Page.html" }}
|
||||
{{ block title }}
|
||||
Questionnaire
|
||||
{{ endblock }}
|
||||
{{ block styles}}
|
||||
|
||||
|
||||
{{ endblock }}
|
||||
{{ block scripts}}
|
||||
|
||||
|
||||
|
||||
{{ endblock }}
|
||||
|
||||
{{ block content }}
|
||||
|
||||
<p>
|
||||
Before we conclude, we would like to ask you a few questions about yourself.
|
||||
</p>
|
||||
|
||||
{{ formfields }}
|
||||
|
||||
<p>
|
||||
You must answer each question before you can continue.
|
||||
</p>
|
||||
|
||||
{{ next_button }}
|
||||
|
||||
|
||||
|
||||
{{ endblock }}
|
||||
34
Finish/EndOfExperiment.html
Normal file
34
Finish/EndOfExperiment.html
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{{ extends "_static/global/Page.html" }}
|
||||
{{ load otree static }}
|
||||
|
||||
{{ block title }}
|
||||
End of experiment
|
||||
{{ endblock }}
|
||||
|
||||
|
||||
|
||||
{{ block styles }}
|
||||
{{ endblock }}
|
||||
|
||||
|
||||
|
||||
{{ block scripts }}
|
||||
{{ endblock }}
|
||||
|
||||
|
||||
|
||||
{{ block content }}
|
||||
|
||||
|
||||
<p>
|
||||
Thank you for participating.
|
||||
Click 'Next' to complete the experiment.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You need to complete the experiment to receive your payment.
|
||||
</p>
|
||||
|
||||
{{ next_button }}
|
||||
|
||||
{{ endblock }}
|
||||
22
Finish/RedirectProlific.html
Normal file
22
Finish/RedirectProlific.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{{ extends "_static/global/Page.html" }}
|
||||
{{ load otree static }}
|
||||
|
||||
{{ block title }}
|
||||
Results
|
||||
{{ endblock }}
|
||||
|
||||
{{block scripts}}
|
||||
<script>
|
||||
let completionlink = js_vars.completionlink;
|
||||
|
||||
window.onload = function(){
|
||||
window.location.href=completionlink;
|
||||
}
|
||||
</script>
|
||||
{{ endblock }}
|
||||
|
||||
{{ block content }}
|
||||
|
||||
{{ endblock }}
|
||||
|
||||
|
||||
21
Finish/RedirectQualtrics.html
Normal file
21
Finish/RedirectQualtrics.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{{ extends "_static/global/Page.html" }}
|
||||
{{ load otree static }}
|
||||
|
||||
{{ block title }}
|
||||
Results
|
||||
{{ endblock }}
|
||||
|
||||
{{block scripts}}
|
||||
<script>
|
||||
let elfecompletionlink = js_vars.elfecompletionlink;
|
||||
|
||||
window.onload = function(){
|
||||
window.location.href=elfecompletionlink;
|
||||
}
|
||||
</script>
|
||||
{{ endblock }}
|
||||
|
||||
{{ block content }}
|
||||
{{ endblock }}
|
||||
|
||||
|
||||
139
Finish/__init__.py
Normal file
139
Finish/__init__.py
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
from otree.api import *
|
||||
import numpy as np
|
||||
import random
|
||||
import operator
|
||||
|
||||
|
||||
doc = """
|
||||
App to characterise complexity of decision-making, with sums with varying numbers of elements in each sum.
|
||||
"""
|
||||
|
||||
|
||||
class C(BaseConstants):
|
||||
NAME_IN_URL = 'end'
|
||||
PLAYERS_PER_GROUP = None
|
||||
NUM_ROUNDS = 1
|
||||
|
||||
|
||||
|
||||
class Subsession(BaseSubsession):
|
||||
pass
|
||||
|
||||
|
||||
class Group(BaseGroup):
|
||||
pass
|
||||
|
||||
|
||||
class Player(BasePlayer):
|
||||
participation_fee= models.CurrencyField()
|
||||
|
||||
# Standard survey questions
|
||||
Age = models.IntegerField(min=18, label="Please enter your age:")
|
||||
EducationLevel = models.StringField(
|
||||
label="What is the highest level of education that you <span style='font-weight:bold'>completed</span>?",
|
||||
choices=[
|
||||
"Primary Education or Less",
|
||||
"Secondary Education/High School",
|
||||
"Business, technical, or vocational school after Secondary Education/High School",
|
||||
"Some college or university qualification, but not a Bachelor",
|
||||
"Bachelor or equivalent",
|
||||
"Master or Post-graduate training or professional schooling after college (e.g., law or medical school)",
|
||||
"Ph.D. or equivalent"
|
||||
],
|
||||
widget = widgets.RadioSelect
|
||||
)
|
||||
EducationField = models.StringField(
|
||||
label="Choose the field that best describes your <span style='font-weight:bold'>primary field of education</span>.",
|
||||
choices=[
|
||||
"Generic",
|
||||
"Arts and Humanities",
|
||||
"Social Sciences and Journalism",
|
||||
"Economics",
|
||||
"Education",
|
||||
"Business, Administration, and Law",
|
||||
"Computer Science, Information, and Communication Technologies",
|
||||
"Natural Sciences",
|
||||
"Mathematics and Statistics",
|
||||
"Engineering, Manufacturing, and Construction",
|
||||
"Agriculture, Forestry, Fisheries, and Veterinary",
|
||||
"Health and Welfare",
|
||||
"Services (Transport, Hygiene and Health, Security, and Other)"
|
||||
],
|
||||
widget = widgets.RadioSelect
|
||||
)
|
||||
Comments = models.LongStringField(
|
||||
label="If you have any comments, please leave them below.",
|
||||
blank=True
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# PAGES
|
||||
class Demographics(Page):
|
||||
"""Socio-demographic questions"""
|
||||
form_model = 'player'
|
||||
form_fields = ['Age', 'EducationLevel', 'EducationField']
|
||||
|
||||
@staticmethod
|
||||
def is_displayed(player):
|
||||
return player.round_number == C.NUM_ROUNDS
|
||||
|
||||
|
||||
class Comments(Page):
|
||||
"""Comments"""
|
||||
form_model = 'player'
|
||||
form_fields = ['Comments']
|
||||
|
||||
@staticmethod
|
||||
def is_displayed(player):
|
||||
return player.round_number == C.NUM_ROUNDS
|
||||
|
||||
|
||||
class EndOfExperiment(Page):
|
||||
@staticmethod
|
||||
def vars_for_template(player):
|
||||
return dict(
|
||||
context=player.session.config['context']
|
||||
)
|
||||
|
||||
class RedirectProlific(Page):
|
||||
@staticmethod
|
||||
def is_displayed(player):
|
||||
return (
|
||||
player.round_number == C.NUM_ROUNDS and
|
||||
player.session.config['context'] == "prolific" and
|
||||
not player.participant.vars.get('failed_captcha', False)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def js_vars(player):
|
||||
return dict(
|
||||
completionlink=
|
||||
player.subsession.session.config['completionlink']
|
||||
)
|
||||
|
||||
class RedirectQualtrics(Page):
|
||||
@staticmethod
|
||||
def is_displayed(player):
|
||||
return (
|
||||
player.round_number == C.NUM_ROUNDS and
|
||||
player.session.config['context'] == "lab" and
|
||||
not player.participant.vars.get('failed_captcha', False)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def js_vars(player):
|
||||
return dict(
|
||||
elfecompletionlink=
|
||||
player.session.config['elfecompletionlink']+"participantid="+player.participant.code+"&sessionid="+player.session.config['elfesessionid']
|
||||
)
|
||||
|
||||
page_sequence = [
|
||||
Demographics,
|
||||
Comments,
|
||||
EndOfExperiment,
|
||||
RedirectProlific,
|
||||
RedirectQualtrics
|
||||
]
|
||||
10
Finish/tests.py
Normal file
10
Finish/tests.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from otree.api import Currency as c, currency_range, expect, Bot, SubmissionMustFail
|
||||
from . import *
|
||||
import random
|
||||
|
||||
|
||||
class PlayerBot(Bot):
|
||||
def play_round(self):
|
||||
if self.round_number == 1:
|
||||
yield Submission(EndOfExperiment, check_html = False)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue