Browse files

MDL-30562 qtypes: extra_answer_fields & questionid_column_name public

Will let us make more of qtype backup and restore work automatically.
  • Loading branch information...
1 parent f89a83b commit 56565037dddc68f1c1185002c1384c16bbd1a84a @vostreltsov vostreltsov committed with timhunt Dec 4, 2011
Showing with 8 additions and 3 deletions.
  1. +2 −2 question/type/questiontypebase.php
  2. +1 −1 question/type/shortanswer/questiontype.php
  3. +5 −0 question/type/upgrade.txt
View
4 question/type/questiontypebase.php
@@ -165,7 +165,7 @@ public function extra_question_fields() {
* If you use extra_question_fields, overload this function to return question id field name
* in case you table use another name for this column
*/
- protected function questionid_column_name() {
+ public function questionid_column_name() {
return 'questionid';
}
@@ -176,7 +176,7 @@ protected function questionid_column_name() {
*
* @return mixed array as above, or null to tell the base class to do nothing.
*/
- protected function extra_answer_fields() {
+ public function extra_answer_fields() {
return null;
}
View
2 question/type/shortanswer/questiontype.php
@@ -42,7 +42,7 @@ public function extra_question_fields() {
return array('question_shortanswer', 'answers', 'usecase');
}
- protected function questionid_column_name() {
+ public function questionid_column_name() {
return 'question';
}
View
5 question/type/upgrade.txt
@@ -38,3 +38,8 @@ $string['pluginnameediting'] = 'Editing a Description';
$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.';
The old strings will continue to work, but only until Moodle 2.3 is released.
+
+* If you are using the facilities provided by overriding the extra_answer_fields
+ or questionid_column_name methods, then you must change these to be public
+ methods. (This is required so that backup and restore can be made to work
+ automatically. MDL-24408, MDL-25617, MDL-30562)

0 comments on commit 5656503

Please sign in to comment.