I tried now, however, to override one of the subclassses used in our instance - adaptivenopenalty:
require_once($CFG->dirroot . '/question/behaviour/adaptivenopenalty/renderer.php');But that still doesn't work (the function isn't called), and on some pages it even gives me an error about its parent class (qbehaviour_adaptivenopenalty_renderer extentds qbehaviour_adaptive_renderer) and that's weird since I didn't touch any other file other that my core_renderer:
class theme_mytheme_qbehaviour_adaptivenopenalty_renderer extends \qbehaviour_adaptivenopenalty_renderer {
}
( ! ) Fatal error: Class 'qbehaviour_renderer' not found in /html/aviv2017/question/behaviour/adaptive/renderer.php on line
But I don't want to burden you with these problem since I think this isn't the path to go in since, even if it worked, I'd have to extend all subclasses and that's too tedious and error prone, and also doesn't scale if more subclasses are added.
Since the change I want is to add a class to the submit button, I see my options as follows:
- Make my change in core (in the original qbehaviour_renderer class) and take care of upgrade clashes, if occur, using git.
- Make my change using JavaScript.
- Adapt the CSS to conform to the current classes.
Regarding patch: I'd love to write a patch but unfortunately I'm not familiar enough with the Moodle code to do so.