Dependant condition

So here’s what I want to do:

  1. participants write a text in multiple lines (lines separated by ‘return’)and it gets saved in an excel file
  2. in another program I want to “break each string by return” —> each line the wrote will be in one separate string
  3. in another program, I want two lines(written by them) to appear and let the participants rate.
  4. The two lines that appear are dependant on one another. So if string A2 appears, string A3 has to appear with it so that the participants can rate them.
  5. This has to go one for as long as the participants has lines (depends on the participants)

The one that are bolded are my problems and I have no idea how to do them.
Any help will be greatly appericiated

We need some more details to help here. i.e. how are you implementing this in Builder so far? Are the sentences in an Excel file that you use as the conditions file for a loop? Does each cell contain several sentences?, and so on.

Splitting a string by return characters is simple, using the Python .split()string method, but we can’t tell you how and where to use it without some more details of how you are currently implementing things.

Thanks so much for your message!

Routine1: time (for time limit)

Loop 1 contains: Trial, Blankpage, dot, typeinstruction, gatherText, Timecheck --> the loop ends at 20 minute mark

Routine descriptions:
Trial: Text only for 2 seconds
Blankpage: time randomized from 2 minutes to 5 minutes
typeinstruction- text only
gatherText- gathers participants typing and save them into an excel file in one string
# let’s store the final text string into the results finle…
thisExp.addData(‘inputText’, inputText)
inputText=""
and then goes back to the beginning of the loop at the 20 minute mark.

Second part of the study:

We need participants rate each of the sentences they wrote. --> has not been designed

in each trial their inputs have been saved in one string.

  1. Each string must be broken to sentences that are separated by “return”–> which was originally ‘\n’ (new line in gatherText step)
    2.once broken, in a routine sentence 1 has to appear with sentence 2, and in the next routine sentence 2 has to appear with sentence 3 and so on until all typed sentences appear at least once and then goes back in the loop for the second trial of part one of the study and does the same.
  2. this all depends on how many sentences the participant has written so they should be able to end it anytime they want–> loop termination by a key

In part two of the study there is no text gathering, just the rating component of the builder would do the job!

Hope this is enough information.
Thanks again for taking the time.
I really appriciate it!