/** * jspsych-same-different * Josh de Leeuw * * plugin for showing two stimuli sequentially and getting a same / different judgment * * documentation: docs.jspsych.org * */ jsPsych.plugins['same-different-html'] = (function() { var plugin = {}; plugin.info = { name: 'same-different-html', description: '', parameters: { stimuli: { type: jsPsych.plugins.parameterType.HTML_STRING, pretty_name: 'Stimuli', default: undefined, array: true, description: 'The HTML content to be displayed.' }, answer: { type: jsPsych.plugins.parameterType.SELECT, pretty_name: 'Answer', options: ['same', 'different'], default: undefined, description: 'Either "same" or "different".' }, same_key: { type: jsPsych.plugins.parameterType.KEYCODE, pretty_name: 'Same key', default: 'Q', description: '' }, different_key: { type: jsPsych.plugins.parameterType.KEYCODE, pretty_name: 'Different key', default: 'P', description: 'The key that subjects should press to indicate that the two stimuli are the same.' }, first_stim_duration: { type: jsPsych.plugins.parameterType.INT, pretty_name: 'First stimulus duration', default: null, description: 'How long to show the first stimulus for in milliseconds. If null, then the stimulus will remain on the screen until any keypress is made.' }, gap_duration: { type: jsPsych.plugins.parameterType.INT, pretty_name: 'Gap duration', default: 500, description: 'How long to show a blank screen in between the two stimuli.' }, second_stim_duration: { type: jsPsych.plugins.parameterType.INT, pretty_name: 'Second stimulus duration', default: null, description: 'How long to show the second stimulus for in milliseconds. If null, then the stimulus will remain on the screen until a valid response is made.' }, prompt: { type: jsPsych.plugins.parameterType.STRING, pretty_name: 'Prompt', default: null, description: 'Any content here will be displayed below the stimulus.' } } } plugin.trial = function(display_element, trial) { display_element.innerHTML = '