From ad460e4bc990d6f5d2ad5bee11f13089f0eb7aca Mon Sep 17 00:00:00 2001 From: Becky Gilbert Date: Wed, 22 Sep 2021 23:14:11 -0700 Subject: [PATCH] update all trial/extension type params in md files --- docs/extensions/jspsych-ext-webgazer.md | 6 +- docs/overview/data.md | 8 +- docs/overview/dynamic-parameters.md | 14 +- docs/overview/events.md | 6 +- docs/overview/experiment-options.md | 2 +- docs/overview/extensions.md | 6 +- docs/overview/eye-tracking.md | 40 +++--- docs/overview/fullscreen.md | 8 +- docs/overview/media-preloading.md | 58 ++++---- docs/overview/plugins.md | 28 ++-- docs/overview/progress-bar.md | 8 +- docs/overview/prolific.md | 2 +- docs/overview/style.md | 10 +- docs/overview/timeline.md | 32 ++--- docs/plugins/jspsych-animation.md | 2 +- docs/plugins/jspsych-audio-button-response.md | 4 +- .../jspsych-audio-keyboard-response.md | 4 +- docs/plugins/jspsych-audio-slider-response.md | 4 +- docs/plugins/jspsych-call-function.md | 8 +- .../plugins/jspsych-canvas-button-response.md | 8 +- .../jspsych-canvas-keyboard-response.md | 4 +- .../plugins/jspsych-canvas-slider-response.md | 4 +- docs/plugins/jspsych-categorize-animation.md | 4 +- docs/plugins/jspsych-categorize-html.md | 2 +- docs/plugins/jspsych-categorize-image.md | 4 +- docs/plugins/jspsych-cloze.md | 4 +- docs/plugins/jspsych-external-html.md | 2 +- docs/plugins/jspsych-free-sort.md | 2 +- docs/plugins/jspsych-fullscreen.md | 8 +- docs/plugins/jspsych-html-button-response.md | 3 +- .../plugins/jspsych-html-keyboard-response.md | 4 +- docs/plugins/jspsych-html-slider-response.md | 4 +- docs/plugins/jspsych-iat-html.md | 2 +- docs/plugins/jspsych-iat-image.md | 2 +- docs/plugins/jspsych-image-button-response.md | 4 +- .../jspsych-image-keyboard-response.md | 6 +- docs/plugins/jspsych-image-slider-response.md | 4 +- docs/plugins/jspsych-instructions.md | 9 +- docs/plugins/jspsych-maxdiff.md | 3 +- docs/plugins/jspsych-preload.md | 34 +++-- docs/plugins/jspsych-rdk.md | 9 +- docs/plugins/jspsych-reconstruction.md | 6 +- docs/plugins/jspsych-resize.md | 3 +- docs/plugins/jspsych-same-different-html.md | 3 +- docs/plugins/jspsych-same-different-image.md | 3 +- .../jspsych-serial-reaction-time-mouse.md | 18 +-- docs/plugins/jspsych-serial-reaction-time.md | 22 +-- docs/plugins/jspsych-survey-html-form.md | 5 +- docs/plugins/jspsych-survey-likert.md | 6 +- docs/plugins/jspsych-survey-multi-choice.md | 6 +- docs/plugins/jspsych-survey-multi-select.md | 3 +- docs/plugins/jspsych-survey-text.md | 12 +- docs/plugins/jspsych-video-button-response.md | 3 +- .../jspsych-video-keyboard-response.md | 3 +- docs/plugins/jspsych-video-slider-response.md | 3 +- docs/plugins/jspsych-virtual-chinrest.md | 13 +- docs/plugins/jspsych-visual-search-circle.md | 10 +- docs/plugins/jspsych-vsl-animate-occlusion.md | 3 +- docs/plugins/jspsych-vsl-grid-scene.md | 3 +- docs/reference/jspsych-pluginAPI.md | 8 +- docs/reference/jspsych.md | 20 +-- docs/tutorials/rt-task.md | 128 +++++++++--------- 62 files changed, 356 insertions(+), 301 deletions(-) diff --git a/docs/extensions/jspsych-ext-webgazer.md b/docs/extensions/jspsych-ext-webgazer.md index 433d027e..a521c50b 100644 --- a/docs/extensions/jspsych-ext-webgazer.md +++ b/docs/extensions/jspsych-ext-webgazer.md @@ -11,7 +11,7 @@ Initialization parameters can be set when calling `initJsPsych()` ```js initJsPsych({ extensions: [ - {type: 'webgazer', params: {...}} + {type: jsPsychExtensionWebgazer, params: {...}} ] }) ``` @@ -29,9 +29,9 @@ Trial parameters can be set when adding the extension to a trial object. ```js var trial = { - type: '...', + type: jsPsych..., extensions: [ - {type: 'webgazer', params: {...}} + {type: jsPsychExtensionWebgazer, params: {...}} ] } ``` diff --git a/docs/overview/data.md b/docs/overview/data.md index 47df079e..ec39b23f 100644 --- a/docs/overview/data.md +++ b/docs/overview/data.md @@ -35,7 +35,7 @@ Data can be added to a particular trial by setting the `data` parameter for the ```js var trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'imgA.jpg', data: { image_type: 'A' } } @@ -45,7 +45,7 @@ Data declared in this way is also saved in the trials on any nested timelines: ```js var block = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, data: { image_type: 'A' }, timeline: [ {stimulus: 'imgA1.jpg'}, @@ -58,7 +58,7 @@ The data object for a trial can also be updated in the `on_finish` event handler ```js var trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'imgA.jpg', on_finish: function(data){ if(jsPsych.pluginAPI.compareKeys(data.response, 'j')){ @@ -276,7 +276,7 @@ It's important that the `XMLHttpRequest` is able to complete before the experime ```javascript var trial = { - type: 'call-function', + type: jsPsychCallFunction, async: true, func: function(done){ var xhr = new XMLHttpRequest(); diff --git a/docs/overview/dynamic-parameters.md b/docs/overview/dynamic-parameters.md index 5ba86df5..6aa1d0cf 100644 --- a/docs/overview/dynamic-parameters.md +++ b/docs/overview/dynamic-parameters.md @@ -13,7 +13,7 @@ Here is a sketch of how this functionality could be used to display feedback to var timeline = []; var trial = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: '<<<<<', choices: ['f','j'], data: { @@ -31,7 +31,7 @@ var trial = { } var feedback = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: function(){ // The feedback stimulus is a dynamic parameter because we can't know in advance whether // the stimulus should be 'correct' or 'incorrect'. @@ -61,7 +61,7 @@ var random_duration = function() { } var trial = { - type: 'html-keyboard-response' + type: jsPsychHtmlKeyboardResponse stimulus: '+', post_trial_gap: random_duration // if you use a named function for a dynamic parameter, then just use the function name (without parentheses after it) } @@ -75,7 +75,7 @@ The trial's `data` parameter can be also function, which is useful for when you var current_difficulty; // value changes during the experiment var trial = { - type: 'survey-text', + type: jsPsychSurveyText, questions: [{prompt: "Please enter your response."}] data: function() { return {difficulty: current_difficulty}; @@ -87,7 +87,7 @@ It's also possible to use a function for any of the _individual properties_ in t ```js var trial = { - type: 'survey-text', + type: jsPsychSurveyText, questions: [{prompt: "Please enter your response."}] data: { difficulty: function() { @@ -107,7 +107,7 @@ Dyanmic parameters work the same way with nested parameters, which are parameter var subject_id; // value is set during the experiment var trial = { - type: 'survey-text', + type: jsPsychSurveyText, questions: function(){ var questions_array = [ {prompt: "Hi "+subject_id+"! What's your favorite city?", required: true, name: 'fav_city'}, @@ -122,7 +122,7 @@ You can also use a function for any of the _individual parameters_ inside of a n ```js var trial = { - type: 'survey-text', + type: jsPsychSurveyText, questions: [ { prompt: function() { diff --git a/docs/overview/events.md b/docs/overview/events.md index f4e10756..f8be2c58 100644 --- a/docs/overview/events.md +++ b/docs/overview/events.md @@ -39,7 +39,7 @@ The `on_finish` callback can be added to any trial. The callback will trigger wh ```javascript var trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'imgA.png', on_finish: function(data) { if(jsPsych.pluginAPI.compareKeys(data.response, 'j')){ @@ -73,7 +73,7 @@ The `on_load` callback can be added to any trial. The callback will trigger once ```javascript var trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'imgA.png', on_load: function() { console.log('The trial just finished loading.'); @@ -89,7 +89,7 @@ The `on_start` callback can be added to any trial. The callback will trigger rig ```javascript var trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'imgA.png', on_start: function(trial) { console.log('The trial is about to start.'); diff --git a/docs/overview/experiment-options.md b/docs/overview/experiment-options.md index f8b03784..8e0216f7 100644 --- a/docs/overview/experiment-options.md +++ b/docs/overview/experiment-options.md @@ -135,7 +135,7 @@ Extensions are jsPsych modules that can run throughout the experiment and interf ```js initJsPsych({ extensions: [ - {type: 'webgazer'} + {type: jsPsychExtensionWebgazer} ] }); ``` diff --git a/docs/overview/extensions.md b/docs/overview/extensions.md index 9803e55c..577bd384 100644 --- a/docs/overview/extensions.md +++ b/docs/overview/extensions.md @@ -9,14 +9,14 @@ To use an extension in an experiment, you'll load the extension file via a ` - + ``` ```js initJsPsych({ extensions: [ - {type: 'some-extension', params: {...} } + {type: jsPsychExtensionExample, params: {...} } ] }) ``` @@ -26,7 +26,7 @@ To enable an extension during a trial, add the extension to the `extensions` lis ```js var trial = { extensions: [ - {type: 'some-extension', params: {...} } + {type: jsPsychExtensionExample, params: {...} } ] } ``` diff --git a/docs/overview/eye-tracking.md b/docs/overview/eye-tracking.md index 774d42e1..bb0d83e9 100644 --- a/docs/overview/eye-tracking.md +++ b/docs/overview/eye-tracking.md @@ -37,7 +37,7 @@ To use the WebGazer extension in an experiment, include it in the list of extens ```js initJsPsych({ extensions: [ - {type: 'webgazer'} + {type: jsPsychExtensionWebgazer} ] }) ``` @@ -49,7 +49,7 @@ To help the participant position their face correctly for eye tracking you can u ```js var init_camera_trial = { - type: 'webgazer-init-camera' + type: jsPsychWebgazerInitCamera } ``` @@ -62,7 +62,7 @@ Note that instructions are not included in the calibration plugin, so you'll lik ```js var calibration_trial = { - type: 'webgazer-calibrate', + type: jsPsychWebgazerCalibrate, calibration_points: [[25,50], [50,50], [75,50], [50,25], [50,75]], calibration_mode: 'click' } @@ -76,7 +76,7 @@ To measure the accuracy and precision of the calibration, you can use the [jspsy ```js var validation_trial = { - type: 'webgazer-validate', + type: jsPsychWebgazerValidate, validation_points: [[-200,200], [200,200],[-200,-200],[200,-200]], validation_point_coordinates: 'center-offset-pixels', roi_radius: 100 @@ -102,11 +102,11 @@ To enable eye tracking for a trial in your experiment, you can simply add the We ```js var trial = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: '', extensions: [ { - type: 'webgazer', + type: jsPsychExtensionWebgazer, params: { targets: ['#scene'] } @@ -185,17 +185,17 @@ If you have tips based on your own experience please consider sharing them on ou var jsPsych = initJsPsych({ extensions: [ - {type: 'webgazer'} + {type: jsPsychExtensionWebgazer} ] }); var preload = { - type: 'preload', + type: jsPsychPreload, images: ['img/blue.png'] } var camera_instructions = { - type: 'html-button-response', + type: jsPsychHtmlButtonResponse, stimulus: `

In order to participate you must allow the experiment to use your camera.

You will be prompted to do this on the next screen.

@@ -206,11 +206,11 @@ If you have tips based on your own experience please consider sharing them on ou } var init_camera = { - type: 'webgazer-init-camera' + type: jsPsychWebgazerInitCamera } var calibration_instructions = { - type: 'html-button-response', + type: jsPsychHtmlButtonResponse, stimulus: `

Now you'll calibrate the eye tracking, so that the software can use the image of your eyes to predict where you are looking.

You'll see a series of dots appear on the screen. Look at each dot and click on it.

@@ -219,7 +219,7 @@ If you have tips based on your own experience please consider sharing them on ou } var calibration = { - type: 'webgazer-calibrate', + type: jsPsychWebgazerCalibrate, calibration_points: [ [25,25],[75,25],[50,50],[25,75],[75,75] ], @@ -228,7 +228,7 @@ If you have tips based on your own experience please consider sharing them on ou } var validation_instructions = { - type: 'html-button-response', + type: jsPsychHtmlButtonResponse, stimulus: `

Now we'll measure the accuracy of the calibration.

Look at each dot as it appears on the screen.

@@ -239,7 +239,7 @@ If you have tips based on your own experience please consider sharing them on ou } var validation = { - type: 'webgazer-validate', + type: jsPsychWebgazerValidate, validation_points: [ [25,25],[75,25],[50,50],[25,75],[75,75] ], @@ -252,7 +252,7 @@ If you have tips based on your own experience please consider sharing them on ou } var recalibrate_instructions = { - type: 'html-button-response', + type: jsPsychHtmlButtonResponse, stimulus: `

The accuracy of the calibration is a little lower than we'd like.

Let's try calibrating one more time.

@@ -276,7 +276,7 @@ If you have tips based on your own experience please consider sharing them on ou } var calibration_done = { - type: 'html-button-response', + type: jsPsychHtmlButtonResponse, stimulus: `

Great, we're done with calibration!

`, @@ -284,7 +284,7 @@ If you have tips based on your own experience please consider sharing them on ou } var begin = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: `

The next screen will show an image to demonstrate adding the webgazer extension to a trial.

Just look at the image while eye tracking data is collected. The trial will end automatically.

Press any key to start.

@@ -292,20 +292,20 @@ If you have tips based on your own experience please consider sharing them on ou } var trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'img/blue.png', choices: jsPsych.NO_KEYS, trial_duration: 2000, extensions: [ { - type: 'webgazer', + type: jsPsychExtensionWebgazer, params: {targets: ['#jspsych-image-keyboard-response-stimulus']} } ] } var show_data = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: function() { var trial_data = jsPsych.data.getLastTrialData().values(); var trial_json = JSON.stringify(trial_data, null, 2); diff --git a/docs/overview/fullscreen.md b/docs/overview/fullscreen.md index 8ce118e7..eaa73eb1 100644 --- a/docs/overview/fullscreen.md +++ b/docs/overview/fullscreen.md @@ -8,23 +8,23 @@ var jsPsych = initJsPsych(); var timeline = []; timeline.push({ - type: 'fullscreen', + type: jsPsychFullscreen, fullscreen_mode: true }); timeline.push({ - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: 'This trial will be in fullscreen mode.' }); // exit fullscreen mode timeline.push({ - type: 'fullscreen', + type: jsPsychFullscreen, fullscreen_mode: false }); timeline.push({ - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: 'This trial will NOT be in fullscreen mode.' }); diff --git a/docs/overview/media-preloading.md b/docs/overview/media-preloading.md index 287b814d..9cf1096d 100644 --- a/docs/overview/media-preloading.md +++ b/docs/overview/media-preloading.md @@ -13,26 +13,26 @@ jsPsych can automatically preload audio, video, and image files that are used as // the "auto_preload: true" setting tells the plugin to automatically find // stimuli to preload based the main experiment timeline (used in jsPsych.run) var preload = { - type: 'preload', + type: jsPsychPreload, auto_preload: true } // this image file can be automatically preloaded var image_trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'img/file1.png' } // the sound file can be automatically preloaded var sound_trial = { - type: 'audio-keyboard-response', + type: jsPsychAudioKeyboardResponse, stimulus: 'audio/hello.mp3' } // the video file can be automatically preloaded (as long as the experiment // is running on a server) var video_trial = { - type: 'video', + type: jsPsychVideoKeyboardResponse, stimulus: ['video/sample_video.mp4'] } @@ -47,14 +47,14 @@ If you are using media files in your experiment but they are not being passed di // this image file cannot be automatically preloaded because it is embedded in // an HTML string var image_trial = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: '', } // this audio file cannot be automatically preloaded because it is returned // from a function var sound_trial = { - type: 'audio-keyboard-response', + type: jsPsychAudioKeyboardResponse, stimulus: function() { return 'audio/sound1.mp3' } } @@ -63,7 +63,7 @@ var sound_trial = { var video_trials = { timeline: [ { - type: 'video', + type: jsPsychVideoKeyboardResponse, stimulus: jsPsych.timelineVariable('video') } ], @@ -82,7 +82,7 @@ var video = ['video/1.mp4', 'video/2.mp4']; // these array can be passed into the preload plugin using the images, audio // and video parameters var preload = { - type: 'preload', + type: jsPsychPreload, images: images, audio: audio, video: video @@ -99,13 +99,13 @@ It's possible to combine automatic and manual preloading. For instance, you may ```javascript // this file can be preloaded automatically var image_trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'img/file1.png' } // this file can be preloaded automatically var sound_trial = { - type: 'audio-keyboard-response', + type: jsPsychAudioKeyboardResponse, stimulus: 'audio/hello.mp3' } @@ -113,7 +113,7 @@ var sound_trial = { var video_trials = { timeline: [ { - type: 'video', + type: jsPsychVideoKeyboardResponse, stimulus: jsPsych.timelineVariable('video') } ], @@ -126,7 +126,7 @@ var video_trials = { var video = ['video/1.mp4', 'video/2.mp4']; var preload = { - type: 'preload', + type: jsPsychPreload, auto_preload: true, // automatically preload the image and audio files video: video // manually preload the videos used with timeline variables } @@ -146,11 +146,11 @@ Here is an example with trials where the stimuli files can be preloaded automati var block_1 = { timeline: [ { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'img/file1.png' }, { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'img/file2.png' } ] @@ -159,23 +159,23 @@ var block_1 = { var block_2 = { timeline: [ { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'img/file3.png' }, { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'img/file4.png' } ] } var preload_1 = { - type: 'preload', + type: jsPsychPreload, trials: block_1 // automatically preload just the images from block_1 trials } var preload_2 = { - type: 'preload', + type: jsPsychPreload, trials: block_2 // automatically preload just the images from block_2 trials } @@ -211,13 +211,13 @@ var images_block_2 = ['file3.png', 'file4.png']; // preload trial for preloading the block 1 stimuli var preload_1 = { - type: 'preload', + type: jsPsychPreload, images: images_block_1 } // preload trial for preloading the block 2 stimuli var preload_2 = { - type: 'preload', + type: jsPsychPreload, images: images_block_2 } @@ -234,7 +234,7 @@ By default, the `preload` plugin will display a progress bar while files are bei ```javascript var preload_trial = { - type: 'preload', + type: jsPsychPreload, auto_preload: true show_progress_bar: false // hide progress bar } @@ -246,7 +246,7 @@ It's usually a good idea to set a time limit for file loading, to ensure that pa ```javascript var preload_trial = { - type: 'preload', + type: jsPsychPreload, auto_preload: true max_load_time: 60000 // 1 minute } @@ -258,7 +258,7 @@ It's possible to specify custom messages to be shown on the page while the media ```javascript var preload_trial = { - type: 'preload', + type: jsPsychPreload, auto_preload: true message: 'Please wait while the experiment loads. This may take a few minutes.', } @@ -268,7 +268,7 @@ A preloading error will occur when either (a) one or more files produces a loadi ```javascript var preload_trial = { - type: 'preload', + type: jsPsychPreload, auto_preload: true, error_message: 'The experiment failed to load. Please contact the researcher.' } @@ -280,7 +280,7 @@ Detailed error messages can be useful when testing and debugging your experiment ```javascript var preload_trial = { - type: 'preload', + type: jsPsychPreload, auto_preload: true, // show details of any file loading errors and/or loading time out show_detailed_errors: true @@ -293,7 +293,7 @@ If `continue_after_error` is `true`, then the experiment _will not stop_ if one ```javascript var preload_trial = { - type: 'preload', + type: jsPsychPreload, auto_preload: true, message: 'Please wait while the experiment loads...', // don't stop the experiment if there are file loading errors or if loading times out @@ -301,7 +301,7 @@ var preload_trial = { } var save_data = { - type: 'call-function', + type: jsPsychCallFunction, async: true, func: function(done){ var data = jsPsych.data.get().json(); @@ -311,7 +311,7 @@ var save_data = { // the experiment will stop here, since there are no valid key choices or trial duration var fail_message = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: 'The experiment failed to load. Please contact the researcher.', choices: jsPsych.NO_KEYS, trial_duration: null @@ -345,7 +345,7 @@ var file_load_count = 0; var file_error_count = 0; var preload_trial = { - type: 'preload', + type: jsPsychPreload, auto_preload: true, on_error: function(file) { file_error_count++; diff --git a/docs/overview/plugins.md b/docs/overview/plugins.md index 701c223d..5a944fcd 100644 --- a/docs/overview/plugins.md +++ b/docs/overview/plugins.md @@ -15,13 +15,19 @@ To use a plugin, you'll need to load the plugin's JavaScript file in your experi ``` -Once a plugin is loaded, you can use JavaScript to define a trial that uses that plugin. All jsPsych trials have a `type`, which tells jsPsych what plugin to use to run the trial. The trial's `type` is the plugin name, which usually the same as the plugin file name, but with the "jspsych-" prefix removed. +Once a plugin is loaded, you can use JavaScript to define a trial that uses that plugin. All jsPsych trials need a `type` parameter, which tells jsPsych what plugin to use to run the trial. The trial's `type` is similar to the plugin name, but it always starts with "jsPsych" and is written in _camel case_ rather than with dashes between the words. The trial's `type` parameter should NOT be a string (i.e. no quotes around the `type` value). Here are some examples of plugin names and types: + +| Plugin name | Type | +| ---------------------------- | ---------------------------- | +| image-keyboard-response | jsPsychImageKeyboardResponse | +| fullscreen | jsPsychFullscreen | +| webgazer-init-camera | jsPsychWebgazerInitCamera | The following JavaScript code defines a trial using the `image-keyboard-response` plugin to display an image file. This trial uses the default values for valid keys, stimulus duration, trial duration, and other parameters. ```javascript var image_trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'images/happy_face.jpg' } ``` @@ -30,7 +36,7 @@ You can override any default parameter values by adding them into your trial obj ```javascript var image_trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'images/happy_face.jpg', trial_duration: 3000, post_trial_gap: 2000 @@ -63,7 +69,7 @@ A trial for the Flanker Task written with jsPsych might look like this: ```javascript var trial = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: '<<<<<', choices: ['f','j'], data: { @@ -83,7 +89,7 @@ The ITI can also be controlled at the trial level through the `post_trial_gap` p ```javascript var trial = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: 'There will be a 1.5 second blank screen after this trial.', post_trial_gap: 1500 } @@ -97,7 +103,7 @@ Immediately before a trial runs, there is an opportunity to run an arbitrary fun // when this trial runs, the on_start function will change the trial's stimulus and data parameters, // so the trial will display an incongruent Flanker stimulus with a right-facing central arrow var trial = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: '<<<<<', choices: ['f','j'], data: { @@ -124,7 +130,7 @@ The `on_finish` function can be useful to calculate new data properties that wer // which is either 'true' or 'false' // depending on the response that was made var trial = { - type: 'html-keyboard-response', + type: jsPsychHtmlKeyboardResponse, stimulus: '<<<<<', choices: ['f','j'], data: { @@ -148,7 +154,7 @@ The `on_load` callback function will trigger once the trial has completed loadin ```javascript var trial = { - type: 'image-keyboard-response', + type: jsPsychImageKeyboardResponse, stimulus: 'imgA.png', on_load: function() { // this will change the src attribute of the image after 500ms @@ -177,13 +183,13 @@ The `css_classes` parameter allows you to add an array of CSS class names to the