Updated the HEAD build version to 20090916
[moodle.git] / question / edit.php
CommitLineData
516cf3eb 1<?php // $Id$
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/**
e586cfb4 27* Page to edit the question bank
516cf3eb 28*
516cf3eb 29* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
4323d029 30* @package questionbank
f4b879dd 31*//** */
85c375c3 32
e586cfb4 33 require_once("../config.php");
516cf3eb 34 require_once("editlib.php");
35
271e6dec 36 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions');
971c6fca 37 $questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
5bd22790 38 $questionbank->process_actions();
271e6dec 39
f4b879dd 40 // TODO log this page view.
516cf3eb 41
cd120b23 42 $localcss = '<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.
43 '/lib/yui/container/assets/container.css" />';
271e6dec 44 $context = $contexts->lowest();
70c01adb 45 $streditingquestions = get_string('editquestions', "quiz");
b72ff476 46 if ($cm!==null) {
271e6dec 47 $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
48 ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
70c01adb 49 : "";
ea3c6b74 50 $PAGE->navbar->add(get_string('modulenameplural', $cm->modname), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/index.php', array('id'=>$COURSE->id)));
51 $PAGE->navbar->add(format_string($module->name), new moodle_url($CFG->wwwroot.'/mod/'.$cm->modname.'/view.php', array('id'=>$cm->id)));
52 $PAGE->navbar->add($streditingquestions);
53 $PAGE->set_title($streditingquestions);
54 $PAGE->set_button($strupdatemodule);
55 echo $OUTPUT->header();
70c01adb 56
57 $currenttab = 'edit';
58 $mode = 'questions';
b72ff476 59 ${$cm->modname} = $module;
60 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
70c01adb 61 } else {
b72ff476 62 // Print basic page layout.
ea3c6b74 63 $PAGE->navbar->add($streditingquestions);
64 $PAGE->set_title($streditingquestions);
65 echo $OUTPUT->header();
271e6dec 66
70c01adb 67 // print tabs
68 $currenttab = 'questions';
69 include('tabs.php');
70 }
271e6dec 71
cd120b23 72 echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
5bd22790 73 $questionbank->display('questions', $pagevars['qpage'],
f4b879dd 74 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
75 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
cd120b23 76 echo "</div>\n";
516cf3eb 77
9b59580b 78 echo $OUTPUT->footer();
516cf3eb 79?>