[open] How do I randomize the text which appears in a particular "slide"?
  • evtevt
    150 karma points

    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!

  • sebastiaansebastiaan
    13074 karma points

    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

    ---
    Sebastiaan Mathôt - http://www.cogsci.nl/smathot

  • sebastiaansebastiaan
    13074 karma points

    Marking as inactive.

    ---
    Sebastiaan Mathôt - http://www.cogsci.nl/smathot

  • christerwichristerwi
    120 karma points

    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

  • sebastiaansebastiaan
    13074 karma points

    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

    ---
    Sebastiaan Mathôt - http://www.cogsci.nl/smathot

Please sign in to add a comment
Copyright 2011-2013 Sebastiaan Mathôt // Photos originally from Lucnix and WikiMedia // Powerered by Vanilla

In this Discussion

Social

Cedar Riener says: Very nice pacman illusion - on motion cues and change blindness http://t.co/ZOMCUg0z34 via @cogscinl

Latest on cogsci.nl

The Smartphone Revolution in psychological science: OpenSesame mobile // NewsSetting up Kubuntu 13.04 for research // TutorialThe black swan // OpinionMore