Test Algorithmic code and offer optimisation suggestions

Customer has mentioed that many Mobius users write inefficent code. Such code can contain, but isn't limited to:
- Multiple Maple calls
- Muliple condtional calls
- Inefficent nested loops
- Grading code that breaks for input which the user didn't consider

Such inefficent code works - Mobius won't give any error - but the loading times can be long. When this is scaled up in large exams, this can apparntly cause problems and compaints from students.

Mobius should give warnings of these things, so that the user is prompted to create efficent code.

It could start off as simple warnings - e.g. a script that string matches for the word 'maple' and determines if the code has too many refernces to maple, and then a little indicator in or near the algorthim that tells that to the user and expalins why this is bad, and how else they could do it (static example, not based on thier acual code).

There could also be a script that inputs a range of possible student inputs into the response area - either random values/ expressions, or a range defined by the user. There could then be a .csv export or similiar showing the input, where or not it was accepted, and any error it may have caused, and in what line of the code.


There could be some que system for this or batches of questions and summary reports afterwards - perhaps estimating some metrics of how the question performs at a small scale an on masse. Warnings would be given for questions that do not perform 'well'.

Such a system would catch bad questions before they go to students, and would make students and instrucotrs happier.



  • Lachlan Swain
  • Nov 26 2020
  • Future Consideration
  • Attach files
  • Michael Clasen Jacobsen commented
    1 Dec, 2020 10:41am

    This is relevant for both regular algorithm, maple graded questions, but also code running via maple mathapps with startup code. The test performed should consider both performance (possible simulation with x number of students as a que job) but also in general validate/debug the code. Math apps running in Maple, does not nessesarely behave the same way in Möbius/MapleNet.