Displaying multiple texts in the same trial

If this template helps then use it. If not then just delete and start from scratch.

OS (Mac mon):
PsychoPy version (e.g. 1.84.x): 2021.2.0
**What are you trying to achieve?: Building a learning paradigm online
Before getting into the builder and searching for the code, I wanted to ask if in your opinion the experiment could be built on psychopy. I’ve looked for some topics and tutos already and have not find anything close to what I want to do.

In this paradigm, participants will be seeing 80 words and their translation all on the same screen.
I wish for the 80 pairs to be on the same screen for a total of 8 minutes. I probably won’t be able to put all the words on one screen. Hence, participants will be able to scroll around and see all the pairs and learn as many words as possible.
I would like the stimuli to be presented in a table.
List item 1 - Translation | List item 2 - Translation
List item 3 - Translation | List item 4 - Translation

Moreover, the stimuli would be randomized.

I was wondering if such an experiment could be built on psychopy or am I too ambitious here?

Thanks in advance for your help.

If your key challenge is scrolling, then you might find my Scroll Text demo useful.

You could have two scrolling text components containing text that has been generated in a random order. A single scrolling text component would be easier, but in principle two side by side should be fine.

Thanks for the link! I’ll look it up for the scrolling part.

My biggest challenge is to display all the words on the same screen and to have it randomized.

If you preload your words into a list (e.g. called words) then you could set display text as follows:

msg = ''
for each word in words:
     msg += word[0] + ' - ' + word[1] + '\n'

Then set the text as $msg each repeat.

Thanks a lot. That gives me a place to start!

I may have got the syntax wrong there. If it complains, delete the word each

Syntax rarely is perfect at first try.
Thanks for the suggestions anyway

Just an update to thank you for orienting me in the right direction.

I’ve manage to create a syntax pretty close to the one you gave me.

txtAppr = "";

for( var i = 0; i < ListAppr.length; i ++ ){
    txtAppr = txtAppr + "\n" +  ListAppr[i]["ItemNum"] + ".     " + ListAppr[i]["FR"]+ "      ==>      " + ListAppr[i]["ENG"];

Looks good.

I would recommend coding in Python as much as possible (but in such a way that the transpiler creates working JavaScript)

I do not have any knowledge in Python but will turn to someone that might.

Thanks for the advice!

If you are experienced with JavaScript but not Python then it’s definitely tempting to code directly in JavaScript. However, the Auto code components help with checking for unbalanced brackets, etc., which I find very useful.