# GuidesToolsGraphChecker

GraphChecker is a Moodle (= OnCourse) plugin created by EdIn, which allows teachers to pose quiz questions with a graph as the answer. See also its website and project page for more background information.

In this guide, we will demonstrate how to create a GraphChecker question. Our requirements are as follows:

• The student should be shown the question Draw a DFA for the language $L = \{ (ab)^n \mid n \geq 1 \}$, using at most 4 states.
• The student should be able to draw their answer interactively as a DFA.
• The answer should be automatically graded, so that the student can get feedback immediately after submitting their answer. If the answer was correct, the student should be awarded 1 point; if it is incorrect (the DFA's language is incorrect, or the DFA contains too many states) then of course no points should be awarded.

### Step 1: Making a quiz

Open OnCourse, and go to your course. We will start by making a new quiz to contain the question.

Note GraphChecker questions can also be inserted into an existing quiz, possibly already containing other questions. In this tutorial we make a new quiz so that later, we will be able to demonstrate how changing the quiz settings affects the question's behavior.
• Click the Turn editing on button in the top-right corner.
• Click Add activity or resource.
• In the dialog, select Quiz and click Add. A form to edit the quiz will be shown.
• In the form, give the quiz some descriptive name. Then, under Question behavior, set How questions behave to Adaptive mode, and click Save and display.

### Step 2: Creating the question

You should now be on the quiz page.

• Click Edit quiz, and in the Add dropdown on the right, select a new question.
• In the dialog, select GraphChecker and click Add. A form to edit the question will be shown.

### Step 3: Editing the question

You should now be on GraphChecker's question edit form. We will fill it out section by section.

• Section General:
• For the Question name, you can pick any descriptive name for you to be able to identify the question later. This will not be shown to students.
• In the Question text box, fill in the question as shown to students: Draw a DFA for the language $L = \{ (ab)^n \mid n \geq 1 \}$, using at most 4 states. Note that you can freely use LaTeX in this field.
• We can skip the next few fields and go to Answer type. This tells GraphChecker which type of answer we are expecting the student to draw. Our question asks for a DFA, so we simply select DFA / NFA here.
• Section Student interaction:
This section contains some advanced settings to preload a partial answer into the student's answer box, and limit what the student can do with this preloaded answer. We do not need this for our question, so we will leave these settings alone for now.
• Section Checks:
Here, we tell GraphChecker how to automatically grade the question, by specifying a list of checks. A check can be seen as a function that is given the student's answer and returns true or false (plus optionally some feedback). To grade the question, GraphChecker will evaluate the checks one by one, and award points if and only if all checks return true.
• Our first check will be to limit the number of states. Click Add check, and in the dialog, under Structural properties, click the plus button next to State count.
• The State count check is now added to the list. Set the Maximum count to 4.
• Now we need a check to test if the student answer's language is indeed $\{ (ab)^n \mid n \geq 1 \}$. Click Add check again, and in the dialog, under Equivalence, click the plus button next to Language equivalence (to word list).
• The Language equivalence (to word list) check is now added to the list. The way this check works is it generates all accepted strings up until a given length. So, we set the Length to 8 and put all accepted strings until length 8 into the Word list field (that is ab,abab,ababab,abababab).
• Finally, we need to check if the student's answer is indeed a DFA (if we would omit this check, NFAs would also be accepted). Click Add check one more time, and in the dialog, under Structural properties, click the plus button next to Is deterministic.
This check does not need any settings.
In this section, you can draw a sample answer, which will be shown to the student if their answer was incorrect. This is optional, so we will leave this empty for now.
• Now click Save changes.

### Step 4: Testing

As the final step, we will test the question to see what it looks like from the student side.

• Click the preview icon for the question. This will launch the question, just as if a student would see it when taking a quiz.
• Draw a correct answer (see the screenshot below; you can press the help button in the top right of the drawing widget if you need help with the drawing tools) and click Check.
• Click Check, and if everything went well, you will see that both checks passed, marking the answer correct.

### Conclusion

If you have followed along, we hope that you now have a good understanding of how GraphChecker works. Feel free to experiment with the other answer types and checks available, and with the advanced features that we skipped over in this guide. (Each field in the question editor has a question mark icon, which provides context-sensitive help.)

If you are stuck or have a question, please contact Arthur van Goethem or Willem Sonke. We can assist you if you run into problems, or if you need to extend the set of checks available.