public function get_user_courses_select($choose = false) {
        $options = tool_monitor_get_user_courses();
        // If we have no options then don't create a select element.
        if (!$options) {
            return false;
        }
        $selected = $this->courseid;
        $nothing = array();
        if ($choose) {
            $selected = null;
            $nothing = array('choosedots');
        }
        $url = new \moodle_url('/admin/tool/monitor/index.php');
        $select = new \single_select($url, 'courseid', $options, $selected, $nothing);
        $select->set_label(get_string('selectacourse', 'tool_monitor'));
        return $select;
    }