General developer forum

New filter for displaying questions in any content

Picture of Richard Jones
Re: New filter for displaying questions in any content
Particularly helpful MoodlersPlugin developersTesters

Hi Jon

I'm a little bit hesitant because I've not done any serious Moodle dev outside theming before now.  However, there is a simple piece of filter code on my github (richardjonesnz) that allows a teacher to insert code that displays a question in a popup using the preview.php page.

I have also got an Atto button that only the teacher can use to insert a hashed question id would be a workable approach.  That's also there, based on Justin Hunt's Atto template which I barely understand.

I'm not sure how to create the hash though as it looks complex to hash within YUI and recover it in the PHP filter.  At my level anyway.

I'm now working on passing that to a copy of preview.php which has a couple of lines to de-obfuscate the id.

Anyway, if developers have advice I will try to follow it.

Average of ratings: Useful (1)