Fixation duration + response collection
Hello (again)
I made an experiment a month back and have received great help. The experiment consists of phrases shown on a sketchpad (and inline scripts permitting me to measure individual reading time per phrase) followed by a multiple choice form (see CodeCB). I have read and reread the manuals and tutorials but I cannot find the answers to the questions below!
Firstly, I still do not have answers as to how to measure average response time, accuracy etc without a keyboard response item.
I understand that my logger doesn't actually log anything, but how is it possible, by means of Python, to add the response variables I so desperately need?
Secondly, after inserting the inline script measuring reading time,
my sketchpad item containing the fixation dot no longer stops after 500 ms! I have to press a key in order to remove it. It probably has something to do with the inline scripts, but I do not know how to change it.
And lastly, I would like to measure response time on the multiple choice form. I have set the duration to 10000ms (as the readers are non native) but afterwards it does not collect reaction time (beyond being able to respond within the limit).
I understand that there is a massive demand on your help, but I'll rather try my luck!
All the best,
Cat
Comments
To make OpenSesame aware of Python variables, you have to assign them as properties of the
var
object, like so:See also:
You say only what you don't want to happen! But what exactly do you want to happen?
Forms don't record response times. But you can simply insert another item after the form (say a blank
sketchpad
) and then determine the response time by subtracting the onset time of the form from the onset time of thesketchpad
. Does that make sense?Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hello!
Thank you! So far, I have understood the logic of python coding (I already tried the var.) but the problem was that I didn't know where to insert it! I tried to do like you said and just type var. before the code such as : It appears to be working!
I still do not know where to type var.acc nor var.avg_rt though... This doesn't seem to work.
As to the fixation dot, I would like it to last 500 ms! But as I have an inline script directly after (image below), I think it no longer acknowledges the duration of the sketchpad!
And lastly, I do not really understand what you meant but this is what I tried to do:
I created a sketchpad (named Time) after the multiple choice form (named Form) followed by an inline script and typed an approximative code : It obviously doesn't work..
Programming is not my forte!
Thanks again for the replies, you are all lifesavers!
Cat
Right, because you first present a
sketchpad
for 500 ms, and then collect a key press in aninline_script
(which will pause the experiment until a key is pressed). But if all you want is for thesketchpad
to be shown for 500 ms, then you can just remove theinline_script
altogether.No programming is required! If you look in the logfile, you will see
time_[item name]
columns with the timestamps of all items. And you can use those to subtract the onset of Form from the onset of Time.As a more general point, though: I think it's a good idea to take a step back, and first learn the basics of OpenSesame and Python code. Otherwise you will just go from question to question, getting stuck at each step along the way!
The intermediate tutorial may be a good fit for you:
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hello,
And thanks again!
The Fixation dot sketchpad is stopped by the inline script, but one of your colleagues advised me to create this in order to measure reading times on each sketchpad named Syntagme_ 1, _2, _3 etc. How can I then remove it?
But I seem to have plenty of reading/reaction times however...
I do have the onset time for the sketchpad Time but not for the multiple choice form named Form
Thanks for the advise regarding the tutorial ; I have read it all. But I am more of a "Python for dummies" kind of gal...
Tusen takk!
Cat
Hello again,
I tried to create a sketchpad item (duration 0) before the Form just as I did after the Form and got this :
If that is possible, it means that 8137ms - 5896ms = 2241ms represents reaction time on the first multiple choice form?
The
inline_script
should follow an item if and only you want to collect a key press after it. So you can just delete the item (right click → delete) theinline_script
after the Fixation item, because after the Fixation item you just want to wait 500 ms and then move on. Right? Does that make sense?Exactly.
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hello,
And happy Christmas to all! I tried to remove the inline script under like you said (which I have put back in order to illustrate)
but the test won't even run afterwards. When you say "delete it", do you mean the entire inline script or just part of the code?
Thanks again for all your help! I'm nearly there :-)
Hi,
You should remove that part of the code that is used to measure response times. If the
inline_script
does not do anything else than measuring response times, you can of course delete it entirely.What do you mean? Do you get an error message? Does nothing happen?
Eduard
Hello!
I have tried everything possible but I keep getting the error message
The first inline script thus appears to be quite important. I also tried to remove individual codes ;
kb = keyboard()
k,t = kb.get_key()
t_on_Syntagme_1 = clock.time()
but I keep getting the same type of error message "___ is not defined". I understand that I can't just remove things without knowing the basics of Python, but I just don't get what I'm supposed to do!
Sorry again!
And happy new year :-)
Cat
Hi Cat,
Also to you a happy new year.
The error message you see says that the variable
kb
does not exist. I don't know exactly how you wrote your code, but I suppose this line:you only use once in the first
inline_script
that you removed by now. Can you confirm? This line is important, because it initializes a connection to the keyboard which you need to make your experiment react to keypresses. If kb does not exist, every time you callkb.get_key()
, or any other keyboard functions, Opensesame is not able to find the keyboard and crashes.So, probably you should restore the first
inline_script
and remove all the lines, exceptkb = keyboard()
, or add this line to the nextinline_script
(new_inline_script_3, I believe).Good luck,
Eduard
Hello,
Yes, this was the code you helped me with earlier this year. "kb = keyboard()" is used only in the first script as shown under (code used in the first two inline scripts).
I have already tried all of the above and I always get an error message. I get that you have to command the use of the keyboard for all the other sketchpads, but that doesn't count for the first which is supposed to last only for 500 ms.
What I am trying to do is simply to get the sketchpad Fixation to last only 500 ms and to ignore the inline script directly after which includes the codes "kb = keyboard()" and "k,t = kb.get_key()". Whichever way I try to fix it, it just won't work without the first inline script.
If all else fails, I'll just remove the fixation mark all together!
Cat
Hi cat,
the thing that causes the halt of the experiment is not
kb = keyboard()
, butk,t = kb.get_key()
. You have to remove only the latter to avoid the experiment from pausing, or replace it with aclock.sleep(500)
, if you want it to sleep for 500 ms. Does this make sense?Eduard
Yeeeeeeeeeeeesss!! Eureka!!!!