Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Prompt when wrong input

edited March 2016 in OpenSesame

Hi guys,

first of all a big thank you for this amazing software!
My experiment is working, but I have two remaining questions.
They are both based on the same idea of how to build in a safety check, in that way that the program gives the user a prompt when he gives in some invalid input.

So in the fist part of my experiment I want the particpant to fill in some questionnaires. But the thing is: the questions can be skipped without selecting an answer..so I'm actually looking for some trick or code to get around this.

In the second part of the experiment the participant is shown some video fragments after which they have to estimate the duration of it. After each estimation we provide them with some feedback. So I wrote some Python code in which I used a ratio to calculate the percentage that their estimate is away from the real duration. (so the feedback is adjusted then: (too long, way too long, too short etc..)

r = (var.estimation) / float(var.duration)

The point here is: if the participant enters by mistake a character or so the program immediately returns an error (which is completely normal) so I'm looking for some code that recognizes that the user gave some wrong input and he can try again until correct input is given.

Thanks and have a nice day,
Benjamin

Comments

  • edited 11:33AM

    Hi Benjamin,

    Find an .opensesame (version 2.9.7) at the pastebin link below. You should also be able to open this with OpenSesame 3.
    Using the same principle you should also be able to detect for no response in the questionnaire part:

    if self.get("resp")=="":
    

    http://pastebin.com/aK7njJEU

    Hope this helps,
    Jarik

    Note: item please_numeric is set to never run in the experiment sequence.

Sign In or Register to comment.