Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 9 of 9

Thread: Saving multiple responses to txt file using filename (case 6616)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2013
    Posts
    1,093

    example files to try

    Hi Margerite,

    I've attached some files that show you what I was trying to suggest in my earlier post.

    First, we have to create a folders for MediaLab files and another folder for DirectRT files. Let's call the folder for the MediaLab files Marguerite_ML and the folder for the DirectRT files Marguerite_DRT. You can put them wherever you want, but I like to put the folder for my MediaLab questionnaire and experiment files in the general MediaLab folder and the folder for my DirectRT files in the general DirectRT folder; you'll see this in the pathways in the files I uploaded. Wherever you put the folder for the DirectRT files, create a new folder named "stim"? (no actual quotes in any file names) inside it. You will need it for the answers to the fill in the blank items that will be created in the MediaLab files.

    Open the Marguerite_ex.que file I uploaded in the MediaLab experiment editor. Go into the Details window for the first four fill in the blank items and look at the File Name field. You should see that I put the full pathway name to the stim folder you made in the Marguerite_DRT folder for your DirectRT files. Each of the four fill in the blank items ends with a different .txt file; in this case it's "stim1.txt"? for the first fill in the blank item, "stim2.txt"? for the second fill in the blank item, and so on. Change these pathways to reflect the location on your computer for the stim folder in the Marguerite_DRT folder for the Direct RT files. The easiest way to do this is to find the stim folder, right click it, select "Properties"? and just copy the pathway name in the "Location"? field of the Properties Window. Just paste it in the File Name field and make sure that you type \stim1.txt for the first fill in the blank item, \stim2.text for the second fill in the blank item, and so on. Doing this will make MediaLab record whatever is typed in the box of each fill in the blank item in a separate .txt file in the stim folder. I know it’s not what you originally asked for, but doing it this way prevents any of the fill in the blank items from not being recorded for DirectRT to present.

    You will also notice that the fifth row is of the DirectRT item type with the File Name field containing the full pathway to where to find the Marguerite_ex.csv file (we'll look at this in a second). This will make DirectRT activate right after the last fill in the blank item.

    Now open the Marguerite_ex.csv file I uploaded. You will want to save this file in the Marguerite_DRT folder at the same level as the stim folder. Look at the stim column of the .csv file. Following the instructions from in the Tips and Notes > Miscellaneous Features > Using Responses from MediaLab as Stimuli in DirectRT section of the DirectRT Interactive Users Guide that comes with the Help file of the DirectRT software, you need to type & followed by the name of the .txt file where the answers to the fill in the blank questions were saved. This is why you see &stim1, &stim2, &stim3, and &stim4 It works best when you save them as separate text files in the stim folder that contains the DirectRT input file.

    Now look at the wgr column of the Marguerite_ex.csv file. By putting all 1s in this column, DirectRT will randomly present whatever was typed for the fill in the blank items in MediaLab. You can confirm this by looking at the four log files that I attached. The Stim column shows that I typed four different sets of responses for four different participant numbers, but the Order column shows that they were presented in a randomized order different from the order in which they were entered in MediaLab. You can also see that these stimuli were the fill in the blank answers in the marguerite_ex_MediaLab.csv file.

    To run all of this after you put the Marguerite_ex.que and Marguerite_ex.exp files in the Marguerite_ML folder and the Marguerite_ex.csv file in the Marguerite_DRT folder, just run the Marguerite_ex.que file in MediaLab. I know that this is a long answer, but I hope that this is what you were looking for in your original post. Please let me know if you have any questions.

    Cheers!

    Psychboiler
    Attached Files Attached Files
    Last edited by jason_reed; 09-02-2014 at 05:05 PM.

  2. #2
    Join Date
    Aug 2012
    Posts
    4
    Hi Psychboiler,

    Thank you again for your insight and assistance. The solution you've provided me with has given me a lot to think about with regards to the build of my program.

    I was wondering if there is a way in which to pull up the stim from a single file instead of relying on "&stim1", "&stim2", "&stim3"..and so on. I'm thinking that rather than saving participant responses without overwrite across subjects I would rather just save multiple responses for 1 subject in a file that can be called up for stimuli, and then whether or not those responses are overwritten by a subsequent participant is of secondary concern.

    Is there a way for DirectRT to call up a text file which in turn references another set of text files which contain stimuli?

    so for example DirectRT would call up "stim.txt" which in turn contains reference to draw upon the responses contained in "stim1.txt" "stim2.txt"... I believe timdritchie was pointing me in this direction, but when I include a path to another text file DirectRT seems to think I'm referring to a .bmp file.

    I apologize for not realizing that I was unclear in what I was asking for sooner.

    Many thanks again!

  3. #3
    Join Date
    Aug 2012
    Posts
    75
    Marguerite,

    I think Tim's suggestion would work best if you have a script or other program (or the time to do it manually) that would extract the responses and reformat them in the manner of:

    ~word1
    ~word2
    ~word3

    MediaLab will not create a single file like that automatically. If you are willing to use the multiple file approach, then Psychboiler's approach ought to do it. I do think tho that adding an option to APPEND these responses to the same file make a great deal of sense. Will add that to the to-do list.

  4. #4
    Join Date
    Aug 2012
    Posts
    4
    Thanks! I got it working!

  5. #5
    Join Date
    Feb 2013
    Posts
    1,093
    Hi Margurite,

    That's great to hear! Let us know if there is anything else that we can do.

    Cheers.

    Jason (formerly Psychboiler).

Similar Threads

  1. Assigning multiple styles to a .txt file
    By gh0strider18 in forum DirectRT Older Versions: How Do I...
    Replies: 0
    Last Post: 08-11-2011, 01:36 PM
  2. Why is this .txt file not working?
    By Prosody in forum MediaLab Older Versions: Troubleshooting
    Replies: 0
    Last Post: 11-13-2009, 01:50 PM
  3. Saving data in case of crash?
    By David McFarlane in forum DirectRT Older Versions: General Questions
    Replies: 3
    Last Post: 09-03-2008, 11:01 AM
  4. Saving calculated variables from responses.xls in data files?
    By jarvis24 in forum MediaLab Older Versions: How Do I...
    Replies: 1
    Last Post: 05-27-2008, 07:28 AM
  5. Ignoring the incorrect.txt file for certain trials?
    By jarvis24 in forum DirectRT Older Versions: Troubleshooting
    Replies: 1
    Last Post: 08-23-2006, 10:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •