# Moodle 1.9 Math Quizzes: Part 3

## Ian Wild

November 2009

### Using STACK

My original problem was this: how can I ask my students to expand (x+4)(x-3) and have Moodle automatically mark my students' answers—hopefully with an answer equivalent to x2+x-12. Let's create that question now.

### Creating a STACK question

1. Click on the Create new question drop-down menu and choose Opaque:

2. On the Add Opaque Question page, click on Manage Stack Questions:

3. A new window (or tab, depending on your browser) is opened. On the Questions available from STACK question engine page, click on the New Question link:
4. Give your question a name (suitable for you to be able to find it again and know what the question is when you do).
5. Write your question in the Question Stem. You need to be careful with the format: math notation can be written in LaTeX (denoted, in my case, with single dollars). Note how I've specified a variable for the student's answer (#answer#). You can call this variable whatever you like, as long as you enclose it in #:

6. Scroll down to the Update button immediately under the Question Note option and click on it:

7. An Interaction Elements section is now inserted into the page. You will need to specify the answer in the Teacher's Answer row. Be careful with the format as it has to be a valid CAS expression (for example, 3x should be specified as 3*x). When you have filled in your answer, click on the Update button at the bottom of this section:

8. We've asked the question and specified our answer. We now need to program STACK to understand whether or not the student's answer is correct. In the Potential Response Trees block, specify a name for the response and press the + button:

9. The student's answer is stored in the variable answer. My answer needs to be specified in the TAns (teacher's answer box). As this is the correct answer, I can copy and paste from the Teacher's Answer in the Interaction Elements box. Notice that the Answer test is AlgEquiv (algebraic equivalents):

10. Now, click on the Update button at the bottom of the Potential Response Trees section.
11. A common mistake when expanding brackets is to forget to multiply out completely (typically submit x2-12 as the answer). Let's accommodate this now in the Potential Response Trees. Add another PR (potential response) by choosing to add 1 new potential response from the drop-down list and clicking the Add button:

12. Populate the new potential response with the incorrect answer and some feedback. Remember to ensure that they aren't awarded a mark for getting the answer wrong:

13. We now have two nodes in the Potential Response Trees that we need to link together. From the actual correct answer response (node No: 0), click on the Next PR drop-down in the false block and choose 1:

14. Can you see how we are linking potential responses together to form a tree of nodes? Click on the Update button at the bottom of the Potential Responses section to save your changes.
15. Scroll down to the bottom of the page, and click on the Save button:

16. The page reloads, and if we have specified everything correctly, then we now have the opportunity to try our new question. Click on Try question:

17. Try specifying different answers to see how Moodle responds. Make sure any feedback you specified is displayed correctly:

18. When you have finished testing, click on the Finished button at the bottom of the page.
• The next step is to deploy the question in order for us to include it in a quiz. On the Questions available from STACK question engine page, click on the Deploy link:
• The question is now deployed:

• Close the STACK question configuration window (or tab, depending on your browser) and return to the Add Opaque Question page. Refresh the page in your browser. Our new question will be listed in the Question Name drop-down list. When you have your STACK question selected, give the Moodle question a name:

• Save the changes by clicking on the Save changes button.
• That's it! We're done.

We are now ready to add this question into a quiz. If you haven't read them already, you'll find the details on this process earlier in this article in the Adding a math quiz section. Here is how my question looks:

### Enhancing STACK questions—graphs, charts, and random variables

Although not immediately obvious, you can certainly include images and graphs in your Question Stem. Here is an example of a Google chart included in the stem:

Here's how it looks when included in a Moodle quiz:

Remember that we needed to install GNUPLOT on the server. This is because we can also plot functions in the stem using special commands. Here's another example (from the STACK sample questions):

This will be displayed as the following:

From this example, you can see how easy it is to include HTML in the stem text. For more details on what you can include in the stem, visit http://stack.bham.ac.uk/wiki/index.php/CASText.

You can also include random variables in your questions. Check out http://stack.bham.ac.uk/wiki/index.php/Authoring_quick_start for more information on random questions.

## Getting more help with STACK

For extra help with STACK don't forget to check out the STACK Wiki at http://stack.bham.ac.uk/wiki/index.php/Main_Page. There is also a STACK Moodle at http://www.stack.bham.ac.uk/ that is well worth visiting.

Currently, the Feedback module is an optional module. You will need to visit http://moodle.org/mod/data/view.php?d=13&rid=95 to download the correct package (depending on the version of Moodle you have installed). Let's run through the process:

1. Remember to enable Maintenance mode when installing new features into your Moodle. From the Site Administration block, select Server | Maintenance mode. You can also specify an optional maintenance message:

3. Once the files have been copied over, make sure file permissions and file ownership are set correctly.
4. Once the Feedback module files have been copied over, we need to return to the site' front page and click on Notifications in the Site Administration block:

5. Moodle will now update its internal database, creating all the tables required for the new module. Because we are installing both a new activity and a new block, there are two sets of tables Moodle needs to configure. As Moodle configures its internal database, click on the Continue button when required:

6. Once Moodle has finished configuring its internal database, visit any course and turn on the editing. Click on any Add an activity drop-down menu, and you will see that a new Feedback activity has been added to the list:

7. Likewise, click on the Blocks block, and you will see that a new Feedback block has been added to the list of available blocks:

Did you remember to enable maintenance mode? We need to remember to disable it through the Site Administration block and the Server  Maintenance mode| link.

The Feedback module is now ready to use.

# Summary

In this article, we learned how to include math quizzes in our Moodle courses. Specifically, we covered these topics:

• How to create a Moodle quiz. We investigated both the calculated and numerical question types (extremely useful for math teaching).
• How to install and use the Feedback module.
• How to install and integrate STACK into Moodle.
• How to create algebra questions that can be automatically marked using STACK.

We saw how Moodle is great for creating and marking questions automatically. There is a potential problem with Moodle not being able to properly understand the commutative and associative properties (especially when it comes to algebraic structures), but we installed STACK to address this issue.

[ 1 | 2 | 3 ]