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
Return to your course’s front page and, from the course administration block, click on Questions to open the course question bank. Then, follow these steps:
- Click on the Create new question drop-down menu and choose Opaque:
- On the Add Opaque Question page, click on Manage Stack Questions:
- 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:
- Give your question a name (suitable for you to be able to find it again and know what the question is when you do).
- 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 #:
- Scroll down to the Update button immediately under the Question Note option and click on it:
- 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:
- 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:
- 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):
- Now, click on the Update button at the bottom of the Potential Response Trees section.
- 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:
- 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:
- 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:
- 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.
- Scroll down to the bottom of the page, and click on the Save button:
- 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:
- Try specifying different answers to see how Moodle responds. Make sure any feedback you specified is displayed correctly:
- When you have finished testing, click on the Finished button at the bottom of the page.