MDL-42105 questions: let attempts have a max fraction > 1.
[moodle.git] / question / behaviour / upgrade.txt
CommitLineData
75a31c90
TH
1This files describes API changes for question behaviour plugins.
2
06616f4b
TH
3=== 2.6 ===
4
51) Legacy required_question_definition_type no longer supported. (See 2.2 point 2) below.)
6
f3460297
TH
72) Behaviours now have to define an extra class
8class qbehaviour_mybehaviour_type extends question_behaviour_type {
9 This class returns information about the type of behaviour, as opposed to
10 the qbehaviour_mybehaviour class which controls a particular
11 question_attempt. That is like the difference between the qtype_mytype and
12 the qtype_mytype_question classes.
13
14Practically, what this means is that any of the methods that used to be
15static methods of qbehaviour_mybehaviour class are now normal instance methods
16of the qbehaviour_mybehaviour_type class. Specifically.
17 2.5 / qbehaviour_mybehaviour -> 2.6 / qbehaviour_mybehaviour_type
18 IS_ARCHETYPAL -> is_archetypal()
19 adjust_random_guess_score() -> adjust_random_guess_score()
20 get_unused_display_options() -> get_unused_display_options()
21
223) The static method is_manual_grade_in_range has move from the
23 question_behaviour class to the question_engine class.
24
25
054124a3
DP
26=== 2.3 ===
27
06616f4b
TH
281) This plugin type now supports cron in the standard way. If required, Create a
29 lib.php file containing
054124a3
DP
30function qbehaviour_mypluginname_cron() {};
31
f3460297 32
75a31c90
TH
33=== 2.2 ===
34
3d17cd3f 351) The old
75a31c90 36 public static function get_required_behaviours()
f3460297 37 method is no more. Instead use the ->dependencies facility in version.php. E.g.
75a31c90
TH
38$plugin->dependencies = array(
39 'qbehaviour_immediatefeedback' => 2011102700,
40 'qbehaviour_deferredcbm' => 2011102700
41);
3d17cd3f
TH
42
432) The old required_question_definition_type method has been replaced by a new
f3460297
TH
44 is_compatible_question method. You should change your behaviour to override
45 the new method, not the old one. This change has been implemented in a
46 backwards-compatible way, so behaviours will not break.