public function question_preview_link($questionid, context $context, $showlabel) {
        if ($showlabel) {
            $alt = '';
            $label = get_string('preview');
            $attributes = array();
        } else {
            $alt = get_string('preview');
            $label = '';
            $attributes = array('title' => $alt);
        }

        $image = $this->pix_icon('t/preview', $alt, '', array('class' => 'iconsmall'));
        $link = question_preview_url($questionid, null, null, null, null, $context);
        $action = new popup_action('click', $link, 'questionpreview',
                question_preview_popup_params());

        return $this->action_link($link, $image . $label, $action, $attributes);
    }