numbas / numbas-lti-provider

An LTI tool provider to run Numbas exams
https://docs.numbas.org.uk/lti/en/latest/
Other
11 stars 12 forks source link

Fix standalone scripts when automatic remarking #230

Closed georgestagg closed 2 years ago

georgestagg commented 2 years ago

Standalone scripts are loaded relative to the exam's extracted_url.

When remarking, execute pre-submit promises sequentially rather than in parallel. The pre-submit cache is now also cleared.

christianp commented 2 years ago

Overriding getStandaloneFileURL is the right thing to do, I think, but I think that it would be best to give just the root of the exam's URL, and add extensions to it in JS. Django has a mechanism for making a script tag containing json data, which should be more robust than interpolating into JS in the template like you've done here.

It's not a good idea to make all pre-submit tasks run sequentially. The programming extension should manage its own queue of code to run, but that shouldn't mean holding up any other tasks.

georgestagg commented 2 years ago

I've removed the changes to the promises and have switched to using Django's json_script in the remarking template.

I'll take a look at implementing the sequential execution in the programming extension later today.

christianp commented 2 years ago

Looks good, thanks!