Error with locking and unlocking variables - evaluating variable: Cannot read properties of null (reading 'tok')

已查看 6 次
跳至第一个未读帖子

Ben Brawn

未读,
2022年9月29日 02:21:362022/9/29
收件人 Numbas Users
There is a bug with locking and unlocking variables in the editor.

Here are the steps to reproduce the issue (don't do it on a question you like!) 
  1. click the padlock to lock a variable
  2. unclick the padlock to unlock a variable
Note
  1. now in the editor the table has nothing in 'type' and 'generated value'
  2. interestingly the question will still run (including any randomiation of that variable)
  3. deleting the variable and reusing the same name doesn't solve the issue 
  4. if you make a new variable, say blah, that depends on the now dodgy variable you will get the error "Error evaluating variable blah: Cannot read properties of null (reading 'tok')"

Ben Brawn

未读,
2022年9月29日 02:31:382022/9/29
收件人 Numbas Users
Unexpectedly (for me), if you close the question and reopen it, then it works again.

Ben Brawn

未读,
2022年9月29日 02:34:242022/9/29
收件人 Numbas Users
Oh and I missed two steps in producing the bug, looks like you need to click "regenerate values" while the padlock is on and then click "regenerate values" once you turn the padlock off.

Christian Lawson-Perfect

未读,
2022年10月10日 08:40:112022/10/10
收件人 numbas...@googlegroups.com
Thanks for spotting this! I think that this must have been due to a change in how the variable scope used to evaluate variables is created.
I've fixed the problem.

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/5a129840-3bcb-4d6d-9f37-0f890fc96a07n%40googlegroups.com.
回复全部
回复作者
转发
0 个新帖子