Difference between revisions of "Algebra filter"

Jump to: navigation, search
(Changed to another reference about TeX. The one given was more about how to write in a Wiki.)
 
(17 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Moodle has a wonderful "algebra filter" which can easily make mathematical expressions in classic layout. The filter is included in the standard Moodle packages. The administrator must activate it though before you can use it.
+
{{Improve}}
 +
{{Filters}}
 +
'''Note:''' Although the Algebra filter is included in Moodle, it is recommended that you use the [[MathJax filter]] for writing Mathematical equations and expressions.
  
I personally think that students should be taught to recognize and use expressions that can be written in one line just the same as one enters them in a spreadsheet or when entering on a calculator. Having that ability also increases the ease of making interactive math problems.
+
==Generally==
  
The algebra filter can take expressions written in that way (like you would enter them in a spreadsheet cell) and display them the way we usually write them by hand or in math books. You simply surround the expression with double @:
+
Moodle has an  "algebra filter" which can display mathematical expressions as if they were typeset. The filter is included in the standard Moodle packages but the administrator must activate it before you can use it.
  
@@y=(x+2)^2/(3x)@@
+
'''NOTE:''' the use of the algebra filter '''REQUIRES''' that the Moodle Tex filter also be working as the algebra filter simply parses math expressions in one syntax and then converts the expressions to LaTex expressions for the Tex filter to render and display. The filter uses a borrowed perl script
  
@@cosh(x,2)-sinh(x,2)=1@@
+
The filter (see http://cvs.moodle.org/moodle/filter/algebra/ ) uses algebra2tex.pl, a perl script (and its associated perl module, AlgParser.pm) to parse text expressions delimited by double@ signs as tokens (though the tokens employed can be tweaked manually.)
  
Unfortunately this Moodle Docs Site doesn't have the algebra filter so you can't see here how nice they look. (There is a LaTeX math formula button in the wiki editor, but it doesn't recognize TeX or Algebra filter expressions, and I don't find any docs for THAT either!)
+
NOTE perl script REQUIRES '''Perl'''. This is no problem with most Linux servers, but may be the cause for malfunctions in the Win world like broken connections. Exceptions / failures are NOT catched and reported via this Moodle filter.
 +
If there is no Perl available, activate Moodle Tex (as mentioned above) and use the JAVA Math Formula Editor. It is available after activating Tex. Minor corrections in the resulting Tex code dont need deeper digging in Tex fundamentals.
  
For more advanced expressions that the algebra filter doesn't cope with there is the TeX filter that can basically do any math expression. The syntax there is more complicated. and the expressions are surrounded (in Moodle) by double $. Here is a good reference about TeX notation: http://www.artofproblemsolving.com/LaTeX/AoPS_L_GuideSym.php
+
While many have argued that the algebra filter is easy to use, there is apparently no Moodle reference on its "grammar" or "syntax". Research in to Webworks produced these two links for using webworks text expressions (the first one is arguably replaced by the second):
  
(The algebra filter is actually a simplified front end for a TeX engine)
+
* http://webwork.math.rochester.edu/docs/docs/pglanguage/availableFunctions.html (no longer available.)
 +
* http://webwork.maa.org/wiki/Mathematical_notation_recognized_by_WeBWorK  (the connection is not clear.)  
  
There are some Moodle Glossaries: one with algebra and TeX and several with only TeX examples (in several languages) here:
+
See http://moodle.org/mod/forum/discuss.php?d=126522&parent=554632.
http://moodle.org/mod/glossary/view.php?id=2739&mode=letter&hook=M&sortkey=CREATION&sortorder=asc
 
  
==See also==
+
There is a discussion of Algebra filter syntax at http://moodle.org/mod/forum/discuss.php?d=5402 offered by [http://moodle.org/user/view.php?id=2466&course=5 Zbigniew Fiedorowicz].
*Discussions: please create or find a discussion topic in the [http://moodle.org/mod/forum/view.php?f=130 Mathematics tools forum].
+
 
 +
It appears that as of Moodle.org moving to Moodle 2 (late 2010) the Algebra filter in the forums is no longer working. It also appears that the Algebra filter does not work in Moodle Docs (which is not Moodle code, but MediaWiki, which I don't believe has a ready filter based on algebra2tex.pl.
 +
 
 +
==Troubleshooting==
 +
The file algebradebug.php is provided in the filter folder for the purpose of debugging. Problems may arise comes from the first tags in algebradebug.php
 +
 
 +
  define('NO_MOODLE_COOKIES', true); // Because it interferes with caching
 +
 
 +
You can delete the line or set it to false.
  
[[Category:Filter]]
 
 
[[Category:Mathematics]]
 
[[Category:Mathematics]]
 +
 +
[[fr:Filtre Algebra]]
 +
[[es:Filtro de álgebra]]

Latest revision as of 15:54, 5 May 2014

This page really needs improving. Please see the page comments for suggestions of what to include, then remove this template when you're done.

Note: Although the Algebra filter is included in Moodle, it is recommended that you use the MathJax filter for writing Mathematical equations and expressions.

Generally

Moodle has an "algebra filter" which can display mathematical expressions as if they were typeset. The filter is included in the standard Moodle packages but the administrator must activate it before you can use it.

NOTE: the use of the algebra filter REQUIRES that the Moodle Tex filter also be working as the algebra filter simply parses math expressions in one syntax and then converts the expressions to LaTex expressions for the Tex filter to render and display. The filter uses a borrowed perl script

The filter (see http://cvs.moodle.org/moodle/filter/algebra/ ) uses algebra2tex.pl, a perl script (and its associated perl module, AlgParser.pm) to parse text expressions delimited by double@ signs as tokens (though the tokens employed can be tweaked manually.)

NOTE perl script REQUIRES Perl. This is no problem with most Linux servers, but may be the cause for malfunctions in the Win world like broken connections. Exceptions / failures are NOT catched and reported via this Moodle filter. If there is no Perl available, activate Moodle Tex (as mentioned above) and use the JAVA Math Formula Editor. It is available after activating Tex. Minor corrections in the resulting Tex code dont need deeper digging in Tex fundamentals.

While many have argued that the algebra filter is easy to use, there is apparently no Moodle reference on its "grammar" or "syntax". Research in to Webworks produced these two links for using webworks text expressions (the first one is arguably replaced by the second):

See http://moodle.org/mod/forum/discuss.php?d=126522&parent=554632.

There is a discussion of Algebra filter syntax at http://moodle.org/mod/forum/discuss.php?d=5402 offered by Zbigniew Fiedorowicz.

It appears that as of Moodle.org moving to Moodle 2 (late 2010) the Algebra filter in the forums is no longer working. It also appears that the Algebra filter does not work in Moodle Docs (which is not Moodle code, but MediaWiki, which I don't believe has a ready filter based on algebra2tex.pl.

Troubleshooting

The file algebradebug.php is provided in the filter folder for the purpose of debugging. Problems may arise comes from the first tags in algebradebug.php

define('NO_MOODLE_COOKIES', true); // Because it interferes with caching

You can delete the line or set it to false.