Moodle 2.2 Overriding Rubric Render

Moodle 2.2 Overriding Rubric Render

by Michael O'Brien -
Number of replies: 3

As a quick fix for MDL-30780 I need to override the rubric renderer but really don't know where to start.

I would like to keep any changes to a minimum and maybe just  add a horizontal scroll bar to the bottom of display

Anyone able to guide an admin with limited experience of Theming Moodle 2

Average of ratings: -
In reply to Michael O'Brien

Re: Moodle 2.2 Overriding Rubric Render

by Sam Hemelryk -
Hi Michael,

There are some pretty good docs on how to create theme's, use images, and relevant to you how to override renderers in our docs.
Have a look at the following three:
* Themes 2.0
* Themes 2.0 creating your first theme
* Themes 2.0 overriding a renderer

They are all a little old now, however they should still be very much relevant.
Unfortunately overriding renderers is at the more advanced end of the theme development line and there aren't likely going to be good examples, especially not for the rubrics renderer as its a new.

I havn't had a good look or think about it, however the following is the sort of renderer code I imagine you will want to end up with:

class theme_whatever_gradingform_rubric_renderer extends gradingform_rubric_renderer {
protected function rubric_template($mode, $options, $elementname, $criteriastr) {
return '
'.parent::rubric_template($mode, $options, $elementname, $criteriastr).'
';
}
}

It's not particularly nice but likely it'll get the job done.

Alternativily do you need to override the renderer?

If not then try the following CSS somewhere in your theme:

.gradingform_rubric_editform mform .gradingform_rubric.editor {overflow:auto;}


Anyway hope that helps.

Cheers
Sam
In reply to Sam Hemelryk

Re: Moodle 2.2 Overriding Rubric Render

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Sam,

The problem is the fact it happens in Standard theme too. I've set up a new tracker issue to deal with it.MDL-30827.

Cheers

Mary