cvsimport fixups
[moodle.git] / question / edit.php
... / ...
CommitLineData
1<?php // $Id$
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
26/**
27* Page to edit the question bank
28*
29* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
30* @package questionbank
31*//** */
32
33 require_once("../config.php");
34 require_once("editlib.php");
35
36 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions');
37 $questionbank = new question_bank_view();
38 $questionbank->process_actions($thispageurl, $cm);
39
40 // TODO log this page view.
41
42 $context = $contexts->lowest();
43 $streditingquestions = get_string('editquestions', "quiz");
44 if ($cm!==null) {
45 $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
46 ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
47 : "";
48 $navlinks = array();
49 $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$COURSE->id", 'type' => 'activity');
50 $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?id={$cm->id}", 'type' => 'title');
51 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
52 $navigation = build_navigation($navlinks);
53 print_header_simple($streditingquestions, '', $navigation, "", "", true, $strupdatemodule);
54
55 $currenttab = 'edit';
56 $mode = 'questions';
57 ${$cm->modname} = $module;
58 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
59 } else {
60 // Print basic page layout.
61 $navlinks = array();
62 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
63 $navigation = build_navigation($navlinks);
64
65 print_header_simple($streditingquestions, '', $navigation);
66
67 // print tabs
68 $currenttab = 'questions';
69 include('tabs.php');
70 }
71
72 echo '<table class="boxaligncenter" border="0" cellpadding="2" cellspacing="0">';
73 echo '<tr><td valign="top">';
74
75 $questionbank->display('questions', $contexts, $thispageurl, $cm, $pagevars['qpage'],
76 $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
77 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
78
79 echo '</td></tr>';
80 echo '</table>';
81
82 print_footer($COURSE);
83?>