General developer forum

How to properly add new mathematical functions?

Tim at Lone Pine Koala Sanctuary
Re: How to properly add new mathematical functions?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

I think most people doing serious maths in Moodle tend to use add-on question types such as STACK ( or Formulas question type ( You might want to take a look at those.

However, that is no reason not to improve the core calculated question type. I don't know exactly the right way to do it, at least not without further thought. You are certainly asking the right questions: thinking about how best to fit in with the existing code is certainly the way to start. Another thing I would encourage you to do early on is to find whatever unit tests already exist for this code, and think about what tests you should add for the new functions. That would be a good way to define exactly what it is you plan to implement.

I will try to have a look at the code myself, tomorrow, to see if I can give a more helpful answer.

Average of ratings: Useful (2)
Picture of Marcus Green
Re: How to properly add new mathematical functions?
Core developersParticularly helpful MoodlersPlugin developersTesters

If you are considering those two alternative question types I can summarise them as 


Self contained, powerful and and very useful


Requires more technical knowledge and the setting up of other services.

The ultimate Maths quizzing system bar none free or paid for.

Average of ratings: Useful (1)