Moodle 2.0.3 release
[moodle.git] / question / edit.php
blobf19bb1c3444b145d7134af0c62cdd471b6210b01
1 <?php
3 ///////////////////////////////////////////////////////////////////////////
4 // //
5 // NOTICE OF COPYRIGHT //
6 // //
7 // Moodle - Modular Object-Oriented Dynamic Learning Environment //
8 // http://moodle.org //
9 // //
10 // Copyright (C) 1999 onwards Martin Dougiamas and others //
11 // //
12 // This program is free software; you can redistribute it and/or modify //
13 // it under the terms of the GNU General Public License as published by //
14 // the Free Software Foundation; either version 2 of the License, or //
15 // (at your option) any later version. //
16 // //
17 // This program is distributed in the hope that it will be useful, //
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20 // GNU General Public License for more details: //
21 // //
22 // http://www.gnu.org/copyleft/gpl.html //
23 // //
24 ///////////////////////////////////////////////////////////////////////////
26 /**
27 * Page to edit the question bank
29 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
30 * @package questionbank
33 require_once("../config.php");
34 require_once("editlib.php");
36 $url = new moodle_url('/question/edit.php');
37 if (($lastchanged = optional_param('lastchanged', 0, PARAM_INT)) !== 0) {
38 $url->param('lastchanged', $lastchanged);
40 if (($category = optional_param('category', 0, PARAM_TEXT)) !== 0) {
41 $url->param('category', $category);
43 if (($qpage = optional_param('qpage', 0, PARAM_INT)) !== 0) {
44 $url->param('qpage', $qpage);
46 if (($cat = optional_param('cat', 0, PARAM_TEXT)) !== 0) {
47 $url->param('cat', $cat);
49 if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) {
50 $url->param('courseid', $courseid);
52 if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) {
53 $url->param('returnurl', $returnurl);
55 if (($cmid = optional_param('cmid', 0, PARAM_INT)) !== 0) {
56 $url->param('cmid', $cmid);
58 $PAGE->set_url($url);
59 $PAGE->set_pagelayout('standard');
61 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
62 question_edit_setup('questions', '/question/edit.php');
63 $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
64 $questionbank->process_actions();
66 // TODO log this page view.
68 $context = $contexts->lowest();
69 $streditingquestions = get_string('editquestions', "quiz");
70 $PAGE->set_title($streditingquestions);
71 $PAGE->set_heading($COURSE->fullname);
72 echo $OUTPUT->header();
74 echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
75 $questionbank->display('questions', $pagevars['qpage'],
76 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
77 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
78 echo "</div>\n";
80 echo $OUTPUT->footer();