Introducing the GraphUI

If you wish to run these questions, please log in with:
Username: trial
Password: trial

Usually CodeRunner questions ask students to submit program code. For such questions the student answer box is "wrapped" by the Ace code editor, which provides basic facilities like auto-indent and syntax colouring. However, CodeRunner now supports pluggable JavaScript UI components which can wrap the student answer box in other ways to produce different user interfaces such as tables and graphs. This page demonstrates the GraphUI, which allows question authors to ask students questions for which the answer is a graph, in the computer science sense.

The GraphUI was originally developed by Emily Price for use in a theory of computer science course in which students were asked to provide textual representations of finite state machines and Turing machines. The GraphUI provides a much more friendly interface for such questions, e.g.

GraphUI screen shot

The student's answer is presented to the question template in a Python-compatible serialised form that includes the geometric information as well as the graph connectivity and labelling. For example, the serialised version of the above graph (with some formatting tweaks) is:


At any time when using the GraphUI the question author (or a student) can view this serialisation by typing Ctrl+Alt+M

The template must then grade the answer, usually ignoring the geometric information.

The set of built-in question types includes simplified question types Directed graph and Undirected graph which present the question author with just an adjacency list representation of the graph as a Python dictionary.

The following question lets you play with a Directed Graph question type. Here is the Moodle XML export of that question.

Zuletzt geändert: Mittwoch, 15. Februar 2023, 11:31