/** * Get a link that changes the sort order, and indicates the current sort state. * @param $name internal name used for this type of sorting. * @param $currentsort the current sort order -1, 0, 1 for descending, none, ascending. * @param $title the link text. * @param $defaultreverse whether the default sort order for this column is descending, rather than ascending. * @return string HTML fragment. */ protected function make_sort_link($sort, $title, $tip, $defaultreverse = false) { $currentsort = $this->qbank->get_primary_sort_order($sort); $newsortreverse = $defaultreverse; if ($currentsort) { $newsortreverse = $currentsort > 0; } if (!$tip) { $tip = $title; } if ($newsortreverse) { $tip = get_string('sortbyxreverse', '', $tip); } else { $tip = get_string('sortbyx', '', $tip); } $link = '<a href="' . $this->qbank->new_sort_url($sort, $newsortreverse) . '" title="' . $tip . '">'; $link .= $title; if ($currentsort) { $link .= $this->get_sort_icon($currentsort < 0); } $link .= '</a>'; return $link; }
protected function known_field_types() { $types = parent::known_field_types(); $types[] = new question_bank_add_to_quiz_action_column($this); $types[] = new question_bank_question_name_text_column($this); return $types; }
$url->param('category', $category); } if (($qpage = optional_param('qpage', 0, PARAM_INT)) !== 0) { $url->param('qpage', $qpage); } if (($cat = optional_param('cat', 0, PARAM_TEXT)) !== 0) { $url->param('cat', $cat); } if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) { $url->param('courseid', $courseid); } if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) { $url->param('returnurl', $returnurl); } if (($cmid = optional_param('cmid', 0, PARAM_INT)) !== 0) { $url->param('cmid', $cmid); } $PAGE->set_url($url); list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions', '/question/edit.php'); $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm); $questionbank->process_actions(); // TODO log this page view. $context = $contexts->lowest(); $streditingquestions = get_string('editquestions', "quiz"); $PAGE->set_title($streditingquestions); $PAGE->set_heading($COURSE->fullname); echo $OUTPUT->header(); echo '<div class="questionbankwindow boxwidthwide boxaligncenter">'; $questionbank->display('questions', $pagevars['qpage'], $pagevars['qperpage'], $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['qbshowtext']); echo "</div>\n"; echo $OUTPUT->footer();
} if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) { $url->param('courseid', $courseid); } if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) { $url->param('returnurl', $returnurl); } if (($cmid = optional_param('cmid', 0, PARAM_INT)) !== 0) { $url->param('cmid', $cmid); } $PAGE->set_url($url); $PAGE->set_pagelayout('standard'); list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions', '/question/edit.php'); $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm); $questionbank->process_actions(); // TODO log this page view. $context = $contexts->lowest(); $streditingquestions = get_string('editquestions', 'question'); $PAGE->set_title($streditingquestions); $PAGE->set_heading($COURSE->fullname); echo $OUTPUT->header(); echo '<div class="questionbankwindow boxwidthwide boxaligncenter">'; $questionbank->display('questions', $pagevars['qpage'], $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'], $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']); echo "</div>\n";
protected function display_options_form($showquestiontext, $scriptpath = '/mod/quiz/edit.php', $showtextoption = false) { // Overridden just to change the default values of the arguments. parent::display_options_form($showquestiontext, $scriptpath, $showtextoption); }