Skip to content
Discussion options

You must be logged in to vote

Hi @woodenchair,

You are getting an error because of this line:

	rating: data.response.Q0

You are right that data is a universal plugin parameter in jsPsych, but in this case you are trying to reference the value of data.response before the trial has happened. At the time that your definition of this timeline is created there is no data yet, and so the JavaScript interpreter doesn't know what the variable data refers to here.

It looks like what you are trying to do is basically rename data.response.Q0 to rating in the data for the trial. You can do this in the on_finish parameter, like this:

on_finish: function(data){
	data.rating = data.response.Q0;
}

The reason that this works in on_finish

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sophief10
Comment options

Answer selected by sophief10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants