MDL-20636 Fix new stdClass -> stdClass(), and trailing whitespace.
[moodle.git] / question / edit.php
CommitLineData
aeb15530 1<?php
f4b879dd 2
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///////////////////////////////////////////////////////////////////////////
25
516cf3eb 26/**
fe6ce234
DC
27 * Page to edit the question bank
28 *
29 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
30 * @package questionbank
31 */
85c375c3 32
e586cfb4 33 require_once("../config.php");
516cf3eb 34 require_once("editlib.php");
35
a6855934 36 $url = new moodle_url('/question/edit.php');
b0f4e4e4 37 if (($lastchanged = optional_param('lastchanged', 0, PARAM_INT)) !== 0) {
38 $url->param('lastchanged', $lastchanged);
39 }
40 if (($category = optional_param('category', 0, PARAM_TEXT)) !== 0) {
41 $url->param('category', $category);
42 }
43 if (($qpage = optional_param('qpage', 0, PARAM_INT)) !== 0) {
44 $url->param('qpage', $qpage);
45 }
46 if (($cat = optional_param('cat', 0, PARAM_TEXT)) !== 0) {
47 $url->param('cat', $cat);
48 }
49 if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) {
50 $url->param('courseid', $courseid);
51 }
52 if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) {
53 $url->param('returnurl', $returnurl);
54 }
56ed242b
SH
55 if (($cmid = optional_param('cmid', 0, PARAM_INT)) !== 0) {
56 $url->param('cmid', $cmid);
57 }
b0f4e4e4 58 $PAGE->set_url($url);
56ed242b 59 $PAGE->set_pagelayout('standard');
b0f4e4e4 60
453b28d8
TH
61 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
62 question_edit_setup('questions', '/question/edit.php');
971c6fca 63 $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
5bd22790 64 $questionbank->process_actions();
271e6dec 65
f4b879dd 66 // TODO log this page view.
516cf3eb 67
271e6dec 68 $context = $contexts->lowest();
70c01adb 69 $streditingquestions = get_string('editquestions', "quiz");
fe6ce234 70 $PAGE->set_title($streditingquestions);
0f56fde2 71 $PAGE->set_heading($COURSE->fullname);
56ed242b 72 echo $OUTPUT->header();
271e6dec 73
cd120b23 74 echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
5bd22790 75 $questionbank->display('questions', $pagevars['qpage'],
f4b879dd 76 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
77 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
cd120b23 78 echo "</div>\n";
516cf3eb 79
9b59580b 80 echo $OUTPUT->footer();
aeb15530 81