Follow-up Mworks Code Question

Hi Chris,

I really appreciate all of your help on my last experiment question (images presented at different durations). Everything seemed to be working well when I tested it without a monkey (showed each image at three different durations randomly). However, when I ran it with the animal today it seemed to exit before all of the stimuli had been presented (ended at 1930 stimuli shown when there should be 2400). I ran it again with the animal and it ended at a different number, ~2100 stimuli shown. Adding up the number of successful, failure and ignore trials gave me 2499.

I assume I have something wrong in my state code where the animal is failing a trial in a way where it doesn’t count as ‘stimuli shown’, but does accept the stimuli in the block. But working with some other co-workers we were unable to figure out exactly what is wrong.

Would I be able to send you code, or a snippet of code and see if you notice anything immediately?

Thank you,
Sarah

Hi Sarah,

Sure. Send me the code, and I’ll take a look.

Thanks,
Chris

Hi Chris,

Sorry I think the attachments were too large in my initial email so I will attach just the code and not the images. Thank you so much! Again, I assume the monkey is getting into a failure state where stimulus presented isn’t incrementing, but it is accepted in stimulus block.

Sarah

mayo_day_1.mwel (26.2 KB)

Hi Sarah,

I think the issue is that if “RSVP wait” transitions to “RSVP failure”, reject_selections is never called.

Because the “selectable object” in question is the block, a selection is made any time the block begins executing. If you don’t explicitly reject the selection in a failed trial, it remains in a “pending” state until accept_selections or reject_selections is called in a subsequent trial, at which point it will be accepted or rejected along with the current selection. If it’s accepted, then it’s “lost”, and you end up presenting fewer stimuli than you intended.

Since all routes through the experiment pass through one of “RSVP success”, “RSVP failure”, or “RSVP ignore”, I suggest doing all accepting/rejecting of selections in those states and nowhere else. Hopefully that will resolve the issue, but if not, please let me know!

Cheers,
Chris

Hi Chris,

Thank you so much! I will try to test run the animal this afternoon and see if I run into any problems. But that makes a lot of sense thank you!!

Sarah

It works!! Thank you Chris!