form_multiple_choice text into number in the output file/random duration of the fixation point
Hey community,
I need help for the follwoing two problems:
How is it possible to replace text to a number in the output file (form_multiple_choice)?
And the second question is:
How is it possible to set the duration of the fixation point randomly maybe betwenn 200 and 450 ms.
Thank you for your help
Daniel
Comments
Hi Daniel,
How is it possible to replace text to a number in the output file (form_multiple_choice)?
Could you specify what you mean? I am afraid I don't quite get it. If your text variable is a number written as string (e.g. '1', rather than 1), it should automatically be cast to a number. If not, you would have to use python coding (in an inline_script) to change its value, e.g.
if var.response == 'one': var.response = 1 elif var.response == 'two': var.response =2If you don't need them during the experiment, I'd do it later during the data analysis.
How is it possible to set the duration of the fixation point randomly maybe betwenn 200 and 450 ms.
Also here you need python coding in an inline_script. Import the random library, compute an ITI, and then you can use it in subsequent items. E.g.:
GOod luck,
Eduard