From c315869c03d1a78bb1c84ff33915c2c0e3e60267 Mon Sep 17 00:00:00 2001 From: keshavpabbi Date: Wed, 30 Jun 2021 10:51:30 -0400 Subject: [PATCH 01/12] updated visual search plugin --- ...rch-circle.js => jspsych-visual-search.js} | 109 +++++++++++++++--- 1 file changed, 91 insertions(+), 18 deletions(-) rename plugins/{jspsych-visual-search-circle.js => jspsych-visual-search.js} (66%) diff --git a/plugins/jspsych-visual-search-circle.js b/plugins/jspsych-visual-search.js similarity index 66% rename from plugins/jspsych-visual-search-circle.js rename to plugins/jspsych-visual-search.js index 85cf5d18b9..7d7d963d06 100644 --- a/plugins/jspsych-visual-search-circle.js +++ b/plugins/jspsych-visual-search.js @@ -1,6 +1,6 @@ /** * - * jspsych-visual-search-circle + * jspsych-visual-search * Josh de Leeuw * * display a set of objects, with or without a target, equidistant from fixation @@ -12,18 +12,30 @@ * **/ -jsPsych.plugins["visual-search-circle"] = (function() { +jsPsych.plugins["visual-search"] = (function() { var plugin = {}; - jsPsych.pluginAPI.registerPreload('visual-search-circle', 'target', 'image'); - jsPsych.pluginAPI.registerPreload('visual-search-circle', 'foil', 'image'); - jsPsych.pluginAPI.registerPreload('visual-search-circle', 'fixation_image', 'image'); + jsPsych.pluginAPI.registerPreload('visual-search', 'target', 'image'); + jsPsych.pluginAPI.registerPreload('visual-search', 'foil', 'image'); + jsPsych.pluginAPI.registerPreload('visual-search', 'fixation_image', 'image'); plugin.info = { - name: 'visual-search-circle', + name: 'visual-search', description: '', parameters: { + usegrid: { + type: jsPsych.plugins.parameterType.BOOL, + pretty_name: 'Use grid', + default: false, + description: 'Place items on a grid?' + }, + jitter_ratio: { + type: jsPsych.plugins.parameterType.FLOAT, + pretty_name: 'jitter', + default: 0.0, + description: 'The distance to jitter the image as ratio of image size (average of x and y).' + }, target: { type: jsPsych.plugins.parameterType.IMAGE, pretty_name: 'Target', @@ -71,7 +83,7 @@ jsPsych.plugins["visual-search-circle"] = (function() { circle_diameter: { type: jsPsych.plugins.parameterType.INT, pretty_name: 'Circle diameter', - default: 250, + default: 500, description: 'The diameter of the search array circle in pixels.' }, target_present_key: { @@ -111,26 +123,67 @@ jsPsych.plugins["visual-search-circle"] = (function() { // stimuli width, height var stimh = trial.target_size[0]; var stimw = trial.target_size[1]; + const jitter = ((stimh + stimw) / 2) * trial.jitter_ratio var hstimh = stimh / 2; var hstimw = stimw / 2; // fixation location var fix_loc = [Math.floor(paper_size / 2 - trial.fixation_size[0] / 2), Math.floor(paper_size / 2 - trial.fixation_size[1] / 2)]; + + var possible_display_locs = trial.set_size; + + let display_locs = []; + + if (trial.usegrid) { + + const num_pos = Math.ceil(Math.sqrt(possible_display_locs)) + //square root the number of possible display locations + + const step = 2 / (num_pos - 1) + //distance between each location + console.log(step, num_pos) + + let full_locs = [] + for (let x = -1; x <= 1; x+=step) { + //x is between -1 and 1, increase by value of step each time + for (let y = -1; y <= 1; y+=step) { + //y is between -1 and 1, increase by value of step each time + full_locs.push([ + Math.floor(paper_size / 2 + (x * radi) - hstimw), + //x coord + Math.floor(paper_size / 2 + (y * radi) - hstimh) + //y coord + ]); + } + } + + full_locs = shuffle(full_locs) + display_locs = full_locs.slice(0, possible_display_locs); - // possible stimulus locations on the circle - var display_locs = []; - var possible_display_locs = trial.set_size; - var random_offset = Math.floor(Math.random() * 360); - for (var i = 0; i < possible_display_locs; i++) { - display_locs.push([ - Math.floor(paper_size / 2 + (cosd(random_offset + (i * (360 / possible_display_locs))) * radi) - hstimw), - Math.floor(paper_size / 2 - (sind(random_offset + (i * (360 / possible_display_locs))) * radi) - hstimh) - ]); + for (let i=0; i < display_locs.length; i++) { + let random_angle = Math.floor(Math.random() * 360); + let rand_x = Math.floor(cosd(random_angle) * jitter) + let rand_y = Math.floor(sind(random_angle) * jitter) + display_locs[i][0] += rand_x + display_locs[i][1] += rand_y + } + + } else { + + // possible stimulus locations on the circle + var random_offset = Math.floor(Math.random() * 360); + for (var i = 0; i < possible_display_locs; i++) { + let vec_jitter = Math.sign(Math.random() * 2 - 1) * jitter + display_locs.push([ + Math.floor(paper_size / 2 + (cosd(random_offset + (i * (360 / possible_display_locs))) * (radi + vec_jitter)) - hstimw), + Math.floor(paper_size / 2 - (sind(random_offset + (i * (360 / possible_display_locs))) * (radi + vec_jitter)) - hstimh) + ]); + } } // get target to draw on - display_element.innerHTML += '
'; - var paper = display_element.querySelector("#jspsych-visual-search-circle-container"); + display_element.innerHTML += '
'; + var paper = display_element.querySelector("#jspsych-visual-search-container"); // check distractors - array? if(!Array.isArray(trial.foil)){ @@ -152,6 +205,7 @@ jsPsych.plugins["visual-search-circle"] = (function() { jsPsych.pluginAPI.setTimeout(function() { // after wait is over show_search_array(); + paper.innerHTML += ""; }, trial.fixation_duration); } @@ -255,5 +309,24 @@ jsPsych.plugins["visual-search-circle"] = (function() { return Math.sin(num / 180 * Math.PI); } + // shuffle any input array + function shuffle(array) { + // define three variables + let cur_idx = array.length, tmp_val, rand_idx; + + // While there remain elements to shuffle... + while (0 !== cur_idx) { + // Pick a remaining element... + rand_idx = Math.floor(Math.random() * cur_idx); + cur_idx -= 1; + + // And swap it with the current element. + tmp_val = array[cur_idx]; + array[cur_idx] = array[rand_idx]; + array[rand_idx] = tmp_val; + } + return array; + } + return plugin; })(); From caacd5e6eafa2264a76929b3f72b8964e9b71cb2 Mon Sep 17 00:00:00 2001 From: keshavpabbi Date: Wed, 30 Jun 2021 10:53:12 -0400 Subject: [PATCH 02/12] added example file --- contributors.md | 1 + ...circle.html => jspsych-visual-search.html} | 25 +++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) rename examples/{jspsych-visual-search-circle.html => jspsych-visual-search.html} (66%) diff --git a/contributors.md b/contributors.md index fe53d59517..57d6719bef 100644 --- a/contributors.md +++ b/contributors.md @@ -38,6 +38,7 @@ The following people have contributed to the development of jsPsych by writing c * Vijay Marupudi - https://github.com/vijaymarupudi * Adrian Oesch - https://github.com/adrianoesch * Benjamin Ooghe-Tabanou - https://github.com/boogheta +* Keshav Pabbi - https://github.com/keshavpabbi * Nikolay B Petrov - https://github.com/nikbpetrov * Dillon Plunkett - https://github.com/dillonplunkett * Junyan Qi - https://github.com/GavinQ1 diff --git a/examples/jspsych-visual-search-circle.html b/examples/jspsych-visual-search.html similarity index 66% rename from examples/jspsych-visual-search-circle.html rename to examples/jspsych-visual-search.html index b5af50e210..af51911fef 100644 --- a/examples/jspsych-visual-search-circle.html +++ b/examples/jspsych-visual-search.html @@ -6,7 +6,7 @@ - + @@ -44,17 +44,32 @@ set_size: 3 } + var trial_5 = { + usegrid: true, + target_present: false, + foil: ['img/1.gif', 'img/2.gif', 'img/3.gif'], // example of using multiple foils. + set_size: 3 + } + + var trials_circle = { + type: 'visual-search', + target: 'img/backwardN.gif', + foil: 'img/normalN.gif', + fixation_image: 'img/fixation.gif', + timeline: [trial_1, trial_2, trial_3, trial_4, trial_5] + }; - var trials = { - type: 'visual-search-circle', + var trials_grid = { + usegrid: true, + type: 'visual-search', target: 'img/backwardN.gif', foil: 'img/normalN.gif', fixation_image: 'img/fixation.gif', - timeline: [trial_1, trial_2, trial_3, trial_4] + timeline: [trial_1, trial_2, trial_3, trial_4, trial_5] }; jsPsych.init({ - timeline: [preload_images, intro, trials], + timeline: [preload_images, intro, trials_circle, trials_grid], on_finish: function() { jsPsych.data.displayData(); } From 31747d87f0c6e35b970b649eec19e4aa240f2eee Mon Sep 17 00:00:00 2001 From: keshavpabbi Date: Fri, 2 Jul 2021 20:49:34 -0400 Subject: [PATCH 03/12] renamed visual search md file --- .../{jspsych-visual-search-circle.md => jspsych-visual-search.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/plugins/{jspsych-visual-search-circle.md => jspsych-visual-search.md} (100%) diff --git a/docs/plugins/jspsych-visual-search-circle.md b/docs/plugins/jspsych-visual-search.md similarity index 100% rename from docs/plugins/jspsych-visual-search-circle.md rename to docs/plugins/jspsych-visual-search.md From b1d5c70aa0c982769f55ff3713508f9b55bb6110 Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 20:55:10 -0400 Subject: [PATCH 04/12] Update jspsych-visual-search.md --- docs/plugins/jspsych-visual-search.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins/jspsych-visual-search.md b/docs/plugins/jspsych-visual-search.md index bb71ee6925..cc3f29a7c0 100644 --- a/docs/plugins/jspsych-visual-search.md +++ b/docs/plugins/jspsych-visual-search.md @@ -1,6 +1,6 @@ -# jspsych-visual-search-circle plugin +# jspsych-visual-search plugin -This plugin presents a customizable visual-search task modelled after [Wang, Cavanagh, & Green (1994)](http://dx.doi.org/10.3758/BF03206946). The subject indicates whether or not a target is present among a set of distractors. The stimuli are displayed in a circle, evenly-spaced, equidistant from a fixation point. Here is an example using normal and backward Ns: +This plugin presents a customizable visual-search task modelled after Treisman and Gelade (1980). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. Here is an example using normal and backward Ns: ![Sample Visual Search Stimulus](/img/visual_search_example.jpg) From fba88c3858b4c42f65c76021e14516f04d87011a Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:02:17 -0400 Subject: [PATCH 05/12] Update list-of-plugins.md changed the name of visual-search-circle to visual-search and changed the description to show new code added to the plugin --- docs/plugins/list-of-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/list-of-plugins.md b/docs/plugins/list-of-plugins.md index 4259eeedd6..e32afd9a91 100644 --- a/docs/plugins/list-of-plugins.md +++ b/docs/plugins/list-of-plugins.md @@ -46,7 +46,7 @@ Plugin | Description [jspsych‑video‑keyboard‑response](/plugins/jspsych-video-keyboard-response) | Displays a video file with many options for customizing playback. Subject responds to the video by pressing a key. [jspsych‑video‑slider‑response](/plugins/jspsych-video-slider-response) | Displays a video file with many options for customizing playback. Subject responds to the video by moving a slider. [jspsych‑virtual‑chinrest](/plugins/jspsych-virtual-chinrest) | An implementation of the "virutal chinrest" procedure developed by [Li, Joo, Yeatman, and Reinecke (2020)](https://doi.org/10.1038/s41598-019-57204-1). Calibrates the monitor to display items at a known physical size by having participants scale an image to be the same size as a physical credit card. Then uses a blind spot task to estimate the distance between the participant and the display. -[jspsych‑visual‑search‑circle](/plugins/jspsych-visual-search-circle) | A customizable visual-search task modelled after [Wang, Cavanagh, & Green (1994)](http://dx.doi.org/10.3758/BF03206946). The subject indicates whether or not a target is present among a set of distractors. The stimuli are displayed in a circle, evenly-spaced, equidistant from a fixation point. +[jspsych‑visual‑search‑circle](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after Treisman and Gelade (1980). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. [jspsych‑vsl‑animate‑occlusion](/plugins/jspsych-vsl-animate-occlusion) | A visual statistical learning paradigm based on [Fiser & Aslin (2002)](http://dx.doi.org/10.1037//0278-7393.28.3.458). A sequence of stimuli are shown in an oscillatory motion. An occluding rectangle is in the center of the display, and the stimuli change when they are behind the rectangle. [jspsych‑vsl‑grid‑scene](/plugins/jspsych-vsl-grid-scene) | A visual statistical learning paradigm based on [Fiser & Aslin (2001)](http://dx.doi.org/10.1111/1467-9280.00392). A scene made up of individual stimuli arranged in a grid is shown. This plugin can also generate the HTML code to render the stimuli for use in other plugins. [jspsych‑webgazer‑calibrate](/plugins/jspsych-webgazer-calibrate) | Calibrates the WebGazer extension for eye tracking. From 1fc1cfc7e82e0f82e43fad55c73ca0352bd732d0 Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:06:18 -0400 Subject: [PATCH 06/12] Update list-of-plugins.md --- docs/plugins/list-of-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/list-of-plugins.md b/docs/plugins/list-of-plugins.md index e32afd9a91..e767f51398 100644 --- a/docs/plugins/list-of-plugins.md +++ b/docs/plugins/list-of-plugins.md @@ -46,7 +46,7 @@ Plugin | Description [jspsych‑video‑keyboard‑response](/plugins/jspsych-video-keyboard-response) | Displays a video file with many options for customizing playback. Subject responds to the video by pressing a key. [jspsych‑video‑slider‑response](/plugins/jspsych-video-slider-response) | Displays a video file with many options for customizing playback. Subject responds to the video by moving a slider. [jspsych‑virtual‑chinrest](/plugins/jspsych-virtual-chinrest) | An implementation of the "virutal chinrest" procedure developed by [Li, Joo, Yeatman, and Reinecke (2020)](https://doi.org/10.1038/s41598-019-57204-1). Calibrates the monitor to display items at a known physical size by having participants scale an image to be the same size as a physical credit card. Then uses a blind spot task to estimate the distance between the participant and the display. -[jspsych‑visual‑search‑circle](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after Treisman and Gelade (1980). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. +[jspsych‑visual‑search‑circle](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. [jspsych‑vsl‑animate‑occlusion](/plugins/jspsych-vsl-animate-occlusion) | A visual statistical learning paradigm based on [Fiser & Aslin (2002)](http://dx.doi.org/10.1037//0278-7393.28.3.458). A sequence of stimuli are shown in an oscillatory motion. An occluding rectangle is in the center of the display, and the stimuli change when they are behind the rectangle. [jspsych‑vsl‑grid‑scene](/plugins/jspsych-vsl-grid-scene) | A visual statistical learning paradigm based on [Fiser & Aslin (2001)](http://dx.doi.org/10.1111/1467-9280.00392). A scene made up of individual stimuli arranged in a grid is shown. This plugin can also generate the HTML code to render the stimuli for use in other plugins. [jspsych‑webgazer‑calibrate](/plugins/jspsych-webgazer-calibrate) | Calibrates the WebGazer extension for eye tracking. From 1a3a06a9b80b811110434f6ef3a17443afe95e43 Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:20:28 -0400 Subject: [PATCH 07/12] Update jspsych-visual-search.md --- docs/plugins/jspsych-visual-search.md | 35 +++++++++++++++++++-------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/docs/plugins/jspsych-visual-search.md b/docs/plugins/jspsych-visual-search.md index cc3f29a7c0..6bb85d47a2 100644 --- a/docs/plugins/jspsych-visual-search.md +++ b/docs/plugins/jspsych-visual-search.md @@ -1,8 +1,6 @@ # jspsych-visual-search plugin -This plugin presents a customizable visual-search task modelled after Treisman and Gelade (1980). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. Here is an example using normal and backward Ns: - -![Sample Visual Search Stimulus](/img/visual_search_example.jpg) +This plugin presents a customizable visual-search task modelled after Treisman and Gelade (1980). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size ## Parameters @@ -17,11 +15,13 @@ In addition to the [parameters available in all plugins](/overview/plugins#param | fixation_image | string | *undefined* | Path to image file that is a fixation target. | | target_size | array | `[50, 50]` | Two element array indicating the height and width of the search array element images. | | fixation_size | array | `[16, 16]` | Two element array indicating the height and width of the fixation image. | -| circle_diameter | numeric | 250 | The diameter of the search array circle in pixels. | +| circle_diameter | numeric | 500 | The diameter of the search array circle in pixels. | | target_present_key | string | 'j' | The key to press if the target is present in the search array. | | target_absent_key | string | 'f' | The key to press if the target is not present in the search array. | | trial_duration | numeric | null | The maximum amount of time the subject is allowed to search before the trial will continue. A value of null will allow the subject to search indefinitely. | | fixation_duration | numeric | 1000 | How long to show the fixation image for before the search array (in milliseconds). | +| usegrid | boolean | false | Are we using a grid for the visual search task? | +| jitter_ratio | numeric | 0.0 | The distance to jitter the image as ratio of image size (average of x and y). | ## Data Generated @@ -36,17 +36,32 @@ In addition to the [default data collected by all plugins](/overview/plugins#dat | target_present | boolean | True if the target is present in the search array | | locations | array | Array where each element is the pixel value of the center of an image in the search array. If the target is present, then the first element will represent the location of the target. This will be encoded as a JSON string when data is saved using the `.json()` or `.csv()` functions. | -## Example +## Examples + +#### Search for the green T in the grid, no jitter + +```javascript +var trial_1 = { + type: 'visual-search', + target: 'img/greenT.png', + foil: 'img/greenL.png', + fixation_image: 'img/fixation.png', + target_present: true, + set_size: 4 + usegrid: true +} +``` -#### Search for the backward N +#### Search for the green T in the circle, jitter ```javascript var trial_1 = { - type: 'visual-search-circle', - target: 'img/backwardN.gif', - foil: 'img/normalN.gif', - fixation_image: 'img/fixation.gif', + type: 'visual-search', + target: 'img/greenT.png', + foil: 'img/greenL.png', + fixation_image: 'img/fixation.png', target_present: true, set_size: 4 + jitter_ratio: 1.0 } ``` From a9a9363b42df9afbdd040599f662e9882a1d10fc Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:21:33 -0400 Subject: [PATCH 08/12] Update list-of-plugins.md --- docs/plugins/list-of-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/list-of-plugins.md b/docs/plugins/list-of-plugins.md index e767f51398..043e792285 100644 --- a/docs/plugins/list-of-plugins.md +++ b/docs/plugins/list-of-plugins.md @@ -46,7 +46,7 @@ Plugin | Description [jspsych‑video‑keyboard‑response](/plugins/jspsych-video-keyboard-response) | Displays a video file with many options for customizing playback. Subject responds to the video by pressing a key. [jspsych‑video‑slider‑response](/plugins/jspsych-video-slider-response) | Displays a video file with many options for customizing playback. Subject responds to the video by moving a slider. [jspsych‑virtual‑chinrest](/plugins/jspsych-virtual-chinrest) | An implementation of the "virutal chinrest" procedure developed by [Li, Joo, Yeatman, and Reinecke (2020)](https://doi.org/10.1038/s41598-019-57204-1). Calibrates the monitor to display items at a known physical size by having participants scale an image to be the same size as a physical credit card. Then uses a blind spot task to estimate the distance between the participant and the display. -[jspsych‑visual‑search‑circle](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. +[jspsych‑visual‑search‑](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size [jspsych‑vsl‑animate‑occlusion](/plugins/jspsych-vsl-animate-occlusion) | A visual statistical learning paradigm based on [Fiser & Aslin (2002)](http://dx.doi.org/10.1037//0278-7393.28.3.458). A sequence of stimuli are shown in an oscillatory motion. An occluding rectangle is in the center of the display, and the stimuli change when they are behind the rectangle. [jspsych‑vsl‑grid‑scene](/plugins/jspsych-vsl-grid-scene) | A visual statistical learning paradigm based on [Fiser & Aslin (2001)](http://dx.doi.org/10.1111/1467-9280.00392). A scene made up of individual stimuli arranged in a grid is shown. This plugin can also generate the HTML code to render the stimuli for use in other plugins. [jspsych‑webgazer‑calibrate](/plugins/jspsych-webgazer-calibrate) | Calibrates the WebGazer extension for eye tracking. From c7ccfeaeda002e7addf54a3ce5518ea1210014d7 Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:22:55 -0400 Subject: [PATCH 09/12] Update list-of-plugins.md --- docs/plugins/list-of-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/list-of-plugins.md b/docs/plugins/list-of-plugins.md index 043e792285..a6d011fe1b 100644 --- a/docs/plugins/list-of-plugins.md +++ b/docs/plugins/list-of-plugins.md @@ -46,7 +46,7 @@ Plugin | Description [jspsych‑video‑keyboard‑response](/plugins/jspsych-video-keyboard-response) | Displays a video file with many options for customizing playback. Subject responds to the video by pressing a key. [jspsych‑video‑slider‑response](/plugins/jspsych-video-slider-response) | Displays a video file with many options for customizing playback. Subject responds to the video by moving a slider. [jspsych‑virtual‑chinrest](/plugins/jspsych-virtual-chinrest) | An implementation of the "virutal chinrest" procedure developed by [Li, Joo, Yeatman, and Reinecke (2020)](https://doi.org/10.1038/s41598-019-57204-1). Calibrates the monitor to display items at a known physical size by having participants scale an image to be the same size as a physical credit card. Then uses a blind spot task to estimate the distance between the participant and the display. -[jspsych‑visual‑search‑](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size +[jspsych‑visual‑search&#;](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size [jspsych‑vsl‑animate‑occlusion](/plugins/jspsych-vsl-animate-occlusion) | A visual statistical learning paradigm based on [Fiser & Aslin (2002)](http://dx.doi.org/10.1037//0278-7393.28.3.458). A sequence of stimuli are shown in an oscillatory motion. An occluding rectangle is in the center of the display, and the stimuli change when they are behind the rectangle. [jspsych‑vsl‑grid‑scene](/plugins/jspsych-vsl-grid-scene) | A visual statistical learning paradigm based on [Fiser & Aslin (2001)](http://dx.doi.org/10.1111/1467-9280.00392). A scene made up of individual stimuli arranged in a grid is shown. This plugin can also generate the HTML code to render the stimuli for use in other plugins. [jspsych‑webgazer‑calibrate](/plugins/jspsych-webgazer-calibrate) | Calibrates the WebGazer extension for eye tracking. From 04f55331d069840c57ce294ae01218e87fad9308 Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:23:41 -0400 Subject: [PATCH 10/12] Update list-of-plugins.md --- docs/plugins/list-of-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/list-of-plugins.md b/docs/plugins/list-of-plugins.md index a6d011fe1b..043e792285 100644 --- a/docs/plugins/list-of-plugins.md +++ b/docs/plugins/list-of-plugins.md @@ -46,7 +46,7 @@ Plugin | Description [jspsych‑video‑keyboard‑response](/plugins/jspsych-video-keyboard-response) | Displays a video file with many options for customizing playback. Subject responds to the video by pressing a key. [jspsych‑video‑slider‑response](/plugins/jspsych-video-slider-response) | Displays a video file with many options for customizing playback. Subject responds to the video by moving a slider. [jspsych‑virtual‑chinrest](/plugins/jspsych-virtual-chinrest) | An implementation of the "virutal chinrest" procedure developed by [Li, Joo, Yeatman, and Reinecke (2020)](https://doi.org/10.1038/s41598-019-57204-1). Calibrates the monitor to display items at a known physical size by having participants scale an image to be the same size as a physical credit card. Then uses a blind spot task to estimate the distance between the participant and the display. -[jspsych‑visual‑search&#;](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size +[jspsych‑visual‑search‑](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size [jspsych‑vsl‑animate‑occlusion](/plugins/jspsych-vsl-animate-occlusion) | A visual statistical learning paradigm based on [Fiser & Aslin (2002)](http://dx.doi.org/10.1037//0278-7393.28.3.458). A sequence of stimuli are shown in an oscillatory motion. An occluding rectangle is in the center of the display, and the stimuli change when they are behind the rectangle. [jspsych‑vsl‑grid‑scene](/plugins/jspsych-vsl-grid-scene) | A visual statistical learning paradigm based on [Fiser & Aslin (2001)](http://dx.doi.org/10.1111/1467-9280.00392). A scene made up of individual stimuli arranged in a grid is shown. This plugin can also generate the HTML code to render the stimuli for use in other plugins. [jspsych‑webgazer‑calibrate](/plugins/jspsych-webgazer-calibrate) | Calibrates the WebGazer extension for eye tracking. From 8162550fd8a1c049412d7fddf7adc4a54683d9b1 Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Fri, 2 Jul 2021 21:26:39 -0400 Subject: [PATCH 11/12] Update list-of-plugins.md renamed visual-search-circle to visual-search, changed description for the plugin --- docs/plugins/list-of-plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/list-of-plugins.md b/docs/plugins/list-of-plugins.md index 043e792285..3e8e47969b 100644 --- a/docs/plugins/list-of-plugins.md +++ b/docs/plugins/list-of-plugins.md @@ -46,7 +46,7 @@ Plugin | Description [jspsych‑video‑keyboard‑response](/plugins/jspsych-video-keyboard-response) | Displays a video file with many options for customizing playback. Subject responds to the video by pressing a key. [jspsych‑video‑slider‑response](/plugins/jspsych-video-slider-response) | Displays a video file with many options for customizing playback. Subject responds to the video by moving a slider. [jspsych‑virtual‑chinrest](/plugins/jspsych-virtual-chinrest) | An implementation of the "virutal chinrest" procedure developed by [Li, Joo, Yeatman, and Reinecke (2020)](https://doi.org/10.1038/s41598-019-57204-1). Calibrates the monitor to display items at a known physical size by having participants scale an image to be the same size as a physical credit card. Then uses a blind spot task to estimate the distance between the participant and the display. -[jspsych‑visual‑search‑](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size +[jspsych‑visual‑search‑](/plugins/jspsych-visual-search) | This plugin presents a customizable visual-search task modelled after [Treisman and Gelade (1980)](https://doi.org/10.1016/0010-0285(80)90005-5). The subject indicates whether or not a target is present among a set of distractors. The stimuli can be displayed in a circle or grid format. The stimuli can also be jittered as a ratio of image size. [jspsych‑vsl‑animate‑occlusion](/plugins/jspsych-vsl-animate-occlusion) | A visual statistical learning paradigm based on [Fiser & Aslin (2002)](http://dx.doi.org/10.1037//0278-7393.28.3.458). A sequence of stimuli are shown in an oscillatory motion. An occluding rectangle is in the center of the display, and the stimuli change when they are behind the rectangle. [jspsych‑vsl‑grid‑scene](/plugins/jspsych-vsl-grid-scene) | A visual statistical learning paradigm based on [Fiser & Aslin (2001)](http://dx.doi.org/10.1111/1467-9280.00392). A scene made up of individual stimuli arranged in a grid is shown. This plugin can also generate the HTML code to render the stimuli for use in other plugins. [jspsych‑webgazer‑calibrate](/plugins/jspsych-webgazer-calibrate) | Calibrates the WebGazer extension for eye tracking. From 6d0198c3f80252dc8f6088fe0465ecc0362709a6 Mon Sep 17 00:00:00 2001 From: keshavpabbi <82349347+keshavpabbi@users.noreply.github.com> Date: Wed, 7 Jul 2021 17:48:03 -0400 Subject: [PATCH 12/12] Update and rename plugin-visual-search-circle.test.js to plugin-visual-search.test.js replaced "visual-search-circle" with "visual-search" --- .../plugins/plugin-visual-search-circle.test.js | 16 ---------------- tests/plugins/plugin-visual-search.test.js | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 tests/plugins/plugin-visual-search-circle.test.js create mode 100644 tests/plugins/plugin-visual-search.test.js diff --git a/tests/plugins/plugin-visual-search-circle.test.js b/tests/plugins/plugin-visual-search-circle.test.js deleted file mode 100644 index 9f3ac0624d..0000000000 --- a/tests/plugins/plugin-visual-search-circle.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const root = '../../'; - -jest.useFakeTimers(); - -describe('visual-search-circle plugin', function(){ - - beforeEach(function(){ - require(root + 'jspsych.js'); - require(root + 'plugins/jspsych-visual-search-circle.js'); - }); - - test('loads correctly', function(){ - expect(typeof window.jsPsych.plugins['visual-search-circle']).not.toBe('undefined'); - }); - -}); diff --git a/tests/plugins/plugin-visual-search.test.js b/tests/plugins/plugin-visual-search.test.js new file mode 100644 index 0000000000..9ebc8ff66d --- /dev/null +++ b/tests/plugins/plugin-visual-search.test.js @@ -0,0 +1,16 @@ +const root = '../../'; + +jest.useFakeTimers(); + +describe('visual-search plugin', function(){ + + beforeEach(function(){ + require(root + 'jspsych.js'); + require(root + 'plugins/jspsych-visual-search.js'); + }); + + test('loads correctly', function(){ + expect(typeof window.jsPsych.plugins['visual-search']).not.toBe('undefined'); + }); + +});