psychopy.org | Reference | Downloads | Github

Dropping items from list based on performance

Hi again,

It works perfectly by itself. I tried to add it to the criterion learning loop you perfectly created but I am failing. Attached are the files I use for my experiment. I want my participant to be able to use Turkish characters for the “test” and “trials_4” loops. For that where should I put the import code you sent?

0.xlsx (28.7 KB)
1.xlsx (28.7 KB)
2.xlsx (28.7 KB)
blocks.xlsx (27.5 KB)
innerConditions.xlsx (9.5 KB)
selecttasks.xlsx (27.9 KB)
letterConditions.xlsx (35.6 KB)
FlankerConditionsText.xlsx (39.4 KB)
experiment1ldwopract.psyexp (126.9 KB)

Well for one there’s a typo “innerConditionsp.xlsx” in the code component in the trial2 routine, and the loop trials_8 is looking for an excel sheet called letterconp.xlsx , which I assume is “letterConditions.xlsx”.

If you want help you really need to just send an experiment with the problem isolated. If I can’t easily run (and I unfortunately don’t speak Turkish) it’s not something I’ll be able to work on. So if you can send a sample experiment just with the part you’re having trouble with I’ll be able to help.

I was able to make a little sense of what was happening, but again can’t yet run it.

Looking at trial2s, right now the text of the TextStim “block_1_input2s” is set by having $’’.join(key_resp_12s.keys) run on every frame. Again, since pressing the i key on your keyboard produces “apostrophe”, this method will no longer work. If you want to use the method I suggested, you’ll have to take a little time to make sense of how it works, because it uses a different approach.

You will need a “u” in front of this string to make it accept unicode characters:

msg = u'Yanlis. Dogru cevap {0}'.format(corrResp)

Well I really didn’t feel like grading papers, so I think I figured it out, but in the future you will need to give us Minimal (emphasis on Minimal :slight_smile: ) working examples.

I made a copy of your experiment and chopped most everything out so I could look at the issue. I added a routine that you should put at the very beginning of your experiment to setup the keyboard (called setupKeynames). You’ll have to go to your experiment settings (click on this):

and make sure it looks like this:

This adds another field where you can specify the name of the computer, in case the keyboard layouts are different. If it’s not typed correctly the experiment will quit with an error (which is a good thing).

Other than that, I only modified the routine “trial2”. Study it very carefully to see how it’s different from yours. One thing you’ll have to do is right-click on the keyboard icon and move it to the top.

experiment1ldwopract (copy).psyexp (100.6 KB)

1 Like

Dear Daniel :slight_smile:
I can’t find the exact words to thank you! I managed to work it in two laptops though I had to give using the code for latin square, Now I will try our ancient lab desktops. If I ever complete this dissertation, your name will be in the acknowledgements.

I thought you will need to see everything to figure out what is wrong, hence the overcomplicated working example. Thank you for the warning, I will be careful to use minimal working examples in the future.

So I added them like this to the magnificient setupkeys routine you wrote, and the Turkish characters did not show. psychopy did not close itself when I hit those keys but they do not show either. Furthermore, even for the words without any Turkish characracters, when I write the correct answer it gives me a wrong response like: Wrong. You wrote teyze, but the correct answer is teyze.

I have no idea what to do :cry:

Yes, since we changed the way the typing stimulus works, we have to change the way answers are checked, that should be fixed here. In the trials2 routine, code component, End routine, the fourth line has to be changed to this:

elif typingStim.text == corrResp:

See the attached example for further context.

As to why the keys aren’t showing up with this different keyboard layout, I don’t know why that would be, but am hoping that it has simply been entered incorrectly. In this example I also added an example Turkish keymap for a separate computer (here called Lab1). Compare it to what you did, pay very close attention to detail (colons, commas, curly braces), and hopefully it will be a simple typing error.

experiment1ldwopract (copy).psyexp (100.5 KB)

Dear Daniel,

This last one solved all my existing problems, but of course I managed to create a new one :dizzy_face:

After I finish the bloock_1_loop2 by succesfully completing every word pair three times, instead of continuing to the next part, psychopy freezes and I have to force it to quit.

I am realy sorry because I keep bothering you, and extremely thankful for all your help.

burcu

Well, again your best way forward is to isolate the problem. Make a very small minimal example (maybe with less items) to find the problem more efficiently, and if you can’t fix it by eliminating things like this (you could make a copy of the experiment and go eliminating elements to find the problem), you can share the example and we will have a better chance at helping you. I’m not going to be able to put in the time to memorize long lists of pairs of unrelated Turkish words to run the experiment as-is and find the problem. :slight_smile:

I did as you told, still cannot solve the problem. Here is the example. I hope it is minimal enough :worried:

abacadproblem(copy) (2).psyexp (48.8 KB)
innerConditions.xlsx (8.7 KB)
blocks.xlsx (8.2 KB)

Ok, so I’m seeing a few issues.

So your blocks.xlsx selects specific rows from your innerConditions.xlsx file. The dictionary we setup at the beginning of the experiment to keep track of scores (so that we eliminate an element after 3 correct) reads in EVERY line. So if innerConditions is:

stimText
a
b
c

, then at the beginning of the experiment we read them all in and track their score. We are only allowed to leave the loop when all stimuli have a score greater than three. So if in blocks.xlsx you only select row a, you will never be allowed to move on because b and c can never make it to 3 correct (they are never shown).

At the end of the routine, the code asks “are there any elements with a score less than 3”? And if yes, it keeps going.

So that’s the (or a) problem. So remind me again, why are we only selecting certain rows?

I have three lists. For every list, the first word of the pair is the same, and the second word it matches is different, hence the ab/ac/ad task. After the learning phase of each list there is a test. The first version of the experiment included to many routines and loops (since there were two more task) so I did not want to create 3 different routines for three different lists and made the routine select a different list in every turn.

But now, I decided to use different files for each task. If that is the problem, I will create separate routines for each list.

Thank you again. Hope this will be the last time :slight_smile:

I think having separate conditions files and less loops is a good way to go. But you will have to adjust the code that keeps track of accuracy, creating a new scoreDict each time you use a different conditions file. If you update this minimal example I could help adjust the code.

here is the updated version of the task. Now I have separate routines and condition files for each list.

innerConditions2.xlsx (8.6 KB)
innerConditions.xlsx (8.6 KB)
innerConditions3.xlsx (8.6 KB)

abacad.psyexp (62.9 KB)

So I did some surgery on this. Some important notes:

I removed all of the repetitive routines and loops, and added an outer loop that selects your conditions files. On the loop settings I unchecked “Is trials” so that it won’t save data for those loops (I did the same for the “list” routine, since they only watch the words go by, but if you’re going to want to know what order they saw the words in, maybe you should check it.). This should make your experiment much easier to modify, since you won’t have to modify the same thing three times whenever you make a change.

Since the “scoreDict” is going to be different for each conditions file, I moved it to a place where it will be recreated every time a new conditions file is imported, this should solve the problem earlier of the problem never letting the user get to the next round (since it found words that had not been “learned”, and they never could be “learned”).

I also had removed some things that I think were from previous versions, and were now irrelevant, since the methods for entering text are now different. I removed the “inputText” variable (note the “Text” property of the block_1_text TextStim).

Take a little time to review it and understand how it works (particularly how the conditions files are selected, and how the scores of each item are updated), hopefully it suits your needs. Let us know when there is something you don’t understand.

abacad.psyexp (37.0 KB)
blocks.xlsx (4.4 KB)
wordList1.xlsx (4.4 KB)
wordList3.xlsx (4.4 KB)
wordList2.xlsx (4.4 KB)

1 Like

This post has been incredibly useful to me! I really want to thank the both of you for bringing this issue up and for the very nice solution proposed here.

I was wondering whether it would be feasible to write a similar experiment in the builder that not only keeps track of the amount of correct responses for each item, so that it can be used as a criterion to advance further in the flow, but also removes items once they have been learned so that they are skipped in subsequent presentations of the same item list.

For example, let´s assume that my list of stimuli looks like this: ‘a, b, c, d’, and my learning criterion is two times correct. If after the first round of test the learning criterion for stimulus ‘a’ and ‘c’ has already been reached (in my case, just one correct response) whereas participants incorrectly responded to the remaining items ‘b’ and ‘d’, then I would like to drop stimulus ‘a’ and ‘c’ off the list and just continue with ‘b’ and ‘d’.

Is my description informative enough to figure out what I am try to accomplish?

Any help or insight on this matter would be greatly appreciated.

– Davide S.

I would have to check (or maybe you could for me) if it was this suggestion or one for another post, but I thought that this solution already does just what you’re asking, does it not? Glad you’re finding it helpful.

Thanks for the kind reply,

If you are referring to this post: Criterion learning - conditional mapping? (just found it using ‘criterion’ as search term) then I´ll have to check it thoroughly.

Regarding the solution already proposed here, it only drops items off the list (by advancing in the flow) if they all come after those who just met the learning criterion.

For example, with learning criterion = 1, if ‘a’, ‘b’, ‘c’ = 0 and ‘d’ = 1 after the first round, then ‘d’ won´t be shown anymore at the end of the second round if a correct response was given for all the previous items in the list (i.e., ‘a’,‘b’,‘c’ = 1).

However, if ‘a’, ‘b’, ‘c’ = 1 and ‘d’ = 0 after the first round, then ‘a’, ‘b’, and ‘c’ will be shown again prior to ‘d’ even if the learning criterion was already achieved for these three items.

– Davide S.

Update: I looked into your solution in the post linked above. I downloaded and tested ‘criterion2.psyexp’ as it comes, with the exception that I halved the words pairs (from 6 to 3) in the spreadsheet for the sake of simplicity.

I also kept the learning criterion at 2.

If my first two rounds is all ‘hits’ except for the last word pair (graph - rain), the experiment keeps presenting the first two word pairs (skirt - blade, ant - phone) but the feedback now says that I should have responded with ‘rain’.

The resulting data file correctly shows the ‘LEARNED’ label for each additional presentation of ‘skirt - blade’ and ‘ant - phone’.

I wonder why it doesn´t work as intended for me, maybe it has something do to with my PsychoPy (v1.83.04 on Ubuntu)?

– Davide S.

I wouldn’t think that would be the issue, (I’m also on Ubuntu), but it’s looking like maybe you should start a separate thread for this, copy or re-explain the issue as clearly and concisely as possible, ideally create a minimal working example, and we’ll take it from there. Sound good?

I wouldn´t either. Anyway you are right, this may deserve a new thread. I will do as you suggested, thanks!

– Davide S.