@jspsych/plugin-audio-slider-response 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ ![jspsych logo](http://www.jspsych.org/7.0/img/jspsych-logo.jpg)
2
+
3
+ jsPsych is a JavaScript framework for creating behavioral experiments that run in a web browser.
4
+
5
+ ## Plugin Description
6
+
7
+ The audio-slider-response plugin plays audio files and records responses generated by the participant dragging a slider. The audio will be played using the WebAudio API, allowing for reasonably precise timing of the playback by measuring it against the WebAudio specific clock. If WebAudio API is not supported by the browser, the files will be played using HTML5 audio.
8
+
9
+ ## Examples
10
+
11
+ Several example experiments and plugin demonstrations are available in the `/examples` folder.
12
+ After you've downloaded the [latest release](https://github.com/jspsych/jsPsych/releases), double-click on an example HTML file to run it in your web browser, and open it with a programming-friendly text editor to see how it works.
13
+
14
+ ## Documentation
15
+
16
+ Documentation for this plugin is available [here](https://www.jspsych.org/latest/plugins/audio-slider-response).
17
+
18
+ ## Getting help
19
+
20
+ For questions about using the library, please use the GitHub [discussions forum](https://github.com/jspsych/jsPsych/discussions).
21
+ You can also browse through the history of Q&A on the forum to find related questions.
22
+
23
+ ## Contributing
24
+
25
+ We :heart: contributions!
26
+ See the [contributing to jsPsych](https://www.jspsych.org/latest/developers/contributing/) documentation page for more information about how you can help.
27
+
28
+ ## Citation
29
+
30
+ If you use this library in academic work, please cite the [paper that describes jsPsych](http://link.springer.com/article/10.3758%2Fs13428-014-0458-y):
31
+
32
+ de Leeuw, J.R. (2015). jsPsych: A JavaScript library for creating behavioral experiments in a Web browser. _Behavior Research Methods_, _47_(1), 1-12. doi:10.3758/s13428-014-0458-y
33
+
34
+ ## Contributors
35
+
36
+ jsPsych is open source project with [numerous contributors](https://github.com/jspsych/jsPsych/graphs/contributors).
37
+ The project is currently managed by the core team of Josh de Leeuw ([@jodeleeuw](https://github.com/jodeleeuw)), Becky Gilbert ([@becky-gilbert](https://github.com/becky-gilbert)), and Björn Luchterhandt ([@bjoluc](https://github.com/bjoluc)).
38
+
39
+ jsPsych was created by [Josh de Leeuw](http://www.twitter.com/joshdeleeuw).
40
+
41
+ We're also grateful for the generous support from a [Mozilla Open Source Support award](https://www.mozilla.org/en-US/moss/), which funded development of the library from 2020-2021.
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.min.js","sources":["../src/index.ts"],"sourcesContent":["import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from \"jspsych\";\n\nconst info = <const>{\n name: \"audio-slider-response\",\n parameters: {\n /** The audio file to be played. */\n stimulus: {\n type: ParameterType.AUDIO,\n pretty_name: \"Stimulus\",\n default: undefined,\n },\n /** Sets the minimum value of the slider. */\n min: {\n type: ParameterType.INT,\n pretty_name: \"Min slider\",\n default: 0,\n },\n /** Sets the maximum value of the slider */\n max: {\n type: ParameterType.INT,\n pretty_name: \"Max slider\",\n default: 100,\n },\n /** Sets the starting value of the slider */\n slider_start: {\n type: ParameterType.INT,\n pretty_name: \"Slider starting value\",\n default: 50,\n },\n /** Sets the step of the slider */\n step: {\n type: ParameterType.INT,\n pretty_name: \"Step\",\n default: 1,\n },\n /** Array containing the labels for the slider. Labels will be displayed at equidistant locations along the slider. */\n labels: {\n type: ParameterType.HTML_STRING,\n pretty_name: \"Labels\",\n default: [],\n array: true,\n },\n /** Width of the slider in pixels. */\n slider_width: {\n type: ParameterType.INT,\n pretty_name: \"Slider width\",\n default: null,\n },\n /** Label of the button to advance. */\n button_label: {\n type: ParameterType.STRING,\n pretty_name: \"Button label\",\n default: \"Continue\",\n array: false,\n },\n /** If true, the participant will have to move the slider before continuing. */\n require_movement: {\n type: ParameterType.BOOL,\n pretty_name: \"Require movement\",\n default: false,\n },\n /** Any content here will be displayed below the slider. */\n prompt: {\n type: ParameterType.HTML_STRING,\n pretty_name: \"Prompt\",\n default: null,\n },\n /** How long to show the trial. */\n trial_duration: {\n type: ParameterType.INT,\n pretty_name: \"Trial duration\",\n default: null,\n },\n /** If true, trial will end when user makes a response. */\n response_ends_trial: {\n type: ParameterType.BOOL,\n pretty_name: \"Response ends trial\",\n default: true,\n },\n /** If true, then the trial will end as soon as the audio file finishes playing. */\n trial_ends_after_audio: {\n type: ParameterType.BOOL,\n pretty_name: \"Trial ends after audio\",\n default: false,\n },\n /** If true, then responses are allowed while the audio is playing. If false, then the audio must finish playing before a response is accepted. */\n response_allowed_while_playing: {\n type: ParameterType.BOOL,\n pretty_name: \"Response allowed while playing\",\n default: true,\n },\n },\n};\n\ntype Info = typeof info;\n\n/**\n * **audio-slider-response**\n *\n * jsPsych plugin for playing audio and getting a slider response\n *\n * @author Josh de Leeuw\n * @see {@link https://www.jspsych.org/plugins/jspsych-audio-slider-response/ audio-slider-response plugin documentation on jspsych.org}\n */\nclass AudioSliderResponsePlugin implements JsPsychPlugin<Info> {\n static info = info;\n private audio;\n\n constructor(private jsPsych: JsPsych) {}\n\n trial(display_element: HTMLElement, trial: TrialType<Info>, on_load: () => void) {\n // hold the .resolve() function from the Promise that ends the trial\n let trial_complete;\n\n // half of the thumb width value from jspsych.css, used to adjust the label positions\n var half_thumb_width = 7.5;\n\n // setup stimulus\n var context = this.jsPsych.pluginAPI.audioContext();\n\n // record webaudio context start time\n var startTime;\n\n // for storing data related to response\n var response;\n\n // load audio file\n this.jsPsych.pluginAPI\n .getAudioBuffer(trial.stimulus)\n .then((buffer) => {\n if (context !== null) {\n this.audio = context.createBufferSource();\n this.audio.buffer = buffer;\n this.audio.connect(context.destination);\n } else {\n this.audio = buffer;\n this.audio.currentTime = 0;\n }\n setupTrial();\n })\n .catch((err) => {\n console.error(\n `Failed to load audio file \"${trial.stimulus}\". Try checking the file path. We recommend using the preload plugin to load audio files.`\n );\n console.error(err);\n });\n\n const setupTrial = () => {\n // set up end event if trial needs it\n if (trial.trial_ends_after_audio) {\n this.audio.addEventListener(\"ended\", end_trial);\n }\n\n // enable slider after audio ends if necessary\n if (!trial.response_allowed_while_playing && !trial.trial_ends_after_audio) {\n this.audio.addEventListener(\"ended\", enable_slider);\n }\n\n var html = '<div id=\"jspsych-audio-slider-response-wrapper\" style=\"margin: 100px 0px;\">';\n html +=\n '<div class=\"jspsych-audio-slider-response-container\" style=\"position:relative; margin: 0 auto 3em auto; width:';\n if (trial.slider_width !== null) {\n html += trial.slider_width + \"px;\";\n } else {\n html += \"auto;\";\n }\n html += '\">';\n html +=\n '<input type=\"range\" class=\"jspsych-slider\" value=\"' +\n trial.slider_start +\n '\" min=\"' +\n trial.min +\n '\" max=\"' +\n trial.max +\n '\" step=\"' +\n trial.step +\n '\" id=\"jspsych-audio-slider-response-response\"';\n if (!trial.response_allowed_while_playing) {\n html += \" disabled\";\n }\n html += \"></input><div>\";\n for (var j = 0; j < trial.labels.length; j++) {\n var label_width_perc = 100 / (trial.labels.length - 1);\n var percent_of_range = j * (100 / (trial.labels.length - 1));\n var percent_dist_from_center = ((percent_of_range - 50) / 50) * 100;\n var offset = (percent_dist_from_center * half_thumb_width) / 100;\n html +=\n '<div style=\"border: 1px solid transparent; display: inline-block; position: absolute; ' +\n \"left:calc(\" +\n percent_of_range +\n \"% - (\" +\n label_width_perc +\n \"% / 2) - \" +\n offset +\n \"px); text-align: center; width: \" +\n label_width_perc +\n '%;\">';\n html += '<span style=\"text-align: center; font-size: 80%;\">' + trial.labels[j] + \"</span>\";\n html += \"</div>\";\n }\n html += \"</div>\";\n html += \"</div>\";\n html += \"</div>\";\n\n if (trial.prompt !== null) {\n html += trial.prompt;\n }\n\n // add submit button\n var next_disabled_attribute = \"\";\n if (trial.require_movement || !trial.response_allowed_while_playing) {\n next_disabled_attribute = \"disabled\";\n }\n html +=\n '<button id=\"jspsych-audio-slider-response-next\" class=\"jspsych-btn\" ' +\n next_disabled_attribute +\n \">\" +\n trial.button_label +\n \"</button>\";\n\n display_element.innerHTML = html;\n\n response = {\n rt: null,\n response: null,\n };\n\n if (!trial.response_allowed_while_playing) {\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-response\"\n ).disabled = true;\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-next\"\n ).disabled = true;\n }\n\n if (trial.require_movement) {\n const enable_button = () => {\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-next\"\n ).disabled = false;\n };\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-response\")\n .addEventListener(\"mousedown\", enable_button);\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-response\")\n .addEventListener(\"touchstart\", enable_button);\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-response\")\n .addEventListener(\"change\", enable_button);\n }\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-next\")\n .addEventListener(\"click\", () => {\n // measure response time\n var endTime = performance.now();\n var rt = Math.round(endTime - startTime);\n if (context !== null) {\n endTime = context.currentTime;\n rt = Math.round((endTime - startTime) * 1000);\n }\n response.rt = rt;\n response.response = display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-response\"\n ).valueAsNumber;\n\n if (trial.response_ends_trial) {\n end_trial();\n } else {\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-next\"\n ).disabled = true;\n }\n });\n\n startTime = performance.now();\n // start audio\n if (context !== null) {\n startTime = context.currentTime;\n this.audio.start(startTime);\n } else {\n this.audio.play();\n }\n\n // end trial if trial_duration is set\n if (trial.trial_duration !== null) {\n this.jsPsych.pluginAPI.setTimeout(() => {\n end_trial();\n }, trial.trial_duration);\n }\n\n on_load();\n };\n\n // function to enable slider after audio ends\n function enable_slider() {\n document.querySelector<HTMLInputElement>(\"#jspsych-audio-slider-response-response\").disabled =\n false;\n if (!trial.require_movement) {\n document.querySelector<HTMLButtonElement>(\"#jspsych-audio-slider-response-next\").disabled =\n false;\n }\n }\n\n const end_trial = () => {\n // kill any remaining setTimeout handlers\n this.jsPsych.pluginAPI.clearAllTimeouts();\n\n // stop the audio file if it is playing\n // remove end event listeners if they exist\n if (context !== null) {\n this.audio.stop();\n } else {\n this.audio.pause();\n }\n\n this.audio.removeEventListener(\"ended\", end_trial);\n this.audio.removeEventListener(\"ended\", enable_slider);\n\n // save data\n var trialdata = {\n rt: response.rt,\n stimulus: trial.stimulus,\n slider_start: trial.slider_start,\n response: response.response,\n };\n\n display_element.innerHTML = \"\";\n\n // next trial\n this.jsPsych.finishTrial(trialdata);\n\n trial_complete();\n };\n\n return new Promise((resolve) => {\n trial_complete = resolve;\n });\n }\n\n simulate(\n trial: TrialType<Info>,\n simulation_mode,\n simulation_options: any,\n load_callback: () => void\n ) {\n if (simulation_mode == \"data-only\") {\n load_callback();\n this.simulate_data_only(trial, simulation_options);\n }\n if (simulation_mode == \"visual\") {\n this.simulate_visual(trial, simulation_options, load_callback);\n }\n }\n\n private create_simulation_data(trial: TrialType<Info>, simulation_options) {\n const default_data = {\n stimulus: trial.stimulus,\n slider_start: trial.slider_start,\n response: this.jsPsych.randomization.randomInt(trial.min, trial.max),\n rt: this.jsPsych.randomization.sampleExGaussian(500, 50, 1 / 150, true),\n };\n\n const data = this.jsPsych.pluginAPI.mergeSimulationData(default_data, simulation_options);\n\n this.jsPsych.pluginAPI.ensureSimulationDataConsistency(trial, data);\n\n return data;\n }\n\n private simulate_data_only(trial: TrialType<Info>, simulation_options) {\n const data = this.create_simulation_data(trial, simulation_options);\n\n this.jsPsych.finishTrial(data);\n }\n\n private simulate_visual(trial: TrialType<Info>, simulation_options, load_callback: () => void) {\n const data = this.create_simulation_data(trial, simulation_options);\n\n const display_element = this.jsPsych.getDisplayElement();\n\n const respond = () => {\n if (data.rt !== null) {\n const el = display_element.querySelector<HTMLInputElement>(\"input[type='range']\");\n\n setTimeout(() => {\n this.jsPsych.pluginAPI.clickTarget(el);\n el.valueAsNumber = data.response;\n }, data.rt / 2);\n\n this.jsPsych.pluginAPI.clickTarget(display_element.querySelector(\"button\"), data.rt);\n }\n };\n\n this.trial(display_element, trial, () => {\n load_callback();\n\n if (!trial.response_allowed_while_playing) {\n this.audio.addEventListener(\"ended\", respond);\n } else {\n respond();\n }\n });\n }\n}\n\nexport default AudioSliderResponsePlugin;\n"],"names":["info","name","parameters","stimulus","type","ParameterType","AUDIO","pretty_name","default","undefined","min","INT","max","slider_start","step","labels","HTML_STRING","array","slider_width","button_label","STRING","require_movement","BOOL","prompt","trial_duration","response_ends_trial","trial_ends_after_audio","response_allowed_while_playing","AudioSliderResponsePlugin","jsPsych","_classCallCheck","this","value","display_element","trial","on_load","trial_complete","startTime","response","_this","context","pluginAPI","audioContext","getAudioBuffer","then","buffer","audio","createBufferSource","connect","destination","currentTime","setupTrial","err","console","error","addEventListener","end_trial","enable_slider","html","j","length","label_width_perc","percent_of_range","next_disabled_attribute","innerHTML","rt","querySelector","disabled","enable_button","endTime","performance","now","Math","round","valueAsNumber","start","play","setTimeout","document","clearAllTimeouts","stop","pause","removeEventListener","trialdata","finishTrial","Promise","resolve","simulation_mode","simulation_options","load_callback","simulate_data_only","simulate_visual","default_data","randomization","randomInt","sampleExGaussian","data","mergeSimulationData","ensureSimulationDataConsistency","create_simulation_data","_this2","getDisplayElement","respond","el","clickTarget"],"mappings":"8NAEA,IAAMA,EAAc,CAClBC,KAAM,wBACNC,WAAY,CAEVC,SAAU,CACRC,KAAMC,EAAaA,cAACC,MACpBC,YAAa,WACbC,aAASC,GAGXC,IAAK,CACHN,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,aACbC,QAAS,GAGXI,IAAK,CACHR,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,aACbC,QAAS,KAGXK,aAAc,CACZT,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,wBACbC,QAAS,IAGXM,KAAM,CACJV,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,OACbC,QAAS,GAGXO,OAAQ,CACNX,KAAMC,EAAaA,cAACW,YACpBT,YAAa,SACbC,QAAS,GACTS,OAAO,GAGTC,aAAc,CACZd,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,eACbC,QAAS,MAGXW,aAAc,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AMxB,IAAKwB,EAAMtB,KAChEqD,GAAIlC,KAAKF,QAAQgE,cAAcE,iBAAiB,IAAK,GAAI,EAAI,KAAK,IAG9DC,EAAOjE,KAAKF,QAAQY,UAAUwD,oBAAoBL,EAAcJ,GAItE,OAFAzD,KAAKF,QAAQY,UAAUyD,gCAAgChE,EAAO8D,GAEvDA,oCAGD,SAAmB9D,EAAwBsD,GACjD,IAAMQ,EAAOjE,KAAKoE,uBAAuBjE,EAAOsD,GAEhDzD,KAAKF,QAAQuD,YAAYY,4BAGnBhE,MAAA,SAAgBE,EAAwBsD,EAAoBC,GAAyB,IAAAW,EAAArE,KACrFiE,EAAOjE,KAAKoE,uBAAuBjE,EAAOsD,GAE1CvD,EAAkBF,KAAKF,QAAQwE,oBAE/BC,EAAU,WACd,GAAgB,OAAZN,EAAK/B,GAAa,CACpB,IAAMsC,EAAKtE,EAAgBiC,cAAgC,uBAE3DW,YAAW,WACTuB,EAAKvE,QAAQY,UAAU+D,YAAYD,GACnCA,EAAG7B,cAAgBsB,EAAK1D,WACvB0D,EAAK/B,GAAK,GAEbmC,EAAKvE,QAAQY,UAAU+D,YAAYvE,EAAgBiC,cAAc,UAAW8B,EAAK/B,MAIrFlC,KAAKG,MAAMD,EAAiBC,GAAO,WACjCuD,IAEKvD,EAAMP,+BAGT2E,IAFAF,EAAKtD,MAAMS,iBAAiB,QAAS+C,qGA1SpC1E,EAAI5B,KAAGA"}
1
+ {"version":3,"file":"index.browser.min.js","sources":["../src/index.ts"],"sourcesContent":["import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from \"jspsych\";\n\nconst info = <const>{\n name: \"audio-slider-response\",\n parameters: {\n /** The audio file to be played. */\n stimulus: {\n type: ParameterType.AUDIO,\n pretty_name: \"Stimulus\",\n default: undefined,\n },\n /** Sets the minimum value of the slider. */\n min: {\n type: ParameterType.INT,\n pretty_name: \"Min slider\",\n default: 0,\n },\n /** Sets the maximum value of the slider */\n max: {\n type: ParameterType.INT,\n pretty_name: \"Max slider\",\n default: 100,\n },\n /** Sets the starting value of the slider */\n slider_start: {\n type: ParameterType.INT,\n pretty_name: \"Slider starting value\",\n default: 50,\n },\n /** Sets the step of the slider */\n step: {\n type: ParameterType.INT,\n pretty_name: \"Step\",\n default: 1,\n },\n /** Array containing the labels for the slider. Labels will be displayed at equidistant locations along the slider. */\n labels: {\n type: ParameterType.HTML_STRING,\n pretty_name: \"Labels\",\n default: [],\n array: true,\n },\n /** Width of the slider in pixels. */\n slider_width: {\n type: ParameterType.INT,\n pretty_name: \"Slider width\",\n default: null,\n },\n /** Label of the button to advance. */\n button_label: {\n type: ParameterType.STRING,\n pretty_name: \"Button label\",\n default: \"Continue\",\n array: false,\n },\n /** If true, the participant will have to move the slider before continuing. */\n require_movement: {\n type: ParameterType.BOOL,\n pretty_name: \"Require movement\",\n default: false,\n },\n /** Any content here will be displayed below the slider. */\n prompt: {\n type: ParameterType.HTML_STRING,\n pretty_name: \"Prompt\",\n default: null,\n },\n /** How long to show the trial. */\n trial_duration: {\n type: ParameterType.INT,\n pretty_name: \"Trial duration\",\n default: null,\n },\n /** If true, trial will end when user makes a response. */\n response_ends_trial: {\n type: ParameterType.BOOL,\n pretty_name: \"Response ends trial\",\n default: true,\n },\n /** If true, then the trial will end as soon as the audio file finishes playing. */\n trial_ends_after_audio: {\n type: ParameterType.BOOL,\n pretty_name: \"Trial ends after audio\",\n default: false,\n },\n /** If true, then responses are allowed while the audio is playing. If false, then the audio must finish playing before a response is accepted. */\n response_allowed_while_playing: {\n type: ParameterType.BOOL,\n pretty_name: \"Response allowed while playing\",\n default: true,\n },\n },\n};\n\ntype Info = typeof info;\n\n/**\n * **audio-slider-response**\n *\n * jsPsych plugin for playing audio and getting a slider response\n *\n * @author Josh de Leeuw\n * @see {@link https://www.jspsych.org/plugins/jspsych-audio-slider-response/ audio-slider-response plugin documentation on jspsych.org}\n */\nclass AudioSliderResponsePlugin implements JsPsychPlugin<Info> {\n static info = info;\n private audio;\n\n constructor(private jsPsych: JsPsych) {}\n\n trial(display_element: HTMLElement, trial: TrialType<Info>, on_load: () => void) {\n // hold the .resolve() function from the Promise that ends the trial\n let trial_complete;\n\n // half of the thumb width value from jspsych.css, used to adjust the label positions\n var half_thumb_width = 7.5;\n\n // setup stimulus\n var context = this.jsPsych.pluginAPI.audioContext();\n\n // record webaudio context start time\n var startTime;\n\n // for storing data related to response\n var response;\n\n // load audio file\n this.jsPsych.pluginAPI\n .getAudioBuffer(trial.stimulus)\n .then((buffer) => {\n if (context !== null) {\n this.audio = context.createBufferSource();\n this.audio.buffer = buffer;\n this.audio.connect(context.destination);\n } else {\n this.audio = buffer;\n this.audio.currentTime = 0;\n }\n setupTrial();\n })\n .catch((err) => {\n console.error(\n `Failed to load audio file \"${trial.stimulus}\". Try checking the file path. We recommend using the preload plugin to load audio files.`\n );\n console.error(err);\n });\n\n const setupTrial = () => {\n // set up end event if trial needs it\n if (trial.trial_ends_after_audio) {\n this.audio.addEventListener(\"ended\", end_trial);\n }\n\n // enable slider after audio ends if necessary\n if (!trial.response_allowed_while_playing && !trial.trial_ends_after_audio) {\n this.audio.addEventListener(\"ended\", enable_slider);\n }\n\n var html = '<div id=\"jspsych-audio-slider-response-wrapper\" style=\"margin: 100px 0px;\">';\n html +=\n '<div class=\"jspsych-audio-slider-response-container\" style=\"position:relative; margin: 0 auto 3em auto; width:';\n if (trial.slider_width !== null) {\n html += trial.slider_width + \"px;\";\n } else {\n html += \"auto;\";\n }\n html += '\">';\n html +=\n '<input type=\"range\" class=\"jspsych-slider\" value=\"' +\n trial.slider_start +\n '\" min=\"' +\n trial.min +\n '\" max=\"' +\n trial.max +\n '\" step=\"' +\n trial.step +\n '\" id=\"jspsych-audio-slider-response-response\"';\n if (!trial.response_allowed_while_playing) {\n html += \" disabled\";\n }\n html += \"></input><div>\";\n for (var j = 0; j < trial.labels.length; j++) {\n var label_width_perc = 100 / (trial.labels.length - 1);\n var percent_of_range = j * (100 / (trial.labels.length - 1));\n var percent_dist_from_center = ((percent_of_range - 50) / 50) * 100;\n var offset = (percent_dist_from_center * half_thumb_width) / 100;\n html +=\n '<div style=\"border: 1px solid transparent; display: inline-block; position: absolute; ' +\n \"left:calc(\" +\n percent_of_range +\n \"% - (\" +\n label_width_perc +\n \"% / 2) - \" +\n offset +\n \"px); text-align: center; width: \" +\n label_width_perc +\n '%;\">';\n html += '<span style=\"text-align: center; font-size: 80%;\">' + trial.labels[j] + \"</span>\";\n html += \"</div>\";\n }\n html += \"</div>\";\n html += \"</div>\";\n html += \"</div>\";\n\n if (trial.prompt !== null) {\n html += trial.prompt;\n }\n\n // add submit button\n var next_disabled_attribute = \"\";\n if (trial.require_movement || !trial.response_allowed_while_playing) {\n next_disabled_attribute = \"disabled\";\n }\n html +=\n '<button id=\"jspsych-audio-slider-response-next\" class=\"jspsych-btn\" ' +\n next_disabled_attribute +\n \">\" +\n trial.button_label +\n \"</button>\";\n\n display_element.innerHTML = html;\n\n response = {\n rt: null,\n response: null,\n };\n\n if (!trial.response_allowed_while_playing) {\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-response\"\n ).disabled = true;\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-next\"\n ).disabled = true;\n }\n\n if (trial.require_movement) {\n const enable_button = () => {\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-next\"\n ).disabled = false;\n };\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-response\")\n .addEventListener(\"mousedown\", enable_button);\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-response\")\n .addEventListener(\"touchstart\", enable_button);\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-response\")\n .addEventListener(\"change\", enable_button);\n }\n\n display_element\n .querySelector(\"#jspsych-audio-slider-response-next\")\n .addEventListener(\"click\", () => {\n // measure response time\n var endTime = performance.now();\n var rt = Math.round(endTime - startTime);\n if (context !== null) {\n endTime = context.currentTime;\n rt = Math.round((endTime - startTime) * 1000);\n }\n response.rt = rt;\n response.response = display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-response\"\n ).valueAsNumber;\n\n if (trial.response_ends_trial) {\n end_trial();\n } else {\n display_element.querySelector<HTMLInputElement>(\n \"#jspsych-audio-slider-response-next\"\n ).disabled = true;\n }\n });\n\n startTime = performance.now();\n // start audio\n if (context !== null) {\n startTime = context.currentTime;\n this.audio.start(startTime);\n } else {\n this.audio.play();\n }\n\n // end trial if trial_duration is set\n if (trial.trial_duration !== null) {\n this.jsPsych.pluginAPI.setTimeout(() => {\n end_trial();\n }, trial.trial_duration);\n }\n\n on_load();\n };\n\n // function to enable slider after audio ends\n function enable_slider() {\n document.querySelector<HTMLInputElement>(\"#jspsych-audio-slider-response-response\").disabled =\n false;\n if (!trial.require_movement) {\n document.querySelector<HTMLButtonElement>(\"#jspsych-audio-slider-response-next\").disabled =\n false;\n }\n }\n\n const end_trial = () => {\n // kill any remaining setTimeout handlers\n this.jsPsych.pluginAPI.clearAllTimeouts();\n\n // stop the audio file if it is playing\n // remove end event listeners if they exist\n if (context !== null) {\n this.audio.stop();\n } else {\n this.audio.pause();\n }\n\n this.audio.removeEventListener(\"ended\", end_trial);\n this.audio.removeEventListener(\"ended\", enable_slider);\n\n // save data\n var trialdata = {\n rt: response.rt,\n stimulus: trial.stimulus,\n slider_start: trial.slider_start,\n response: response.response,\n };\n\n display_element.innerHTML = \"\";\n\n // next trial\n this.jsPsych.finishTrial(trialdata);\n\n trial_complete();\n };\n\n return new Promise((resolve) => {\n trial_complete = resolve;\n });\n }\n\n simulate(\n trial: TrialType<Info>,\n simulation_mode,\n simulation_options: any,\n load_callback: () => void\n ) {\n if (simulation_mode == \"data-only\") {\n load_callback();\n this.simulate_data_only(trial, simulation_options);\n }\n if (simulation_mode == \"visual\") {\n this.simulate_visual(trial, simulation_options, load_callback);\n }\n }\n\n private create_simulation_data(trial: TrialType<Info>, simulation_options) {\n const default_data = {\n stimulus: trial.stimulus,\n slider_start: trial.slider_start,\n response: this.jsPsych.randomization.randomInt(trial.min, trial.max),\n rt: this.jsPsych.randomization.sampleExGaussian(500, 50, 1 / 150, true),\n };\n\n const data = this.jsPsych.pluginAPI.mergeSimulationData(default_data, simulation_options);\n\n this.jsPsych.pluginAPI.ensureSimulationDataConsistency(trial, data);\n\n return data;\n }\n\n private simulate_data_only(trial: TrialType<Info>, simulation_options) {\n const data = this.create_simulation_data(trial, simulation_options);\n\n this.jsPsych.finishTrial(data);\n }\n\n private simulate_visual(trial: TrialType<Info>, simulation_options, load_callback: () => void) {\n const data = this.create_simulation_data(trial, simulation_options);\n\n const display_element = this.jsPsych.getDisplayElement();\n\n const respond = () => {\n if (data.rt !== null) {\n const el = display_element.querySelector<HTMLInputElement>(\"input[type='range']\");\n\n setTimeout(() => {\n this.jsPsych.pluginAPI.clickTarget(el);\n el.valueAsNumber = data.response;\n }, data.rt / 2);\n\n this.jsPsych.pluginAPI.clickTarget(display_element.querySelector(\"button\"), data.rt);\n }\n };\n\n this.trial(display_element, trial, () => {\n load_callback();\n\n if (!trial.response_allowed_while_playing) {\n this.audio.addEventListener(\"ended\", respond);\n } else {\n respond();\n }\n });\n }\n}\n\nexport default AudioSliderResponsePlugin;\n"],"names":["info","name","parameters","stimulus","type","ParameterType","AUDIO","pretty_name","default","undefined","min","INT","max","slider_start","step","labels","HTML_STRING","array","slider_width","button_label","STRING","require_movement","BOOL","prompt","trial_duration","response_ends_trial","trial_ends_after_audio","response_allowed_while_playing","AudioSliderResponsePlugin","jsPsych","_classCallCheck","this","value","display_element","trial","on_load","trial_complete","startTime","response","_this","context","pluginAPI","audioContext","getAudioBuffer","then","buffer","audio","createBufferSource","connect","destination","currentTime","setupTrial","err","console","error","addEventListener","end_trial","enable_slider","html","j","length","label_width_perc","percent_of_range","next_disabled_attribute","innerHTML","rt","querySelector","disabled","enable_button","endTime","performance","now","Math","round","valueAsNumber","start","play","setTimeout","document","clearAllTimeouts","stop","pause","removeEventListener","trialdata","finishTrial","Promise","resolve","simulation_mode","simulation_options","load_callback","simulate_data_only","simulate_visual","default_data","randomization","randomInt","sampleExGaussian","data","mergeSimulationData","ensureSimulationDataConsistency","create_simulation_data","_this2","getDisplayElement","respond","el","clickTarget"],"mappings":"8NAEA,IAAMA,EAAc,CAClBC,KAAM,wBACNC,WAAY,CAEVC,SAAU,CACRC,KAAMC,EAAaA,cAACC,MACpBC,YAAa,WACbC,aAASC,GAGXC,IAAK,CACHN,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,aACbC,QAAS,GAGXI,IAAK,CACHR,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,aACbC,QAAS,KAGXK,aAAc,CACZT,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,wBACbC,QAAS,IAGXM,KAAM,CACJV,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,OACbC,QAAS,GAGXO,OAAQ,CACNX,KAAMC,EAAaA,cAACW,YACpBT,YAAa,SACbC,QAAS,GACTS,OAAO,GAGTC,aAAc,CACZd,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,eACbC,QAAS,MAGXW,aAAc,CACZf,KAAMC,EAAaA,cAACe,OACpBb,YAAa,eACbC,QAAS,WACTS,OAAO,GAGTI,iBAAkB,CAChBjB,KAAMC,EAAaA,cAACiB,KACpBf,YAAa,mBACbC,SAAS,GAGXe,OAAQ,CACNnB,KAAMC,EAAaA,cAACW,YACpBT,YAAa,SACbC,QAAS,MAGXgB,eAAgB,CACdpB,KAAMC,EAAaA,cAACM,IACpBJ,YAAa,iBACbC,QAAS,MAGXiB,oBAAqB,CACnBrB,KAAMC,EAAaA,cAACiB,KACpBf,YAAa,sBACbC,SAAS,GAGXkB,uBAAwB,CACtBtB,KAAMC,EAAaA,cAACiB,KACpBf,YAAa,yBACbC,SAAS,GAGXmB,+BAAgC,CAC9BvB,KAAMC,EAAaA,cAACiB,KACpBf,YAAa,iCACbC,SAAS,KAeToB,aAIJ,SAAAA,EAAoBC,gGAAgBC,CAAAC,KAAAH,GAAhBG,KAAOF,QAA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,CACpB,IAAMsC,EAAKtE,EAAgBiC,cAAgC,uBAE3DW,YAAW,WACTuB,EAAKvE,QAAQY,UAAU+D,YAAYD,GACnCA,EAAG7B,cAAgBsB,EAAK1D,QACzB,GAAE0D,EAAK/B,GAAK,GAEbmC,EAAKvE,QAAQY,UAAU+D,YAAYvE,EAAgBiC,cAAc,UAAW8B,EAAK/B,GAClF,GAGHlC,KAAKG,MAAMD,EAAiBC,GAAO,WACjCuD,IAEKvD,EAAMP,+BAGT2E,IAFAF,EAAKtD,MAAMS,iBAAiB,QAAS+C,KAK1C,gGA/SM1E,EAAI5B,KAAGA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jspsych/plugin-audio-slider-response",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -38,6 +38,6 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@jspsych/config": "^1.3.0",
41
- "@jspsych/test-utils": "^1.1.0"
41
+ "@jspsych/test-utils": "^1.1.2"
42
42
  }
43
43
  }