Knockout error when reviewing marks in a question

9 views
Skip to first unread message

Chris Jobling

unread,
May 27, 2021, 12:52:17 PM5/27/21
to Numbas Users
I've encountered a wierd error in a question: "Error: Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."

Looks to be a knockout error. I assume "knockout" is a JavaScript library used inside Numbas.

The only thing I did was add a parts question with numerical answers.

The numbers expected are defined by variables, and as far as I can tell, all the variables are defined.

Perhaps someone with knowledge of the internals can help.

Here is a link to a question that reproduces the error.

Test run the question.

Reveal answers to trigger the exception.

Chris Jobling

unread,
May 27, 2021, 2:29:18 PM5/27/21
to Numbas Users
By trial and error, I tracked the problem down to the matrix entry. 

I created a simple 1-part question from a matrix entry part that reveals the bug:


The only thing I'm doing is setting a matrix from a variable x which is a list: 

variable x = [1,2,3,4,5,6,7,8]

answer for matrix question: matrix(x)

I can work around this with a gap fill question, but it feels like a bug at your end.

Chris

Ulrich Goertz

unread,
May 28, 2021, 8:02:03 AM5/28/21
to Numbas Users
Hello, this is just to confirm that I also have this problem, also with a question that worked a week ago, but now throws this error on trying to reveal the answers.

Best regards, Ulrich

Christian Lawson-Perfect

unread,
Jun 1, 2021, 3:17:28 AM6/1/21
to numbas...@googlegroups.com
Ahhh, I made a change to the matrix entry widget last week, but mustn't have tested enough to catch this. Thanks for letting me know. I'll take a look today.

--
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/353173d3-6edf-4697-bc5a-123c3235110bn%40googlegroups.com.

Christian Lawson-Perfect

unread,
Jun 1, 2021, 3:48:11 AM6/1/21
to numbas...@googlegroups.com
This is now fixed!
Reply all
Reply to author
Forward
0 new messages