Just a simple straw poll

There is a tendancy to over-engineer solutions in the Moodle community sometimes, and this tends to lead to confusing interfaces or even worse something that doesn’t work as it should.

I’ve spent most of the last few months writing local plugins for Moodle; the kind that have eight tables in the database and make your mind melt as you work on them. So when I found a bit of time I decided to create a simple straw poll block which would “just work”.

straw poll
A simple straw poll

A straw poll is a simple thing, and because it is in a block we know that there should be a limited number of questions. Equally I felt it was overkill to support the exporting of complex spreadsheets to show the results. A total and a percentage should be enough for any straw poll, and if you want more than that there is the wonderful Choice activity!

So I decided that the Questions and the Responses could all be held directly in the block configuration meaning the only table that would needed in the database would be for responses. This is more efficient since block configuration is already loaded and it cuts down the number of DB queries Moodle needs to do.

straw poll config
The configuration for the example poll shown above. Only the red fields need to be filled out.

The configuration for the block is very simple, with one text box for the question, six text boxes for possible options, and a few extra options to control how the user will interact with the block. The empty options are simply ignored by the block and responses cannot be submitted for them.

I will be submitting a Beta of this block to Moodle.org soon, but if you would like to try it out now you can download it from my GitHub repository.

Try out the Page Hints preview now!

pagehints

Back in June last year I had the idea of developing a Moodle plugin which could be used to add information to a page allowing users to learn how to use Moodle “on the fly”. I came up with the slightly goofy name of Page Annotations and posted a new discussion over on Moodle.org receiving some quite positive feedback.

After that it all went quiet (sorry about that!), but you will be glad to hear I didn’t forget about page annotations. In actual fact I have been running an early version of the plugin on BSDC‘s Moodle site since September and have been looking for ways to improve it since then. Now called Page Hints, I have been working with the advice of Andy Nicols to improve the efficiency and compatibility of the plugin.

pagehints

Once you have the plugin installed you need to look under Site Administration > Plugins > Local Plugins for the admin panel.

 

managehints

The management screen is basically just a table showing all your instances which can be edited, cloned, disabled or deleted at any time. You can also create a new instance by clicking on the “New Hint” button in the bottom right.

edithint

 

The editing screen is a form which auto-updates a hint on the screen as you make changes. Make sure you read the help information on the last “page filters” section as this is what determines where the hint will appear.

I can see a lot of room for enhancements to this plugin; making it easier for admins to add hints to any page and making it possible for teachers to add hints to their courses are high on my priority before this is submitted to Moodle.org’s plugin repository. That said the plugin is now quite mature, running on several production servers.

If you would like to take a Page Hints for a spin on your Moodle you can get a copy from my GitHub Repository. I’d love to hear your thoughts on what I have so far as well as any suggestions for the future.