STACK 3.2, moodle 2.7, tex filter

STACK 3.2, moodle 2.7, tex filter

by Pablo Triviño Rodríguez -
Number of replies: 6

Hi,

I installed locally STACK 3.2 correctly in moodle 2.7. The healthcheck script works correctly.

MathJax does not correctly display the expressions (only in STACK). You need to install the filter tex but then MathJax not working anywhere.

What is the correct configuration?

Average of ratings: -
In reply to Pablo Triviño Rodríguez

Re: STACK 3.2, moodle 2.7, tex filter

by Daniel Thies -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Are you using the MathJaxloader filter that is supplied with Moodle 2.7?  STACK is written to work with MathJax included in the page header.  There are instructions for doing this in the healthcheck. MathJaxloader is new in 2.7, and it is not necessarily designed to work with STACK.  It has some idiosyncracies when working with interactive features, and may require some extra code to get it to work. 
If you do want to use MathJaxloader, you can enable it on the rest of the site and make TeX notation filter "Off, but available" in the filter admin settings.  In a quiz using STACK, MathJaxloader can be disabled and Tex notation enabled in the Course administration settings for just that activity.
In reply to Daniel Thies

Re: STACK 3.2, moodle 2.7, tex filter

by Pablo Triviño Rodríguez -

Thanks,

included code int he page header. Mathjax work fine, but STACK should use Mathjaxloader filter with moodle 2.7+ in the future. Do not you think?


In reply to Daniel Thies

Re: STACK 3.2, moodle 2.7, tex filter

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Daniel, Pablo,

I've just been looking at STACK in Moodle 2.7, and I'm not at all familiar with the MathJaxloader.  Putting the mathjx scripts into the additional HTML was a bit lazy, and I'll certainly try to make sure STACK conforms with default settings in Moodle.  The whole point of using MathJax was not to have to worry about displaying maths myself, and I'll try to ensure the future design of STACK has the minimum number of differences or extra settings.

So, yes, I will look at the loader and use it if STACK can be modified to do so.

Chris


In reply to Daniel Thies

Re: STACK 3.2, moodle 2.7, tex filter

by Daniel Thies -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I looked at some of the mathematics display code in STACK, and the second method I suggested above may not work.  STACK seems to check that the TeX filter is enabled on the system level.  It does not check the local context.

STACK requires custom code for each Moodle filter to set some of the filter configuration. Since  mathjaxloader is new it will require some support code to work. Mathjaxloader does some formatting with PHP (removes $$) before it loads the javascript so it will need to be treated like a PHP. It also requires signal to typeset every time content is loaded by AJAX (yui/input.js).

In reply to Daniel Thies

Re: STACK 3.2, moodle 2.7, tex filter

by Jean-Marc Roy -

Comments:

This is my configuration:

System: Fedora 20 Stack 3.2
Moodle 2.7.1 Maxima 31.3-1 clisp 2.49-12
Apache 2.4.9-2 MariaDB 5.5.38-3 php 5.5.14-1

Here are the steps required to install stack once the packages were installed. My main problem was connecting with maxima.

CAS 01:

I first run in vain using /usr/bin/maxima:

Platform: Linux

CAS Timeout 15 s

Maxima command: /usr/bin/maxima


RESULTS 01:

Uncached CAS call

CAS failed to return any evaluated expressions. Please check your connection with the CAS.CAS returned some data as expected, but there were errors.

CAS 02:

After installing clisp, I then try /usr/bin/maxima -l clisp -u 5.31.3 -q

Platform: Linux

CAS Timeout 15 s

Maxima command: /usr/bin/maxima -l clisp -u 5.31.3 -q


RESULTS 02:

Uncached CAS call

CAS returned data as expected. You have a live connection to the CAS.


But I received a bunch of warning

WARNING: DEFUN/DEFMACRO: redefining function TEX-MQUOTIENT in
     /var/www/moodle/web/question/type/stack/stack/maxima/stacktex.lisp, was defined in
      /builddir/build/BUILD/maxima-5.31.3/src/binary-clisp/mactex.fas
WARNING: DEFUN/DEFMACRO: redefining function TEX-PREFIX in
     /var/www/moodle/web/question/type/stack/stack/maxima/stacktex.lisp, was defined in
     /builddir/build/BUILD/maxima-5.31.3/src/binary-clisp/mactex.fas
WARNING: DEFUN/DEFMACRO: redefining function TEX-STRING in
     /var/www/moodle/web/question/type/stack/stack/maxima/stacktex.lisp, was defined in
     /builddir/build/BUILD/maxima-5.31.3/src/binary-clisp/mactex.fas
WARNING: DEFUN/DEFMACRO: redefining function TEX-DERIVATIVE in
     /var/www/moodle/web/question/type/stack/stack/maxima/stacktex.lisp, was defined in
     /builddir/build/BUILD/maxima-5.31.3/src/binary-clisp/mactex.fas
WARNING: DEFUN/DEFMACRO: redefining function TEX-D in
     /var/www/moodle/web/question/type/stack/stack/maxima/stacktex.lisp, was defined in
     /builddir/build/BUILD/maxima-5.31.3/src/binary-clisp/mactex.fas
WARNING: (SETF FIND-CLASS): redefining class MRING in
     /usr/share/maxima/5.31.3/share/linearalgebra/mring.lisp, was defined
      in /builddir/build/BUILD/maxima-5.31.3/src/binary-clisp/numth.fas

CAS 03:

Using the command

[root] /usr/bin/maxima -l clisp -u 5.31.3 -q


at the terminal, I then followed the optimization directives

(%i1) load(" var="" www="" moodle="" data="" stack="" maximalocal.mac");
  WARNING: (same as above)
   ...
(%o0)"/var/www/moodle/data/stack/maximalocal.mac"
(%i1) :lisp (ext:saveinitmem "/var/www/moodle/data/stack/maxima-optimised.mem" :init-function #'user::run)
  Bytes permanently allocated: 165,312
  Bytes currently in use: 14,767,936
  Bytes available until next GC: 3,691,704
  14767936
  3691704
  165312
  16 44510296
  205000
(%i2) quit();


the file
-rw-r--r--. root root unconfined_u:object_r:httpd_sys_rw_content_t:s0 maxima-optimised.mem

was added to the folder /var/www/moodle/data/stack. I then search for lisp.run

[root] find / -name lis.run
  /usr/lib64/maxima/5.31.3/binary-clisp/lisp.run
  /usr/lib64/clisp-2.49+/base/lisp.run



and used it for my third attempt

Platform: Linux optimize

CAS Timeout 5 s

Maxima command: /usr/lib64/maxima/5.31.3/binary-clisp/lisp.run -q -M /var/www/moodle/data/stack/maxima-optimised.mem

gave


RESULTS 03:

Uncached CAS call

CAS returned data as expected. You have a live connection to the CAS.

And no more warning! Wonderfull!! I just tought I should include theses lines as I would have liked to found them somewhere on this site.


TEX-Filter: Finally a question

When I put \\( \\) as latex boundary, the text is not interpreted. But @ @ work! Should I use the later in the meantime. Thanks!

In reply to Jean-Marc Roy

Re: STACK 3.2, moodle 2.7, tex filter

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank you for pursuing this and posting the results.

Actually, because I'm spending the summer working on questions to use with students, I've slipped behind with checking Maxima versions, so you are a little ahead of me here.  I'll try to make sure I check Maxima 5.31.3 before the next teaching session starts in Sept.

I'm also going to try to streamline the process of creating the optimised memory image, but this might have too many server specific settings to work reliably.  I'll try.

Chris