A JavaScript library for creating and running behavioral experiments in a web browser.
Questions tagged [jspsych]
71 questions
0
votes
1 answer
JS save data THEN redirect
I am using js and jsPsych to code an experiment.
At the end of the task I want to save the data to Firebase Firestore and then redirect to a location. However, currently no data is being saved when I include the window.location.replace.
It works…

Lara
- 5
- 5
0
votes
0 answers
Stop page from refreshing after completion of script
I have written a simple jsPsych script that greets the participant, then thanks them for their participation after they press any key. Trial data is then sent to the server script via ajax. When the participant hits 'OK' on the thank you window, the…

Nathan
- 340
- 2
- 11
0
votes
0 answers
CSS template not loading in jsPsych
I have written a simple script in jsPsych that welcomes the user to the page, then thanks them for their participation after they press any key. However, it does not load the CSS styling associated with the page. The style sheet is at the…

Nathan
- 340
- 2
- 11
0
votes
2 answers
Use user input from previous trial as stimulus in a new trial
I'm trying to program an experiment with the JavaScript package JSPsych. The MWE of my experiment is supposed to do the following: The participant enters a letter in a survey-text trial and in the following html-response trial, this letter is…

Zamomin
- 57
- 7
0
votes
0 answers
Issue with linking values from pre-defined list to data argument
I am programming a task-switching experiment in javascript using the jsPsych library (jsPsych 6.0.5). I use a predefined list with stimulus attributes but I can't seem to link the specific values to variables in the data argument (output of data is…

Sam Verschooren
- 1
- 1
0
votes
2 answers
How to run a javascript program on a XAMPP server and save the data from that program on the server?
I wrote a Javascript program using a psychology experiment tool called JSPsych. I need to run the program on a server and have the data produced from the experiment trials saved to the server itself.
I downloaded XAMPP and somewhat succeeded in…

Sean
- 1
- 1
0
votes
1 answer
JsPsych What kind of unit tests are these? Javascript
I'm working on an existing project but I am new to Javascript. The project can be found here, it is JsPsych and I've searched the documentation here and cannot find the answer (http://docs.jspsych.org/)
I don't understand how they are doing unit…

Derek Stoeckenius
- 13
- 2
0
votes
2 answers
setInterval, different intervals for last and one before last element (jsPsych)
I'm trying to modify the script from jsPsych library for linguistic and psychology experiment, here is a code which shows images in row and than user can answer.
You can set the time for how long the images will be visible, but only in group (=same…

Karolína Vyskočilová
- 1,305
- 1
- 18
- 29
-1
votes
3 answers
Generating a list of strings of multiple combinations with intermingled order
I'm setting up a cognitive experiment for a professor using jsPsych, where the stimuli are about 200 logical statements of the form T ∧ F ∨ T with 4 different spacing types. I need to find a way to generate every combination of three truth values,…

Van
- 13
- 2
-4
votes
1 answer
How to randomly select an array out of several in JavaScript
I have three arrays with 2 strings each, and would like to randomly select one of the arrays.
array1 = ["hello", "world"];
array2 = ["all", "good"];
array3 = ["bye", "now"];
Something like collecting the three arrays into one, and then math.random?…

jseabra
- 1