Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] How do I randomize the text which appears in a particular "slide"?

evtevt
edited January 2014 in OpenSesame

Sorry I do not know quite the right way to phrase this question. I have a set of different stimulus statements, which are presented to the participant with a constant set of questions. The the stimulus is randomly selected across participants, but the selection remains constant within the participant (when it appears on multiple slides).

Another way to phrase this might be "how do I create a list which is then randomly selected from and assigned to a variable, which is then displayed in a text_display item?"

What is the best way to do this in OpenSesame?

Thank you so much!

Comments

  • edited October 2011

    Hi Evt,

    Welcome to the forum and thank you for your interest in OpenSesame!

    I'm afraid I don't fully understand the question. Do you want to:

    • Ask a number of questions, which are the same for all participants, but in randomized order

    • Collect text input from participants

    • Present a picture with each question, which is held constant (i.e., the same with each question) for each subject, but varied between subjects (i.e., each subject has a different picture).

    Is this correct? If not, could you provide some more details about what you want to do?

    Kindest regards,
    Sebastiaan

  • edited 5:10PM

    Dear Sebastiaan,

    I want to display dialogues to my participants (and have them read parts of them).
    Any way I can display .txt files full screen... directly or indirectly...

    i mean... i could, of course, just screen-shoot them and display them as images... but maybe there's a better way?! in-line coding solution?!

    warning disclaimer: user not experienced with programming.

    thanks!
    stoph

  • edited 5:10PM

    Hi Stoph,

    Sure, you can read the contents of a text file into a variable, and then show the variable using a text_display item. Let's assume that you have a text_display item that shows [my_text], i.e. a variable called my_text. You can then add the following code to the prepare phase of an inline_script at the start of the trial_sequence. This reads the contents of a file my_text_in_pool.txt (assumed to be in the file pool) into the variable my_text.

    For more information, see:

    path = exp.get_file('my_text_in_pool.txt')
    text = open(path).read()
    exp.set('my_text', text)

    Cheers,
    Sebastiaan

Sign In or Register to comment.