Overriding question icons in Moodle 2.0

Overriding question icons in Moodle 2.0

by Gareth Evans -
Number of replies: 5

Does anyone know the correct method of overriding the default moodle icons for question types in a new theme? The icons are located:
<root>/questions/types/... 

I'm familiar with overiding core and plugin icons but how do you tackle the question types?

thanks Gareth

 

Average of ratings: -
In reply to Gareth Evans

Re: Overriding question icons in Moodle 2.0

by Sam Hemelryk -
Hi Gareth,

The location for question types is pretty similar to the other plugin types. The following location is an example of how you would override the icon for the multianswer question types:


moodle/theme/yourthemename/pix_plugins/qtype/multianswer/icon.png


Cheers
Sam
In reply to Sam Hemelryk

Re: Overriding question icons in Moodle 2.0

by Gareth Evans -

Brilliant, many thanks Sam. I could tell its was included in the new images script but was using "pix_plugins/questions/multianswer/...etc". I have been working of your tutorial Mary mentions in her post (Thanks Mary), but wonder if there are any other images that con be overriden in this manner that are also a little hard to pick up on. Judging by your posts your exceptionally busy, but could you ammend the tutorial with anything else that can be overriden by the cascading images system? Certainly the question types was a little less obvious than mods and blocks.

Many thanks Gareth

In reply to Gareth Evans

Re: Overriding question icons in Moodle 2.0

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The most reliable way to work it out is to follow the logic Moodle will use.

If you get the URL of the image. For example, find the icon in the Moodle UI. Then (in Firefox) right-click and do View image properties.... it will look something like:

http://example.com/moodle/theme/image.php?theme=anomaly&image=icon&component=qtype_multianswer

I put the key bits of that into bold.

You should be able to see the general rule for turning that into the type of path that Sam gave.

theme/yourthemename/pix_plugins/qtype/multianswer/icon.png

Moodle docs is a wiki, so you could add this explanation to Sam's document yourself, now that you understand it.

In reply to Tim Hunt

Re: Overriding question icons in Moodle 2.0

by Gareth Evans -

Many thanks Tim, i could'nt ask for anything more. A clear concise explaination of how the whole image inheritance system works. Will take a look at adding it to moodle docs. 

Ta

Gareth