mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-10965 tool_generator: use existing course element
This commit is contained in:
parent
88d2677e43
commit
2c8b8af4bd
@ -47,8 +47,7 @@ class tool_generator_make_testplan_form extends moodleform {
|
||||
tool_generator_testplan_backend::get_size_choices());
|
||||
$mform->setDefault('size', tool_generator_testplan_backend::DEFAULT_SIZE);
|
||||
|
||||
$mform->addElement('select', 'courseid', get_string('targetcourse', 'tool_generator'),
|
||||
tool_generator_testplan_backend::get_course_options());
|
||||
$mform->addElement('course', 'courseid', get_string('targetcourse', 'tool_generator'));
|
||||
|
||||
$mform->addElement('advcheckbox', 'updateuserspassword', get_string('updateuserspassword', 'tool_generator'));
|
||||
$mform->addHelpButton('updateuserspassword', 'updateuserspassword', 'tool_generator');
|
||||
|
@ -71,25 +71,6 @@ class tool_generator_testplan_backend extends tool_generator_backend {
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of courses that can be used used to generate a test.
|
||||
*
|
||||
* @return array The list of options as courseid => name
|
||||
*/
|
||||
public static function get_course_options() {
|
||||
$courses = get_courses('all', 'c.sortorder ASC', 'c.id, c.shortname, c.fullname');
|
||||
if (!$courses) {
|
||||
print_error('error_nocourses', 'tool_generator');
|
||||
}
|
||||
|
||||
$options = array();
|
||||
unset($courses[1]);
|
||||
foreach ($courses as $course) {
|
||||
$options[$course->id] = $course->fullname . '(' . $course->shortname . ')';
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for moodle-performance-comparison project URL.
|
||||
*
|
||||
|
6
admin/tool/generator/upgrade.txt
Normal file
6
admin/tool/generator/upgrade.txt
Normal file
@ -0,0 +1,6 @@
|
||||
This files describes API changes in core libraries and APIs,
|
||||
information provided here is intended especially for developers.
|
||||
|
||||
=== 3.7 ===
|
||||
|
||||
* Function tool_generator_testplan_backend::get_course_options() is removed, the 'course' form element is used instead.
|
Loading…
x
Reference in New Issue
Block a user