Skip to content

Commit

Permalink
MDL-10965 tool_generator: use existing course element
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Apr 10, 2019
1 parent 88d2677 commit 2c8b8af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
3 changes: 1 addition & 2 deletions admin/tool/generator/classes/make_testplan_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public function definition() {
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');
Expand Down
19 changes: 0 additions & 19 deletions admin/tool/generator/classes/testplan_backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,6 @@ public static function get_size_choices() {
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.
*
Expand Down
6 changes: 6 additions & 0 deletions admin/tool/generator/upgrade.txt
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 2c8b8af

Please sign in to comment.