Question Authors' Forum

Graph in HTML-Field

Re: Graph in HTML-Field

by Richard Lobb -
Number of replies: 0

Hi Markus

Many thanks for the updated textareaId documentation - that's very helpful. I've incorporated it into the Readme.md for the upcoming release. 

Yes, the new version includes code to deal with the bug you encountered with the HTML UI not sync'ing back to the textarea when a quiz times out. Although I have an onsubmit handler for the form, it turns out that a submit event is not fired if a form's submit method is called directly by JavaScript, as it is when a quiz times out. My workaround is to add a sync timer which regularly calls the UI plugin's sync() method to serialise the UI state back into the textarea. I've set the default sync interval to an arbitrary 5 secs, but have provided a UI parameter so that the question author can change this on a per-question basis if required. The number is totally arbitrary and I really have no feeling for what might by appropriate. As your use of the HTML UI shows, it is possible for authors to construct almost arbitrarily complex UIs so the sync overheads could perhaps become significant if called every second? Your thoughts?

For now I've also added the sync_interval_secs UI parameter to the other two UIs that don't automatically keep the textarea in sync: gapfiller UI and table UI. However since the overheads with those are likely to be always small, I might just use fixed time intervals for them. It's easy to add back in again if needed in the future.

Since syncing the UI contents back to the textarea doesn't in turn sync back to the server, there's still an element of risk with relying on quiz time outs for submissions. If, say, a student's laptop battery fails, or the network goes down, all a student's work could be lost. So I prefer to always provide students with at least a precheck button that provides some level of sanity check to the student while also submitting their work to the server.

If you're interested in checking out the intended new version, you could pull the Development branch from github. It's still in pre-release state, but I think it's close to release and I'm about to install it on our production server for this coming academic year. However, the Readme documentation and some of the inline documentation hasn't yet been updated and of course there are still likely to be a few bugs. But I'd certainly be grateful for any feedback.

Regards

Richard