Skip to content

Changing global variable? #1511

Answered by becky-gilbert
TomRui asked this question in Q&A
Feb 12, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hi @TomRui! Your functions that update the variable's value look like they should work. The problem might just be that you're not seeing the updated value because the debugging trial doesn't use a dynamic parameter for the page content, so it'll only ever show the initial value.
It might be easier to set up your debugging trial with the html-keyboard-response plugin. Another thing you can do is use console.log in your functions to see when they're called and check variable values. Try this:

// initialize response window​var​ ​adaptive_response_window​ ​=​ ​1230​
​// try to change variable using function call​function​ ​myfunc()​ ​{​
  ​adaptive_response_window​ ​+= 200;
  console.log

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@TomRui
Comment options

@becky-gilbert
Comment options

@TomRui
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