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

Resource context IDs don't take account of loading of files when questions run standalone #35

Closed chrismgraham closed 2 months ago

chrismgraham commented 2 months ago

The recent commit to allow a context ID for resources works well in an exam, but seems that files aren't loaded when tested individually if the context ID is greater than 0 (example: https://numbas.mathcentre.ac.uk/question/155604/chris-s-copy-of-load-a-question-resource-file-in-python-or-r/)

christianp commented 2 months ago

That's why I said to use question.number as the context ID instead of hard coding it.

chrismgraham commented 2 months ago

Ahhh, got it!