Documentation for Moodle STACK and Maxima

I found that authoring questions in STACK requires a relatively steep learning curve. The main reason is that STACK exposes the Maxima Computer Algebra System, and its command set which is ‘ALGOL-like‘. This is was very unfamiliar on first look but has elements which I recognised, having programmed in the R statistical language.

The following documentation sources have been invaluable in writing effective STACK questions:

  1. Plug-in overview on Moodle.org
  2. Documentation which installs with the Moodle Plug-in. This will be installed on any system running STACK. It’s easiest to view on GitHub.
  3. Documentation for Maxima on its’ SourceForge home site
  4. Maxima syntax documentation summary. Some of the guide is for interactive mode, but it shows how to craft expressions for your model answer and and potential response tree.
  5. Moodle’s LaTeX summary. Note that the \[ … \] markers are preferred to the $$ … $$ markers in STACK questions.

I also found it useful to install wxMaxima to use on my Ubuntu Linux box.

Moodle STACK installation on Ubuntu LTS

We’re investigating algebraic maths questions in Moodle at the moment. One of the question type plugins is STACK.

I tried to install the STACK question type plug in but it wasn’t working. The error was “CAS failed to return any data”.

The CAS is a Computer Algebraic System. In this case it is Maxima. Our server is Ubuntu. The latest Long Term Support version available is 14.04 Trusty. The default Maxima package for Trusty is Maxima 5.32. The minimum requirement is 5.25.1 but it wasn’t working for me. I decided to upgrade after a test on my local system.

I looked for a Launchpad repository which I could use for a prebuilt package to upgrade with. There are RPM files on the sourceforge homepage (for Red Hat) but no debs for Ubuntu.

The only option was to build the package from source.

Steps:

  1. install Ubuntu package dependencies: automake; clisp; gnuplot; texi2html and texinfo. The latter two are for the help files.
  2. remove currently installed version of maxima
  3. open the installation instructions for building from source
  4. clone using git command in their repository or download from source. Remember that the latest version supported by the Moodle plugin is 5.36.0
  5. go to the healthcheck <moodle_home>question/type/stack/healthcheck.php
  6. purge cache and check that all the tests complete successfully

Our implementation of the STACK question type now accepts the simple test question shown in the authoring guide.

mysqldump all databases from XAMPP on Windows

A quick note to hopefully save others the time I’ve just wasted. If you want to dump out all your databases, perhaps in preparation for an upgrade to XAMPP as I’m about to try:

  1. Open up a command prompt (in Win 8+ type ‘Command’ and press <Enter> from the Start screen);
  2. Type:
    cd\xampp\mysql\bin

    (or wherever your myslq.exe is located)

  3. Type:
    mysqldump --user=root --password=myrootpwd --all-databases > backup.sql

Other options for this command can be found on the MySQL site.

Note that you are doing this from the Windows Command prompt – don’t get distracted, as I was, by running the MySQL command line tool. If you try and run mysqldump from the:

mysql>

prompt, you’ll get various syntax errors such as:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual thatĀ corresponds to your MySQL server version for the right syntax to use near 'mysqldump...' at line 1

However, if running the MySQL command line tool is what has brought you to this post, you launch this by following steps 1 & 2 above and then typing:

mysql --user=root --password=myrootpwd

When executing commands at the:

mysql>

prompt, don’t forget that it allows you to enter multiple lines at once and that clicking <Enter> will just give you a new line unless you finish your line with a semi-colon – this will tell MySQl that you want to execute the command.