Question types ::: qtype_stack
Maintained by Christopher Sangwin, TimTim Hunt
The STACK question type adds a sophisticated assessment in mathematics and related disciplines, with emphasis on formative assessment underpinned by computer algebra.
Latest release:
1588 sites
81 fans
Current versions available: 2

The STACK system is a computer aided assessment package for mathematics, which provides a question type for the Moodle quiz. In computer aided assessment (CAA), there are two classes of question types.

  • Selected response questions
    In these questions, a student makes a selection from, or interacts with, potential answers which the teacher has selected. Examples include multiple choice, multiple response and so on.
  • Student-provided answer question
    In these questions the student's answer contains the content. It is not a selection. Examples of these are numeric questions.

STACK concentrates on student-provided answers which are mathematical expressions. For example, a student might respond to a question with a polynomial or matrix. Essentially STACK asks for mathematical expressions and evaluates these using computer algebra. The prototype test is the following pseudo-code.

  simplify(student_answer-teacher_answer) = 0
  mark = 1,
  mark = 0.

STACK uses a computer algebra system (CAS) to implement these mathematical functions. A CAS provides a library of functions with which to manipulate students' answers and generate outcomes such as providing feedback. Establishing algebraic equivalence with a correct answer is only one kind of manipulation which is possible.

Using CAS can also help generate random yet structured problems, and corresponding worked solutions.

In STACK a lot of attention has been paid to allowing teachers to author and manage their own questions. The following are the key features.

  • Question versions are randomly generated within structured templates.
  • There are many different kinds of inputs. These are, for example, where the student enters a mathematical expression, or makes a true/false selection.
  • Mathematical properties of students' answers are established using answer tests within the CAS Maxima.
  • Feedback is assigned on the basis of these properties using a potential response tree. This feedback includes:
    1. Textual comments for the student.
    2. A numerical mark.
    3. Answer notes from which statistics for the teacher are compiled.

These broadly correspond to formative, summative and evaluative functions of assessment. Which of these outcomes is available to the student, and when, is under the control of the teacher.

  • Multi-part mathematical questions are possible: each question may have any number of inputs and any number of potential response trees. There need not be a one-to-one correspondence between these.
  • Partial credit is possible when an expression only satisfies some of the required properties.
  • Plots can be dynamically generated and included within any part of the question, including feedback in the form of a plot of the student's expression.


This plugin is part of set STACK.


Screenshot #0


Christopher Sangwin (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Tue, Mar 2, 2021, 12:02 AM
    Hello All, trying to install the Stack type on moodle3.9. I am a little confused during the install process.
    1. Is Yaml required?
    2. Can Maxima happily reside on the moodle server or is it best to install on it's own server?

    Please advise, I am a little more confused than usual!
  • Mon, Nov 8, 2021, 6:06 PM
    Is it possible to add that Stack 4.3.8 is suitable for Moodle 3.10 and Moodle 3.11 in the description of the version tab,please ? (my university refuses to install Stack because they think it's not adapted for Moodle 3.10).
  • Thu, Mar 10, 2022, 4:03 PM
    first of all: Great PlugIn, thanks for that.
    I´m trying to create some task using regression.
    In Maxima I can use lsquares:

    (%i201) load (lsquares)$
    M : matrix ([1, 1], [2, 7/4], [3, 11/4], [4, 13/4], [5, 20/4]);
    (%o201) matrix(
    [1, 1],
    [2, 7/4],
    [3, 11/4],
    [4, 13/4],
    [5, 5]
    (%i203) lsquares_estimates (
    M, [x,y], y=a*x^2+b*x+c, [a,b,c]);
    (%o203) a=3/28,b=43/140,c=13/20

    that does´nt work in Stack, even if i add lsquares to the libraries in the plugin setting in Moodle-Administation.
    Am I missing something or is the lsquares-library not supportet?

    Best rgards
  • Thu, Mar 10, 2022, 5:37 PM
    Ralf, we need to review libraries and add them one at a time:
    If you would like us to review and add a specific library in Maxima to STACK then please raise an issue on github and we can discuss it there with the other STACK developers.

    I'm sorry lsquares_estimates isn't available immediately, this is a reasonable request and expectation!
  • Tue, Mar 22, 2022, 8:18 PM
    I just started using Stack plug-in for Moodle and noticed a fault in integration of 1/x. The sollution should be ln(abs(x)) an not ln(x). Absolute value is missing.

    Thanks for the really good plug-in I'm enthusiastic about it

    Best wishes,

  • Tue, Mar 22, 2022, 8:59 PM
    Thanks for your interest in STACK. The issue with integrating 1/x, and the various options available to teachers, are documented here:
    STACK supports teachers accepting both log(x) and log(abs(x)) as different teachers have asked for each option. If the option you want does not already exist, please carefully explain what you need and raise an issue here on Github:
  • Thu, Jun 23, 2022, 5:59 PM
    Dear developers,
    I am currently beginning to use STACK and I am really excited. Many thanks for your wonderful work!
    Unfortunately my institution will update to moodle 4.0 and since the current version of STACK officially only works up to version 3.11 of moodle they refuse to install the STACK plugin.
    Does STACK actually work on moodle 4?

    Best regards
  • Thu, Jun 23, 2022, 6:39 PM
    The current version of the plugin has problems on Moodle 4.0. We've fixed the problems, but there is more testing to do. I'm planning to include support for Moodle 4.0 in the text release during the summer of 2022. We will support Moodle 4.0 soon.
  • Sun, Jul 31, 2022, 6:42 AM
    Good afternoon.

    Thank you for this great plugin, It basically change the way I teach and evaluate my students.
    I have a strange issue since the last update: the score of any question is assign incorrectly. For example, in a cuestionary with 3 questions with 6, 6 and 8 points respectively (20 points), random scores are assigned to each question so the total score could be more or less than 20. The same thing happens if Iry to recalculate the grade of past cuestionaries.

    Any advice would be welcome.

    Best regards
  • Wed, Aug 3, 2022, 11:34 AM
    Good evening.

    I think I know what is happening. In questions with multiple answers, no matter what score I assign to each answer, STACK always assign 1 point to each one. For example, if my question of 8 points has 4 parts with 20%, 20%, 30% and 30% score for each part, I set 2, 2, 3, 3 points in order to calculate these percentages; STACK assign 1 point to each part; therefore if a student answer the question correctly, the score he gets is (1+1+1+1)/(2+2+3+3) * 8 =3.2.

    If any of you gets the same behaviour please let me know.

    Best regards
  • Mon, Aug 22, 2022, 4:15 PM
    we have the same problem as Carlos. Moodle 3.11.8+ and STACK 2022071300.
    I will open a new issue on github.
  • Fri, Aug 26, 2022, 2:42 PM
    Good afternoon!
    Installed STACK plugins in MOODLE 3.11. Maxima is installed on a separate server. I can't connect STACK and Maxima. I did not find a step-by-step instruction on how to do this in the documentation (for beginners). What settings should be in maxim, what in the plugin... etc.
  • Wed, Aug 31, 2022, 1:08 AM
    Good afternoon.

    Christian Milani, the last update solves the issue.

    Best regards
  • Wed, Aug 31, 2022, 1:09 AM
    Good afternoon.

    I am reluctant to upgrade my Moodle to 4.0 version because of this excellent plugin. Anyone would be so kind to comment the use of Stack in Moodle 4.0.

    Best regards
  • Tim
    Mon, Sep 5, 2022, 7:41 PM
    Latest version of STACK works with Moodle 4.0 in our testing.
1 2 3 4 5 6
Please login to post comments