original_string: public function question_name(structure $structure, $slot, $pageurl) {
          $output = '';
  
          $question = $structure->get_question_in_slot($slot);
          $editurl = new \moodle_url('/question/question.php', array(
                  'returnurl' => $pageurl->out_as_local_url(),
                  'cmid' => $structure->get_cmid(), 'id' => $question->id));
  
          $instancename = quiz_question_tostring($question);
  
          $qtype = \question_bank::get_qtype($question->qtype, false);
          $namestr = $qtype->local_name();
  
          $icon = $this->pix_icon('icon', $namestr, $qtype->plugin_name(), array('title' => $namestr,
                  'class' => 'icon activityicon', 'alt' => ' ', 'role' => 'presentation'));
  
          $editicon = $this->pix_icon('t/edit', '', 'moodle', array('title' => ''));
  
          // Need plain question name without html tags for link title.
          $title = shorten_text(format_string($question->name), 100);
  
          // Display the link itself.
          $activitylink = $icon . html_writer::tag('span', $editicon . $instancename, array('class' => 'instancename'));
          $output .= html_writer::link($editurl, $activitylink,
                  array('title' => get_string('editquestion', 'quiz').' '.$title));
  
          return $output;
      }
code: public function question_name(structure $structure, $slot, $pageurl) {
          $output = '';
  
          $question = $structure->get_question_in_slot($slot);
          $editurl = new \moodle_url('/question/question.php', array(
                  'returnurl' => $pageurl->out_as_local_url(),
                  'cmid' => $structure->get_cmid(), 'id' => $question->id));
  
          $instancename = quiz_question_tostring($question);
  
          $qtype = \question_bank::get_qtype($question->qtype, false);
          $namestr = $qtype->local_name();
  
          $icon = $this->pix_icon('icon', $namestr, $qtype->plugin_name(), array('title' => $namestr,
                  'class' => 'icon activityicon', 'alt' => ' ', 'role' => 'presentation'));
  
          $editicon = $this->pix_icon('t/edit', '', 'moodle', array('title' => ''));
  
          // Need plain question name without html tags for link title.
          $title = shorten_text(format_string($question->name), 100);
  
          // Display the link itself.
          $activitylink = $icon . html_writer::tag('span', $editicon . $instancename, array('class' => 'instancename'));
          $output .= html_writer::link($editurl, $activitylink,
                  array('title' => get_string('editquestion', 'quiz').' '.$title));
  
          return $output;
      }
code_tokens: public function question_name ( structure $ structure , $ slot , $ pageurl ) { $ output = '' ; $ question = $ structure -> get_question_in_slot ( $ slot ) ; $ editurl = new \ moodle_url ( '/question/question.php' , array ( 'returnurl' => $ pageurl -> out_as_local_url ( ) , 'cmid' => $ structure -> get_cmid ( ) , 'id' => $ question -> id ) ) ; $ instancename = quiz_question_tostring ( $ question ) ; $ qtype = \ question_bank :: get_qtype ( $ question -> qtype , false ) ; $ namestr = $ qtype -> local_name ( ) ; $ icon = $ this -> pix_icon ( 'icon' , $ namestr , $ qtype -> plugin_name ( ) , array ( 'title' => $ namestr , 'class' => 'icon activityicon' , 'alt' => ' ' , 'role' => 'presentation' ) ) ; $ editicon = $ this -> pix_icon ( 't/edit' , '' , 'moodle' , array ( 'title' => '' ) ) ; // Need plain question name without html tags for link title. $ title = shorten_text ( format_string ( $ question -> name ) , 100 ) ; // Display the link itself. $ activitylink = $ icon . html_writer :: tag ( 'span' , $ editicon . $ instancename , array ( 'class' => 'instancename' ) ) ; $ output .= html_writer :: link ( $ editurl , $ activitylink , array ( 'title' => get_string ( 'editquestion' , 'quiz' ) . ' ' . $ title ) ) ; return $ output ; }
docstring: Renders html to display a name with the link to the question on a quiz edit page
  
  If the user does not have permission to edi the question, it is rendered
  without a link
  
  @param structure $structure object containing the structure of the quiz.
  @param int $slot which slot we are outputting.
  @param \moodle_url $pageurl the canonical URL of this page.
  @return string HTML to output.
docstring_tokens: Renders html to display a name with the link to the question on a quiz edit page