Control repetition and distribution of target words in an online Lexical Decision Task
Hi,
I am new to OpenSesame and firstly wanted to thank everybody involved for the wonderful work. I am trying to set up an online LD task using OSWeb/JATOS where:
- a session consists of 100 items (out of over 50000)
- the distribution of the items should be around 75% words, 25% non-words
- ideally a participant only sees an item once (not only per session, but also in subsequent sessions)
- the number of times an item is shown to participants is more uniformly distributed
Currently, I have pasted all items into a block loop with a "break if 100 responses have been given" condition and a random selection. This works just fine and assuming that participants do not do more than 20-30 session, not too many items should be repeated. I pasted the items into the loop because reading from a file did not seem to work when I tried the experiment with OSWeb.
My questions: how could I achieve a distribution of 75:25 as mentioned above? And can I control how often items are shown in total/to each participant? I have implemented a user input form for subject IDs (as described here: https://kvonholzen.github.io/Tutorials_Open_Sesame_Lexical_decision_OSWeb.html#Create_a_subject-specific_code), could that be helpful?
Many thanks in advance!
Best,
Tim
Comments
Hi Tim
I don't know whether reading loop tables (or anything) from file is currently supported in OSweb. The straightforward solution would be to have the logfile for each subject/session in the pool, and use that file to infer which items were already used and select others. As using files doesn't seem to be an option, you could hardcode the total list of items in your experiment and use the subject-specific randomization to index the set of items. In the process you can also easily add the 75-25 part. Here is an example of how to do it in Python. However, as osweb requires javascript you would have to translate the code (I'm not particularly good with js myself, sorry).
I hope this helps,
Eduard
Btw: This discussion could be useful to translate the code to javascript
Hi Eduard,
many thanks for your response. As I said I am quite new to OS and I don't quite understand how I would feed my block loop with this new shuffled list (but I found some code that does the shuffling in JavaScript at least), i.e. were to place the inline_script and how to access it from within the loop. And do you by any chance know how I would achieve this implementation with JavaScript?
Best,
Tim
Hi TIm, this newly shuffled list would replace a column of the loop table. So this would mean that per trial you would have to index every item of it one by one. So, for example you could have an inline_javascript item in the beginning of your trial loop in which you extract this item. In Python this would be:
var.current_item = item_list[current_trial_index]
in Javascript probably almost the same:
vars.current_item = item_list[current_trial_index]
As you can see you need another variable for this. Namely the current trial index, which is basically just a counter of your trials. You could add it to the loop table for simplicity's sake. If you do, you can either set the loop to be randomized or to be sequential. If you choose sequential, you need to make sure to have shuffled your list beforehand. If you shuffle, you don't need to do the final shuffling when you create your item_list.
Attached an example that implements this post here. I am sure you can build from there the procedure in the initial post of mine.
As I said I am quite new to OS and I don't quite understand how I would feed my block loop with this new shuffled list
It is never too late to do some tutorials or try to learn something about Python/javascript. It may feel a bit like side-tracking now (when you want to build your experiment), but it is definitely a great investment in the future. So check out our tutorials, and maybe also some video tutorials on Sebastiaan's youtube channel.
I hope this helps!
Eduard
Hi Eduard,
yes, your input helped a lot! I managed to collect some JS snippets to translate your code and it seems to work as expected. I haven't tried it with all 50000 items yet (I guess it will noticeably impact loading times?), but here is what I've got in case anyone is interested:
The session and subject number will be retrieved from user input (as done here: https://kvonholzen.github.io/Tutorials_Open_Sesame_Lexical_decision_OSWeb.html#Create_a_subject-specific_code), the shuffle function is from - surprise - SO (https://stackoverflow.com/questions/16801687/javascript-random-ordering-with-seed).
The last (rather minor) issue is that corrected responses cannot be logged. I guess this could be achieved by checking if the item on screen is found in vars.word, but again this might impact loading times significantly - might be more practicable to run a script on the final log files though.
Thank you very much for your help, it was very valuable.
Best,
Tim
Thank you so much for sharing, @TOS21! Hope everything works as desired with the full stimulus list!
And for determining the correct status of the participant's response (is that what you are referring to?) both methods that you were suggesting should work.
Good luck!
Lotje
Did you like my answer? Feel free to
Hi Lotje,
yes, everything worked like a charm!
And yes, I referred to the correct responses. It can easily be included at the beginning of the trial sequence with:
This does not work in OpenSesame ("includes()" came with a later version of JS), but it should work in most browsers with OSWeb. Of course the correct responses can/should be counter-balanced, but I did not bother to include it just yet :)
Best,
Tim