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