Posted by & filed under Moodle.

I’ve been using my unittest Moodle question type pretty much since the beginning of this school year. But a couple of things have been bothering me as I watch students work on code problems.

The first is that their only feedback for a failed JUnit test was the stacktrace that JUnit kicks out. For students new to programming, that is both intimidating and almost totally worthless. So, I went in and parsed out the failure messages and now they’re displayed in a table with just the message about what was expected and what was returned.


Next, the plugin that I used as a starting point had a field on the question editing page where you entered the name of the JUnit test class. But you didn’t have to do that for the student class file because the student’s file would be parsed to pull out the class name. Went in and did the same thing for the JUnit test classname and removed the field.

And last was something really trivial, but one that bothered me more than it should. When the ace editor loaded it was scaled to the height and width of the textarea it was replacing. Worked great, until the student resized their browser. So a bit of CSS and the editor window is always 100% of its container.

Pushed an update to GitHub a few minutes ago and uploaded it to my Moodle server. Haven’t had a chance to test it live with students yet since it’s Saturday, but we’ll give it a kicking on Monday and see how it goes.

Leave a Reply

Your email address will not be published. Required fields are marked *