protected function print_tag_icon($id, \moodle_url $url, $cantag, $contextid) {
        global $OUTPUT;

        $params = [
            'data-action' => 'edittags',
            'data-cantag' => $cantag,
            'data-contextid' => $contextid,
            'data-questionid' => $id
        ];

        echo \html_writer::link($url, $OUTPUT->pix_icon('t/tags', get_string('managetags', 'tag')), $params);
    }