MOODLE ALGEBRA QUESTION TYPE ---------------------------- This implements an *algebraic* question type for moodle. The student enters a formula. For example: * Suppose the right answer is `½ sin 2θ`. Then `sin(θ) cos(θ)` will be considered equally correct. * Suppose the right answer is `1/√(1-x^2)`. Then `cosh(asinh(x))` will be considered equally correct. This is a huge improvement over multiple choice. This is a light-weight plugin. It implements its own simple routines for parsing and evaluating expressions. It takes only a couple minutes to install and configure, if you already have a working moodle system. ### Principles of Operation The plugin tests the answer by evaluating it numerically and comparing to the desired answer specified by the teacher. The evaluation is performed at random points within a specified interval. (The code purports to provide other ways of evaluating formulas, but these are untested and unsupported.) There are ways of specifying multiple correct answers, for full or partial credit, if that's what you want. If a variable name spells out a Greek letter (e.g. `beta` or `Lambda`) it will be formatted as the corresponding letter (`β` or `Λ`). Variable names can have subscripts, e.g. `x_min` or `beta_3`. #### Input formatting: Express the inputs the way you would program in a computer language. Do not try to format or typeset the inputs. The plugin will show a formatted, typeset version. This is slightly helpful to confirm that the your input was understood, but mostly it's just cosmetic. The typeset version plays no role in the evaluations. ### Installation and Setup #### Install using git: To install using git:
:; cd $moodle/
:; git clone https://www.av8n.com/cgit/moodle-qtype_algebra/ question/type/algebra
:; echo '/question/type/algebra/' >> .git/info/exclude Then run the moodle update process. This may require you to install a bunch of php plugins that you heretofore didn't need. The update page will guide you through this. It should be visible at:
Site administration > Notifications For support, consider using the [Moodle quiz forum](https://moodle.org/mod/forum/view.php?id=737), which covers all Moodle question types (not just this one): [https://moodle.org/mod/forum/view.php?id=737](https://moodle.org/mod/forum/view.php?id=737) #### Requirements: For the display to work you need to have some way of displaying TeX expressions activated on your Moodle website: either the TeX filter or the MathJax filter enabled. Beware that there are thousands of web sites that give outdated or just plain wrong instructions for installing MathJax, so you may find it easier to rely on the builtin Tex filter. ### See Also There exists a much more heavy-weight solution to the same problem. It uses a fully-featured computer algebra system as its back end: [STACK question type](https://docs.moodle.org/311/en/STACK_question_type) [`https://docs.moodle.org/311/en/STACK_question_type`](https://docs.moodle.org/311/en/STACK_question_type) ### Colophon * Originally created by by Roger Moore * Updated to Moodle 2.0 by Stefan Raffeiner * Updated to Moodle 2.1 by Jean-Michel Védrine