Stimulus File

stimFile.json

 

The stimFile is a list that contains the specifications for each stimulus that is presented in the QCP.  Each potential trial in the stimfile is a “scenario” list. The “scenario” is composed of a series of frames.  Each frame is presented to the observer successively, from frame [1] to frame [n], where n is the number of frames in the scenario.  Importantly, because the blank time between each frame can be “0,” the successive frames provide a very flexible presentation structure.  Indeed, with careful creation, successive frames can even display animation.  Each Frame contains a “stimulus.”  The stimulus is described using html code.  Therefore, again, the contents of the frame is very flexible – as long as one knows how to write html code.  The scenario list is described below:

 

The stimFile starts with the statement:

var scenario =

The remaining stimFile is a json list:

  • [number] : This is the scenario number.  Because this is a list, this runs from 1 to N, where N is the total number of scenarios.
    • “frame” : This is the name of the list containing the successive frames to be presented in the trial.
      • [number] :  This is the frame number, this runs from 1 to N, where N is the total number of frames in this scenario.
        • trialType = key or textbox.
          • key = a response using a single key press from the keyboard
          • textbox = a textbox input field. The trialType is specified as a “textbox,” the stimulus field on this frame must contain a textbox input field specified in html.  The fields for the html textbox MUST contain:
            • <label id = TIN for="Text_In">
            • <input id ="Text_In" …>
          • frameName = a string containing the name you want to call the frame (e.g., “fixation” or “mask” or “test” or whatever described the frame well). frameName will be output in the datafile.
          • stimulus = this is the stimulus, specified in html code. It can be relatively complicated or easy
          • stimulus_duration = an integer specifying the time in milliseconds that this frame will be presented for.
          • post_trial_gap = an integer specifying the time in milliseconds that the sceen will be blank following this frame. If it is “0,” then the next frame will follow immediately after this frame.
          • choices = a vector of letters, or keyCodes that specifies the allowable keys to be accepted as a response. If “choices” is NULL, then all keys are allowed.  “choices” should be NULL if trialType = textbox.  choices does not control the keys that can be pressed to input a value into the textbox.  That is controlled by the html input code used to create the textbox.
          • background = this is an RGB color, specified in hexadecimal, that controls the background color of the frame page.
        • “feedback” is a list that specifies the feeback information for this scenario. This list can be NULL if you do not want the program to save any feedback information in the datafile or present any feedback information to the participant. 
          • showFeedback = TRUE or FALSE
            • TRUE = show the feedback to the participant
            • FALSE = do not show the feedback to the participant
          • “feedbackText_key” is a list that specifies how to link the key response in the trial to the text that is presented to the participant as feedback. There is one entry for each keyMeaning specified in the keymap (which is a list in the dbfile.json
            • [a keyMeaning as specified in the keymap (which is a list in the dbfile.json] = html code that specifies the text to show the participant if they press the key mapped to this keyMeaning.
              • For example:
                • “Yes” : “<span>you are Correct!</span>”
                • “No” : “<span>you are Incorrect!</span>”
              • “feedbackOutput_key” is a list that specifies how to link the key response in the trial to the text that is output in the datafile. This is separate from “feedbackText_key” because it is more elegant to have a short, informative output in the datafile, rather than the long, html code. There is one entry for each keyMeaning specified in the keymap (which is a list in the dbfile.json
                • [a keyMeaning as specified in the keymap (which is a list in the dbfile.json] = a string that specifies the text to output in the datafile if the participant presses the key mapped to this keyMeaning.
                  • For example:
                    • “Yes” : “correct”
                    • “No” : “incorrect”
                  • stimulus_duration = an integer specifying the time in milliseconds that the feedback will be presented for.
                  • post_trial_gap = an integer specifying the time in milliseconds that the sceen will be blank following the feedback.
                  • background = this is an RGB color, specified in hexadecimal, that controls the background color of this page.
                • “outputVariables” is a list of variables and their values to be output in the datafile. This is useful, because the “stimulus” variable will not be output.  So the outputVariables list will specify all the variables/levels to describe this trial that you need for data analysis later. There is one entry for each variable you want output in the datafile
                  • [a string specifying the variable name] = the value you want to give it. It can be anything you want. These are yours.
                    • For example:
                      • probe = “animal”
                      • standard = 1000
                      • condition = “training”
                    • set = a string or integer that specifies a group that is used for stimulus selection. Sets are critical for describing how the stimuli will be selected for the experiment.  Stimulus selection and sets are described in “trialStructure.json”