numbas / editor

An editor for the Numbas e-learning system.
http://numbas.mathcentre.ac.uk
Apache License 2.0
59 stars 61 forks source link

Use a web worker to evaluate question variables #805

Closed christianp closed 10 months ago

christianp commented 10 months ago

When a question's variables take a long time to be generated, or have an infinite loop, the editor page can't be loaded, so the question can't be edited to fix the problem.

If we moved variable generation to a web worker, it would happen in a different thread and the editor would be usable while generation is happening. We'd also be able to interrupt the worker if it takes too long.

christianp commented 10 months ago

The difficult part is functions that produce HTML - there's no document in a web worker.

christianp commented 10 months ago

Well, this was a beautiful dream!