Merge branch 'MDL-30320' of git://github.com/timhunt/moodle
This commit is contained in:
@@ -85,24 +85,7 @@ abstract class question_behaviour {
|
||||
*
|
||||
* @param question_definition $question the question.
|
||||
*/
|
||||
public function is_compatible_question(question_definition $question) {
|
||||
$requiredclass = $this->required_question_definition_type();
|
||||
return $this->question instanceof $requiredclass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Most behaviours can only work with {@link question_definition}s
|
||||
* of a particular subtype, or that implement a particular interface.
|
||||
* This method lets the behaviour document that. The type of
|
||||
* question passed to the constructor is then checked against this type.
|
||||
*
|
||||
* @deprecated since 2.2. Please use/override {@link is_compatible_question()} instead.
|
||||
*
|
||||
* @return string class/interface name.
|
||||
*/
|
||||
protected function required_question_definition_type() {
|
||||
return 'question_definition';
|
||||
}
|
||||
public abstract function is_compatible_question(question_definition $question);
|
||||
|
||||
/**
|
||||
* @return string the name of this behaviour. For example the name of
|
||||
|
||||
@@ -40,6 +40,10 @@ defined('MOODLE_INTERNAL') || die();
|
||||
class qbehaviour_manualgraded extends question_behaviour_with_save {
|
||||
const IS_ARCHETYPAL = true;
|
||||
|
||||
public function is_compatible_question(question_definition $question) {
|
||||
return $question instanceof question_with_responses;
|
||||
}
|
||||
|
||||
public static function get_unused_display_options() {
|
||||
return array('correctness', 'marks', 'specificfeedback', 'generalfeedback',
|
||||
'rightanswer');
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
This files describes API changes for question behaviour plugins.
|
||||
|
||||
=== 2.6 ===
|
||||
|
||||
1) Legacy required_question_definition_type no longer supported. (See 2.2 point 2) below.)
|
||||
|
||||
=== 2.3 ===
|
||||
|
||||
* This plugin type now supports cron in the standard way. If required, Create a
|
||||
lib.php file containing
|
||||
1) This plugin type now supports cron in the standard way. If required, Create a
|
||||
lib.php file containing
|
||||
function qbehaviour_mypluginname_cron() {};
|
||||
|
||||
=== 2.2 ===
|
||||
|
||||
Reference in New Issue
Block a user