Creation of new variables and storing in logger using custom form with loop
Hello,
Using OpenSesame 3.1.6
I have a form_base that contains image-buttons whose content is specified via a loop that calls a sequence (containing a single form/test to run).
The loop contains a list of words to be translated ([word_to_translate]), and three "guesses"/words given to the participant: [guess1], [guess2], [guess3]. These options are presented to the participant as image-buttons:
widget 0 0 1 1 label text="[word_to_translate]"
widget 0 1 1 1 image_button path="[guess1].png" var="[word_to_translate]\_[guess1]"
widget 0 2 1 1 image_button path="[guess2].png" var="[word_to_translate]\_[guess2]"
widget 0 3 1 1 image_button path="[guess3].png" var="[word_to_translate]\_[guess3]"
The correct answer [correct_response] is also specified in the loop's table.
I have the "Log all variables" enabled in the logger, and I am seeing the following info correctly registered:
[word_to_translate]_[guess1] -> Yes/No
[word_to_translate]_[guess2] -> Yes/No
[word_to_translate]_[guess3] -> Yes/No
time_[word_to_translate]
etc
What I also want to record in the logger is the following info:
(a) Whether the participant answered correctly for any given [word_to_translate], i.e. effectively something like:
was_correct_answer_given_for_[word_to_translate] --> Yes/No
(b) The "response time", defined (I guess?) as
response_time_[word_to_translate] = time_[word_to_translate] - time_["previous"_word_to_translate]
But I don't know how to do either of them.
Could you please let me know if this is feasible?
With many thanks,
--Christos
Comments
Hi Cristos,
In this case, I think you're better off using a simple
inline_script
. Below you see an example of how that works, with the difference that I used abutton
widget instead of animage_button
. But the idea is the same. Does that clear things up?Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Many thanks for the detailed response, Sebastiaan. I can see that with the inline python one has much more flexibility.
I still need some help with adding some variables to the response history, though. As it stands, only the response, correct and response_time from the last entry in the loop table are saved (because they are overwritten every time the sequence is called). Can I add a "_word_to_translate" suffix to these variables somehow? Not sure how to do that.
(my logger claims it logs all variables)
--Christos
You can specify an
item
as keyword. If you do that, OpenSesame will also register the responses with a_[item]
suffix, just like for akeyboard_response
.See also:
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thank you very much Sebastiaan! This seems to do what I need.
Best, C.