A JavaScript library for creating and running behavioral experiments in a web browser.
Questions tagged [jspsych]
71 questions
1
vote
0 answers
Difficulty assigning images to array
I am having trouble running a code that I wrote in the JavaScript library jsPsych. The code uses a custom plugin that I created for the purpose of the experiment I am designing. My plugin, "image-button-response-with-name," is the same as the…

puzzleGuzzle
- 101
- 10
1
vote
1 answer
including raw HTML node to canvas element
I want to combine canvas-slider-response plugin and RDK plugin to create response trial where observers change the coherence of the motion field using the slider.
The RDK plugin creates a canvas element and append it to the DOM to draw dots on the…

Err
- 303
- 4
- 15
1
vote
1 answer
Muller Lyer in Html
I'm trying to make a version of the Muller-Lyer illusion in HTML (no image files, because I want to make the line length variable).
Here's what I have so far; it's got the right elements but isn't working correctly. What's the best approach?
.arrow…

CDawg
- 13
- 2
1
vote
1 answer
jspsych 'instructions' block not evaluating variable
I am trying to do a simple evaluation for an instructions type block in jsypscyh. Whenever, I input a variable into my return_essay function, my instructions page won't load correctly (shown below). However, if I insert a string or integer directly…

John-Henry
- 1,556
- 8
- 20
1
vote
0 answers
Is there way to pass a value conditional on another values in HTML?
I have some HTML text in which I pass a value from a randomised vector.
Like so:
var source = jsPsych.randomization.sampleWithoutReplacement(["source1", "source2", "source3", "source4", "source5"]);
According to the

Con Des
- 359
- 1
- 2
- 9
1
vote
1 answer
How can I change the weighting of stimulus presentation in JSPsych?
I'm coding an experiment in JSPsych in which I have ten conditions. I need to present an array of five images with different frequencies depending on the condition.
I've managed to get something sort of working using for loops and…

Con Des
- 359
- 1
- 2
- 9
1
vote
1 answer
Can I create a loop to present an image and have survey likert responses on different pages?
I'm trying to code an experiment with several 'survey-Likert' trials in which an image is presented above the radio buttons using the 'survey-likert' jspsych plugin. I managed to get this to work but all the images/questions appear on the same page.…

Con Des
- 359
- 1
- 2
- 9
1
vote
0 answers
telling a variable to access an array for an if statement
I am programming an online experiment using jspsych/javascript. The experiment consists of 100 blocks and after each block, the block_number gets updated by +1.
There are two conditions. On 75 blocks, I want the program to show an image, and on 25…

Christina
- 13
- 2
1
vote
0 answers
jsPsych integration with React
I've been trying to put a custom experiment made with jsPsych, a library for running behavioral experiments, with custom plugins into a React container but i've run into some issues.
The first thing i tried to do was use makebrainwave's…

Gabriel Dintrans
- 113
- 8
1
vote
1 answer
Using PHP to save file with unknown file name
I'm working on an online experiment (using the jsPsych library) where participants (each with a code number randomly assigned by the script) will record a number of .wav files. I then want to upload to the server with names that include the…

MHSTHLM
- 67
- 1
- 7
1
vote
0 answers
Difference between PsiTurk/jspsych and Pybossa.
I have been working with Psiturk, jspsych and Pybossa for a while. After working on each of it, I experienced that Pybossa is doing the same work what Psiturk is doing, except that Psiturk (with GUI interface designed using jspsych) can be used to…

Daksh Agarwal
- 167
- 2
- 12
1
vote
0 answers
fixation cross in jsPsych
I'm trying to add a fixation cross to an experiment with jsPsych. I'm pretty new to js.
Here is what I have:
var test_stimuli = [
{
image: "img/blau_links.png",
data: { correct_response: 37 }
},
{
image:…

mathi164
- 11
- 1
0
votes
1 answer
Bottom margins for buttons in jsPsychHtmlButtonResponse
I am using the jsPsychHtmlButtonResponse plugin to present buttons to the participants for response selection. However, I am facing an issue with the layout of the buttons. The buttons appear very close to the bottom of the HTML page, and I would…

CapsLock
- 11
- 3
0
votes
0 answers
How to implement automated testing in jsPsych web apps (No UI framework)?
So i'm doing some contract work and need to test some small web apps. They are built with the jsPsych framework and bundled with Webpack. I don't know how to test these apps since I have no access to the UI.
Here's an example of what I…

Zio-4
- 189
- 2
- 12
0
votes
0 answers
Recording multiple key presses in a response task using jsPsych
I am using jsPsych to create a serial reaction time task. At the end of the task I need to create a free generation trial, where participants are required to try and recreate the sequence they have previously been exposed to. The variable should…

Matt W
- 1