Hi everyone, I am new here (and also to otree) and hopefully doing this right.
I have spent a long time trying to figure this out, even if it seems so "small" I would appreciate any help!
I am asking about "formfields":
I tried:
<nobr>{% formfield field %} % </nobr>
but it wont do the trick and just jumps to the next row and wont show up next to it.
2. I want participants to only be able to enter "40" into the formfield. I did that with the min/max option, however I dont want the formfield to tell participants "Please enter a number smaller than 40". I tried costumizing this (see below) but nothing changed - so I was wondering whether someone has a suggestion on how to adjust the error message or at least stop otree from dispaying the default one?
The part in red is what I added to my models.py (we need to use an older otree version):
class Player(BasePlayer):
ContributionA = models.IntegerField(
label="Please state the contribution of A in % (rounded to the nearest integer):"
)
contributiona1 = models.IntegerField(
label="Please state the contribution of A in % (rounded to the nearest integer):",
min=40 , max=40
)
def contributiona1_error_message(player, value):
print('This is incorrect')
if value != 40:
return 'Please calculate the contribution of team mate A again'
however, as I said, nothing happened - I am not sure whether this approach is even possible..
thanks for any suggestions!
Klara