protected function display_content($question, $rowclasses)
 {
     $class = '';
     if ($this->qbank->offlinequiz_contains($question->id)) {
         $class = 'greyed';
     }
     echo '<div class="' . $class . '">';
     $labelfor = $this->label_for($question);
     if ($labelfor) {
         echo '<label for="' . $labelfor . '">';
     }
     echo offlinequiz_question_tostring($question);
     if ($labelfor) {
         echo '</label>';
     }
     echo '</div>';
 }
 /**
  * Renders html to display a random question the link to edit the configuration
  * and also to see that category in the question bank.
  *
  * @param structure $structure object containing the structure of the offlinequiz.
  * @param \stdClass $question data from the question and offlinequiz_slots tables.
  * @param \moodle_url $pageurl the canonical URL of this page.
  * @return string HTML to output.
  */
 public function random_question(structure $structure, $question, $pageurl)
 {
     $editurl = new \moodle_url('/question/question.php', array('returnurl' => $pageurl->out_as_local_url(), 'cmid' => $structure->get_cmid(), 'id' => $question->id));
     $temp = clone $question;
     $temp->questiontext = '';
     $instancename = offlinequiz_question_tostring($temp);
     $configuretitle = get_string('configurerandomquestion', 'offlinequiz');
     $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', $configuretitle, 'moodle', array('title' => ''));
     // If this is a random question, display a link to show the questions
     // selected from in the question bank.
     $qbankurl = new \moodle_url('/question/edit.php', array('cmid' => $structure->get_cmid(), 'cat' => $question->category . ',' . $question->contextid, 'recurse' => !empty($question->questiontext)));
     $qbanklink = ' ' . \html_writer::link($qbankurl, get_string('seequestions', 'offlinequiz'), array('class' => 'mod_offlinequiz_random_qbank_link'));
     return html_writer::link($editurl, $icon . $editicon, array('title' => $configuretitle)) . ' ' . $instancename . ' ' . $qbanklink;
 }