numbas / numbas-extension-programming

An extension for Numbas which provides a code editor and the ability to evaluate code written in Python and R.
Apache License 2.0
3 stars 1 forks source link

Code part: No notification of exceptions in postamble with any setting #14

Closed aarchiba closed 2 years ago

aarchiba commented 2 years ago

If an exception is raised in the postamble, NUMBAS silently stops running it and continues the grading without any kind of notification. The below example demonstrates this, raising an exception that results in the following code being unreachable:

https://numbas.mathcentre.ac.uk/question/share/edit/a4e16511-5d8e-446f-931c-bdf7b287f85d

I realize there may be security issues with students triggering exceptions to peek into marking code via tracebacks, but this makes debugging code parts extremely difficult.

christianp commented 2 years ago

I think this is just an oversight. Thanks for pointing it out.

aarchiba commented 1 year ago

I don't know what if anything to do about this, but fixing this bug may break existing questions that were working - I am importing a question that calls a nonexistent function mark in the postamble but which worked fine because the postamble wasn't expected to do anything; now it marks every solution wrong. Easily fixed, but it is an example of a question that worked before this fix was applied and not after.