Skip to content
Discussion options

You must be logged in to vote

Hi @mrinmayik, welcome to the jsPsych community! No need to be apologetic - most researchers have very little JS experience. We're here to help 😃

I think the reason for this error is because the code in your EncodingPhase.js file references a jsPsych function (jsPsych.timelineVariable) and that file is loaded before your main script. So when the EncodingPhase file loads, the jsPsych variable hasn't been created yet - it's created in this line in your main script:

var jsPsych = initJsPsych();

Here are some options:

  1. Move the jsPsych initialization line to the start of the EncodingPhase.js file.
  2. Move the code from EncodingPhase.js into your main script (anywhere after jsPsych is initialized…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@becky-gilbert
Comment options

@mrinmayik
Comment options

Answer selected by mrinmayik
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