# Algebra

Question types ::: qtype_algebra
Maintained by Jean-Michel Védrine
Question type where the student must answer by typing an algebra formula. Correctness can be checked by three different methods.
Latest release:
611 sites
27 fans

MOODLE ALGEBRA QUESTION TYPE
Created by Roger Moore

Algebra based question type for Moodle.

This plugin implements an algebraic question type where student responses are treated as an algebraic expression and compared to instructor provided answers using the basic rules of algebra.

### Contributors

Roger Moore: Original Author

### Awards

• Mon, Apr 11, 2016, 1:06 AM
Hello!

Thanks for your great plugin! I sometimes get the following error displayed:

Notice: Undefined property: qtype_algebra_parser_bracket::$_sign in /path_to_moodle/question/type/algebra/parser.php on line 896 Notice: Undefined property: qtype_algebra_parser_bracket::$_sign in /path_to_moodle/question/type/algebra/parser.php on line 1339 Notice: Undefined property: qtype_algebra_parser_bracket::$_sign in /path_to_moodle/question/type/algebra/parser.php on line 896 Notice: Undefined property: qtype_algebra_parser_bracket::$_sign in /path_to_moodle/question/type/algebra/parser.php on line 1339

We use Moodle 3.0.2

Any suggestions?

Dear,
Berni
• Fri, Sep 2, 2016, 4:06 PM
Dear all,

Since the upgrade to moodle 3,0 , we get the same error message as Bernhard Piazzi (above) so that most algebra questions won't work any more on our site:

As soon as there is a parenthesis in the answer of the student (example 8*(4x−3) ) we get this error message:

"Notice: Undefined property: qtype_algebra_parser_bracket::$_sign in /var/www/moodle-3.1.1plus/question/type/algebra/parser.php on line 896" (or sometimes "line 1339") If somebody came accross this same problem and were able to solve it, could you please help me ? We have no moodle developper on our site and without your help our hundreds of algebra questions are just going to get lost ! Many thanks in advance! Sophie • Sat, Sep 10, 2016, 12:00 AM Dear all, a friend helped me with the above problem (Notice: Undefined property: qtype_algebra_parser_bracket::$_sign in /var/www/moodle-3.1.1plus/question/type/algebra/parser.php on line 896" (or sometimes "line 1339"))
I'll try to translate the solution:

A variable was not initialized ($_sign) in the constructor of the class qtype_algebra_parser_bracket. To correct this you have to modify the file : question/type/algebra/parser.php (line 1309) and add an initializing line : function qtype_algebra_parser_bracket($text) {
parent::qtype_algebra_parser_term(self::NARGS,self::$formats[$text],$text);$this->_sign=''; // line added
$this->_open=$text;

I hope it helps if you come accross the same problem.
Sophie
• Sun, Jan 22, 2017, 6:51 PM
With debug on, this message appears:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; qtype_algebra_parser_term has a deprecated constructor in ....... /question/type/algebra/parser.php on line 53
• Fri, Mar 10, 2017, 2:43 AM
Hello!

I would like to get my students to answer the question with a simplified answer. The easiest way would be to limit the length of their answer. Is there a way to do this?

Bernhard
• Mon, Mar 13, 2017, 5:12 PM
Moodle 3.2.2:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; qtype_algebra_parser_term has a deprecated constructor in
..\server\moodle\question\type\algebra\parser.php on line 53
• Wed, May 17, 2017, 1:58 AM
algebra class has always been an issue for my kids; they are currently practicing with this algebra tutor https://www.studypug.com/algebra-help - but I want to give your tool a shot. thanks for your work.
• Fri, Sep 15, 2017, 3:28 PM
Dear Jean-Michel,

Is there any chance qtype_algebra will receive an update to support recent moodle versions like 3.3?

In my php7/moodle3.3 installation i get lots of warnings in my webserver log about PHP deprecation issues, plus periodic 502's, especially checking answers or "trying again"...
• Fri, Sep 15, 2017, 7:55 PM
Hello,
I am now retired and I stopped all Moodle activities. This plugin is now seeking for a new maintainer.
• Sat, Dec 16, 2017, 4:33 AM
Hi,

I just wanted to report a bug to the new or future maintainer.

I noticed that we cannot accede the statistics of any test including algebra questions. Indeed, once a student have typed a formula to answer an algebra question, the statistics page will turn white (such as the bug report). This occurs even if the students make no syntactic mistake. On the contrary, if all the students type "0" instead of the formulas, the statistics will normally be displayed.

The problem may be due to the fact we are using a 3.3 version of Moodle and the algebra plugin we installed is made for 2.8, 2.9 and 3.0 versions of Moodle (but except for the statistics, it works perfectly with our 3.3 version).

Anyway, I just wanted to report.

Regards
--
Camille
• Sun, Dec 17, 2017, 9:19 PM
Hello to all,
Despite been retired I was puzzled by the bug reported by Camille Carlier. So I decided to fix it.
I will release a new version that will fix this bug, and also the problem related to deprecated constructors names and the problem about undefined property \$_sign.
But please don't take this as a commitment to further maintain that plugin
• Fri, Dec 22, 2017, 11:40 PM
Hi Jean-Michel,
Thank you very much for your intervention despite you have retired. All work just fine now.
Happy holidays
--
Camille
• Sun, Feb 4, 2018, 6:25 PM
I am about to release a new version of the algebra question type with a change in the display during question attempt, there is now a setting in Administration to choose between 2 methods to display the formula : the old one with a button and the formula displayed in an iframe, and a new method without any button where the formula is updated dynamically when the student type an answer (MathJax filter required). As the old method is still here and is the default, nothing will change when you upgrade but you can try the new display if you want.
• Tue, Apr 16, 2019, 11:23 AM
Dear Jean-Michel,

Thanks for this great plugin. It's very useful for me. The only thing is that right now it's possible to have only one answer. Is it possible to have multiple answer boxes? thanks again.
• Wed, May 6, 2020, 7:31 PM
A great plugin, such a shame if it is not maintained.