I am not a math teacher (at all) and there may be many different ideas of what an algebra question should be. However I have installed and got this question type to work in the past
http://docs.moodle.org/24/en/Algebra_question_type
https://moodle.org/plugins/view.php?plugin=qtype_algebra
The author is a major contributor to all things Moodle. Make sure you have MathJax installed if you are going to use all those funny math symbols.