Navigation Menu

Skip to content

Commit

Permalink
MDL-30562 qtypes: extra_answer_fields & questionid_column_name public
Browse files Browse the repository at this point in the history
Will let us make more of qtype backup and restore work automatically.
  • Loading branch information
vostreltsov authored and timhunt committed Dec 9, 2011
1 parent f89a83b commit 5656503
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions question/type/questiontypebase.php
Expand Up @@ -165,7 +165,7 @@ public function extra_question_fields() {
* If you use extra_question_fields, overload this function to return question id field name * 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 * in case you table use another name for this column
*/ */
protected function questionid_column_name() { public function questionid_column_name() {
return 'questionid'; return 'questionid';
} }


Expand All @@ -176,7 +176,7 @@ protected function questionid_column_name() {
* *
* @return mixed array as above, or null to tell the base class to do nothing. * @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; return null;
} }


Expand Down
2 changes: 1 addition & 1 deletion question/type/shortanswer/questiontype.php
Expand Up @@ -42,7 +42,7 @@ public function extra_question_fields() {
return array('question_shortanswer', 'answers', 'usecase'); return array('question_shortanswer', 'answers', 'usecase');
} }


protected function questionid_column_name() { public function questionid_column_name() {
return 'question'; return 'question';
} }


Expand Down
5 changes: 5 additions & 0 deletions question/type/upgrade.txt
Expand Up @@ -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.'; $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. 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.