weekly release 2.5dev
[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.
7a00d438
DM
10* qtype_xxx_pluginfile() is now given the 7th parameter (hopefully the last
11 one) that contains additional options for the file serving. The array should
12 be re-passed to question_pluginfile() as is.
c2f5e2ab
TH
13
14
78fc17eb
TH
15=== 2.2 ===
16
17* The XML import/export base class has had some minor API changes. The
18 - write_combined_feedback method now requires that you pass the questionid and
19 contextid. (MDL-29058)
20 - calls to the import_hints and import_answer methods now should pass the question
21 text format as the last argument, to be used as a default if necessary. (MDL-29739)
22 If you do not upgrade your code, it will not break, but there will be PHP
23 warnings, and it the export will not work 100% correctly.
24
226b3124
TH
25* The old
26 public function requires_qtypes()
27method is no more. Instead use the ->dependencies facility in version.php. E.g.
28$plugin->dependencies = array(
29 'qtype_numerical' => 2011102700,
30);
31
32* The plugin name and related strings used to be defined in language strings
33called the same thing as the format, for example:
34
35$string['addingdescription'] = 'Adding a Description';
36$string['description'] = 'Description';
37$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.
38$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.
39$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.';
40$string['editingdescription'] = 'Editing a Description';
41
42All these need to be changed to use the standard string name pluginname, as for
43other plugin types, and similar for the other strings.
44
45$string['pluginname'] = 'Description';
46$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.
47$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.
48$string['pluginnameadding'] = 'Adding a Description';
49$string['pluginnameediting'] = 'Editing a Description';
50$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.';
51
52The old strings will continue to work, but only until Moodle 2.3 is released.
56565037
VS
53
54* If you are using the facilities provided by overriding the extra_answer_fields
55 or questionid_column_name methods, then you must change these to be public
56 methods. (This is required so that backup and restore can be made to work
57 automatically. MDL-24408, MDL-25617, MDL-30562)
0b94d6bf 58
0b94d6bf 59
a031b0f3
TH
60=== 2.1 ===
61
62* Lots of API changes due to the new question engine. See
63http://docs.moodle.org/dev/Developing_a_Question_Type#Converting_a_Moodle_2.0_question_type
64
65
66=== 2.0 ===
67
68* Lots of changes due to all the API changes in Moodle 2.0.
69
70* This plugin type now supports cron in the standard way. If required, Create a
71 lib.php file containing
72function qtype_mypluginname_cron() {};