original_string: public function question_preview_icon($quiz, $question, $label = null, $variant = null) {
          $url = quiz_question_preview_url($quiz, $question, $variant);
  
          // Do we want a label?
          $strpreviewlabel = '';
          if ($label) {
              $strpreviewlabel = ' ' . get_string('preview', 'quiz');
          }
  
          // Build the icon.
          $strpreviewquestion = get_string('previewquestion', 'quiz');
          $image = $this->pix_icon('t/preview', $strpreviewquestion);
  
          $action = new \popup_action('click', $url, 'questionpreview',
                                          question_preview_popup_params());
  
          return $this->action_link($url, $image . $strpreviewlabel, $action,
                  array('title' => $strpreviewquestion, 'class' => 'preview'));
      }
code: public function question_preview_icon($quiz, $question, $label = null, $variant = null) {
          $url = quiz_question_preview_url($quiz, $question, $variant);
  
          // Do we want a label?
          $strpreviewlabel = '';
          if ($label) {
              $strpreviewlabel = ' ' . get_string('preview', 'quiz');
          }
  
          // Build the icon.
          $strpreviewquestion = get_string('previewquestion', 'quiz');
          $image = $this->pix_icon('t/preview', $strpreviewquestion);
  
          $action = new \popup_action('click', $url, 'questionpreview',
                                          question_preview_popup_params());
  
          return $this->action_link($url, $image . $strpreviewlabel, $action,
                  array('title' => $strpreviewquestion, 'class' => 'preview'));
      }
code_tokens: public function question_preview_icon ( $ quiz , $ question , $ label = null , $ variant = null ) { $ url = quiz_question_preview_url ( $ quiz , $ question , $ variant ) ; // Do we want a label? $ strpreviewlabel = '' ; if ( $ label ) { $ strpreviewlabel = ' ' . get_string ( 'preview' , 'quiz' ) ; } // Build the icon. $ strpreviewquestion = get_string ( 'previewquestion' , 'quiz' ) ; $ image = $ this -> pix_icon ( 't/preview' , $ strpreviewquestion ) ; $ action = new \ popup_action ( 'click' , $ url , 'questionpreview' , question_preview_popup_params ( ) ) ; return $ this -> action_link ( $ url , $ image . $ strpreviewlabel , $ action , array ( 'title' => $ strpreviewquestion , 'class' => 'preview' ) ) ; }
docstring: Render the preview icon.
  
  @param \stdClass $quiz the quiz settings from the database.
  @param \stdClass $question data from the question and quiz_slots tables.
  @param bool $label if true, show the preview question label after the icon
  @param int $variant which question variant to preview (optional).
  @return string HTML to output.
docstring_tokens: Render the preview icon .