PsychoPy version (2023.1.3):
**What are you trying to achieve?: I want my sentences to appear region by region. For example, the sentence Everyone knew that Meredith read every play despite her busy schedule, pops up like this on the screen:
Everyone knew that
despite her busy schedule
Thanks in advance
You could use loops for this task by defining a variable in a CSV file and placing each segment of the sentence in an individual row. Then just set the variable as the text of a text component.
Place a loop around your routine, add the created CSV file and set nReps (loop properties) to 1.
Thank you. You are great.
Now, I can show sentences region by region.
I have two more questions. I would be reallly grateful if you could help me.
- How can I add another experimental sentence or filler item?
- Is it possible to ask a wh-comprehension question as soon as participants read a sentence? if so, please help me on doing this.
By wh-comprehension item, I mean, when did Meredith perform? then participants type every week, for example.
What code are you currently using to split the sentences ?
Are your full sentences in a single cell or multiple rows in your spreadsheet?
What code are you using to display the word?
I don’t use any code.
they are in multiple rows in the spreadsheet. I have taken a screenshot:
I wrote my sentences like the following in a CSV file to show different regions when running Psychopy:
Everyone knew that
despite her busy schedule.
I am not sure, but if I had used a code, sentences would have appeared word by word. I want my sentences to appear region by region.
If I should use a code, please tell me.
Assuming you have more than one sentence, there are three approaches.
Two loops and lots of spreadsheets
- An outer loop to select the sentence.
- An inner loop which presents the regions.
Two loops and one spreadheet
- An outer loop to select the sentence, which is contained in a single cell with a specific character to mark the region splits
- An inner loop which splits the sentence and presents the correct region, e.g.
regions = Sentence.split('/') # If you use / in your cells to mark the regions.
thisRegion = regions[innerloop.thisN]
One loop and one spreadsheet
Similar to above but the presented region is based on Each Frame code rather than an inner loop.
Thank you for your contribution @wakecarter
I go with the second approach
As you said, the sentence is now in a single cell. Also, I used the character ( / ) to demarcate the sentence:
Then, I inserted the outer loop in the flow and selected the spreadsheet file.
would you please help me where I should insert the inner loop or the code that you wrote for me
Begin Routine of Blink500 or Reading should do. Do you want the comprehension question to appear after every word?
Not after every word. I want comprehension Qs to appear after each experimental or filler item.
Would you please look at what I have just posted to see if I am doing the right thing?
I’m playing a game with my children. Should Comprehension go outdie the inner loop but inside the outer loop?
Sorry for asking too many question. I’m in no hurry. Please help me whenever you have time.
Honestly, I don’t understand the difference. If you think it is a good option then I opt for it.
I want my participants to read demarcated sentences, then as soon as they read that sentence, a comprehension questions pops up.
The inner loop shows the regions. Each time round it shows one region.
Try placing the routines in different locations and see what happens
Thank you for your help
Idk the difference between inner and outer loop.
How can I insert them in the flow?
Please look at the bottom of this screenshot. What words are you unsure of?
You are my legend.
Let me do what you said again. If I encounter a problem, I will ask you.
Let’s proceed step by step
First you told me to:
To do this, I typed my sentence like the following and used / to specify each region:
Then, I used the outer loop to upload the spreadsheet like the following:
If I am right so far, let’s proceed to the final step.
sorry for taking your time. I wish I were better.
Let’s proceed to the next step. You told me to:
I inserted the inner loop and uploaded the same file that I uploaded for the outer loop.
Now, I am wondering where I should enter the code that you wrote for me.
Correct me if I am wrong, but I should enter the code here. Right?
what is the code type? (i.e., Py, JS, etc.).
where should I enter the code? (i.e., before experiment, begin experiment, etc.).
and the code should be entered in the Reading Section in the flow, right?
Now I understood what you were trying to say. I changed the place of comprehension Qs.
My main problem is where I should enter the following code:
Did I enter the code in the right place?