MDL-20636 Reveiw all throw statements.
[moodle.git] / question / edit.php
CommitLineData
aeb15530 1<?php
f4b879dd 2
d3603157
TH
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
f4b879dd 17
516cf3eb 18/**
fe6ce234
DC
19 * Page to edit the question bank
20 *
d3603157
TH
21 * @package moodlecore
22 * @subpackage questionbank
23 * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
fe6ce234 25 */
85c375c3 26
516cf3eb 27
d3603157
TH
28require_once(dirname(__FILE__) . '/../config.php');
29require_once($CFG->dirroot . '/question/editlib.php');
b0f4e4e4 30
d3603157
TH
31$url = new moodle_url('/question/edit.php');
32if (($lastchanged = optional_param('lastchanged', 0, PARAM_INT)) !== 0) {
33 $url->param('lastchanged', $lastchanged);
34}
35if (($category = optional_param('category', 0, PARAM_TEXT)) !== 0) {
36 $url->param('category', $category);
37}
38if (($qpage = optional_param('qpage', 0, PARAM_INT)) !== 0) {
39 $url->param('qpage', $qpage);
40}
41if (($cat = optional_param('cat', 0, PARAM_TEXT)) !== 0) {
42 $url->param('cat', $cat);
43}
44if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) {
45 $url->param('courseid', $courseid);
46}
47if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) {
48 $url->param('returnurl', $returnurl);
49}
50if (($cmid = optional_param('cmid', 0, PARAM_INT)) !== 0) {
51 $url->param('cmid', $cmid);
52}
53$PAGE->set_url($url);
54$PAGE->set_pagelayout('standard');
271e6dec 55
d3603157
TH
56list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
57 question_edit_setup('questions', '/question/edit.php');
58$questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
59$questionbank->process_actions();
516cf3eb 60
d3603157 61// TODO log this page view.
271e6dec 62
d3603157
TH
63$context = $contexts->lowest();
64$streditingquestions = get_string('editquestions', "quiz");
65$PAGE->set_title($streditingquestions);
66$PAGE->set_heading($COURSE->fullname);
67echo $OUTPUT->header();
516cf3eb 68
d3603157
TH
69echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
70$questionbank->display('questions', $pagevars['qpage'],
71 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
72 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
73echo "</div>\n";
aeb15530 74
d3603157 75echo $OUTPUT->footer();