Skip to content
Discussion options

You must be logged in to vote

Hi @agarza7, this is something that some people find easier to do in the data processing stage, using a scripting language like R, Python, Matlab, etc.

But if you want to do this in your jsPsych JavaScript code, you could do this in the trial's on_finish function. The on_finish function gives you access to the trial data, and allows you to modify it. So if your survey-likert trials always have just one question on the page, then you could create a new variable (e.g. "response_value") in the trial data, and store the response inside of that. You can access the response with data.response, followed by the question name:

  var trial = {
    type: 'survey-likert',
    questions: [
      {prompt

Replies: 1 comment 1 reply

Comment options

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

Answer selected by becky-gilbert
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