Generate learning set of words, make subset, learn word then replace

Hello, I am building an experiment that teaches English Vocabulary based on words participants select as unknown, I am having trouble using the selected words, thank you in advance for your time and help.

Objective:

  1. Participants are shown a list of words and click whether or not they know the word on a slider. Once they select 100 (set to 5 for now), the wordSelection routine ends, with the selected words saved in Learning_Set. The code for this part:
Begin Experiment:
Learning_Set = []

Begin Routine:
if trials_wordSelection.thisN == 0:
    number_select = 0

End Routine:
WordResponse = ratingWordSelection.getRating()
if WordResponse.lower() == "no":
    number_select = number_select + 1
    if number_select == 1:
        Learning_Set=[Word]
    else:
        Learning_Set.append(Word)

if number_select == 5:
    trials_wordSelection.finished = True
  1. The next routine, I need to take this Learning_Set, create an ‘Active_Learning_Set’ by selecting 20 of the 100 words in the Learning_Set and display them randomly with multiple choice responses for translation.
  2. Once a word has been answered correctly three times it should be dropped/marked as learned and be replaced by another word from the Learning_Set. So a set of 20 ‘not learned words’ should be active at all times.
  3. A word answered incorrectly should be displayed again randomly after at least 3 other trials interval.
  4. Feedback ‘Correct’, ‘Incorrect’ will be displayed after each trial.
  5. A block will end after 40 trials.
  6. The next block should pick up where the previous one left off.

Question:
I have no idea how to access my Learning_Set in another routine, the above (2-7), will be the testing phase in which I need to access the Learning_Set, the testing phase is preceded by a similar practice round with only 5 trials. Aside from accessing the set, how can I make a subset behave as described above? The learning_set contains English word in the end, I would provide the testing phase loop with an excel file containing all of the words (including not selected words), the translation (correct answer) and alternative translations. I guess the core of my question is, how do I structure this?

Thank you so much in advance for any and all help in this. As a newby in this I am totally lost in how to proceed. Please let me know if I am not being clear enough on what I am trying to do.

This is not trivial. So, just to get you started: Accessing the Learning_Set list in another routine is relatively straightforward. Once your list is complete, you could shuffle it to create a random order:

shuffle(Learning_Set)

In the next routine and its associated loop, you could then have a code component that uses the loop counter as a list index to get one word per trial:

myWord = Learning_Set[trials.thisN]  # assuming the loop is called trials

In the same routine, below the code component, you could then have a text component, that has $myWord as Text (set to every repeat). The loop itself would not be associated with an input file, but would only specify a number of repetitions.

Hope this helps initially.

Jan

Hi Jan!

Thank you very much for your tips, this actually inspired me enough to get me going again and I’ve been making progress for several hours now. Very much appreciated!

Leonie