Cannot read properties of undefined (reading 'getConstant')

9 views
Skip to first unread message

Ben Brawn

unread,
May 19, 2022, 1:35:35 AM5/19/22
to Numbas Users
This formerly working question has recently broken. Part (a) of 

It has some custom marking code (which I'm sure I borrowed or modified from a demo question) to confirm that the student has written the answer in the form a^4 and that seems to be the issue. 

A few people have copied this question so all of their versions will be broken too atm.

There is a pop-up of errors like "Numbas Error: Error in part Gap 0 custom script mark_answer: Cannot read properties of undefined (reading 'getConstant')" and after that we get "Error evaluating variable mark: Variable all_valid is not defined." on the page.

Ben Brawn

unread,
May 19, 2022, 1:42:24 AM5/19/22
to Numbas Users
For the moment, I've just commented the custom marking out of the live version and I'm just using forbidden strings to avoid the student entering the question in.

Christian Lawson-Perfect

unread,
May 19, 2022, 3:10:47 AM5/19/22
to numbas...@googlegroups.com
This must have been broken for a couple of years at least, unless I'm missing something. Part a uses the old pattern-matching functions, so would have broken in 2019 when the new pattern-matching code was introduced.
I think the easiest way to fix this is to just use the built-in pattern restriction, instead of custom JS marking script.

--
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/55baaba7-8ff2-4816-9dc8-73d189eac810n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages