Merge branch 'MDL-32347' of git://github.com/timhunt/moodle
[moodle.git] / question / type / upgrade.txt
CommitLineData
78fc17eb
TH
1This files describes API changes for question type plugins.
2
a031b0f3 3=== 2.3 ===
c2f5e2ab 4
a031b0f3
TH
5* Support for backwards-compatible string names dropped. MDL-30120. (See under 2.2 below.)
6* If you are overriding export_to_xml and import_from_xml to provide Moodle XML format
7 import and export, then you will probably get PHP strict syntax notices in developer
8 debug mode until you change the method signature to include qformat_xml $format.
9 That is, you need to specify the argument type.
c2f5e2ab
TH
10
11
78fc17eb
TH
12=== 2.2 ===
13
14* The XML import/export base class has had some minor API changes. The
15 - write_combined_feedback method now requires that you pass the questionid and
16 contextid. (MDL-29058)
17 - calls to the import_hints and import_answer methods now should pass the question
18 text format as the last argument, to be used as a default if necessary. (MDL-29739)
19 If you do not upgrade your code, it will not break, but there will be PHP
20 warnings, and it the export will not work 100% correctly.
21
226b3124
TH
22* The old
23 public function requires_qtypes()
24method is no more. Instead use the ->dependencies facility in version.php. E.g.
25$plugin->dependencies = array(
26 'qtype_numerical' => 2011102700,
27);
28
29* The plugin name and related strings used to be defined in language strings
30called the same thing as the format, for example:
31
32$string['addingdescription'] = 'Adding a Description';
33$string['description'] = 'Description';
34$string['description_help'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page.
35$string['description_link'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page.
36$string['descriptionsummary'] = 'This is not actually a question. Instead it is a way to add some instructions, rubric or other content to the activity. This is similar to the way that labels can be used to add content to the course page.';
37$string['editingdescription'] = 'Editing a Description';
38
39All these need to be changed to use the standard string name pluginname, as for
40other plugin types, and similar for the other strings.
41
42$string['pluginname'] = 'Description';
43$string['pluginname_help'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page.
44$string['pluginname_link'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page.
45$string['pluginnameadding'] = 'Adding a Description';
46$string['pluginnameediting'] = 'Editing a Description';
47$string['pluginnamesummary'] = 'This is not actually a question. Instead it is a way to add some instructions, rubric or other content to the activity. This is similar to the way that labels can be used to add content to the course page.';
48
49The old strings will continue to work, but only until Moodle 2.3 is released.
56565037
VS
50
51* If you are using the facilities provided by overriding the extra_answer_fields
52 or questionid_column_name methods, then you must change these to be public
53 methods. (This is required so that backup and restore can be made to work
54 automatically. MDL-24408, MDL-25617, MDL-30562)
0b94d6bf 55
0b94d6bf 56
a031b0f3
TH
57=== 2.1 ===
58
59* Lots of API changes due to the new question engine. See
60http://docs.moodle.org/dev/Developing_a_Question_Type#Converting_a_Moodle_2.0_question_type
61
62
63=== 2.0 ===
64
65* Lots of changes due to all the API changes in Moodle 2.0.
66
67* This plugin type now supports cron in the standard way. If required, Create a
68 lib.php file containing
69function qtype_mypluginname_cron() {};