MDL-27408 Moved the question engine install/upgrade code into the proper place.

I have tested upgrade from the previous development version, and a clean install. Upgrade from 2.0 still needs more work.
This commit is contained in:
Tim Hunt
2011-05-12 18:58:50 +01:00
parent dcd03928ab
commit bb28e3bc5e
19 changed files with 1233 additions and 970 deletions
+29
View File
@@ -3762,6 +3762,35 @@ class admin_setting_special_calendar_weekend extends admin_setting {
}
/**
* Admin setting that allows a user to pick a behaviour.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class admin_setting_question_behaviour extends admin_setting_configselect {
/**
* @param string $name name of config variable
* @param string $visiblename display name
* @param string $description description
* @param string $default default.
*/
public function __construct($name, $visiblename, $description, $default) {
parent::__construct($name, $visiblename, $description, $default, NULL);
}
/**
* Load list of behaviours as choices
* @return bool true => success, false => error.
*/
public function load_choices() {
global $CFG;
require_once($CFG->dirroot . '/question/engine/lib.php');
$this->choices = question_engine::get_archetypal_behaviours();
return true;
}
}
/**
* Admin setting that allows a user to pick appropriate roles for something.
*