Merge branch 'MDL-45312' of git://github.com/timhunt/moodle

This commit is contained in:
Sam Hemelryk 2014-04-29 10:24:20 +12:00
commit e0eca9b3e5
2 changed files with 10 additions and 0 deletions

View file

@ -60,6 +60,11 @@ class qbehaviour extends base {
public function is_uninstall_allowed() {
global $DB;
if ($this->name === 'missing') {
// qbehaviour_missing is used by the system. It cannot be uninstalled.
return false;
}
return !$DB->record_exists('question_attempts', array('behaviour' => $this->name));
}

View file

@ -68,6 +68,11 @@ class qtype extends base {
public function is_uninstall_allowed() {
global $DB;
if ($this->name === 'missingtype') {
// qtype_missingtype is used by the system. It cannot be uninstalled.
return false;
}
return !$DB->record_exists('question', array('qtype' => $this->name));
}