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