Typo, should be $COURSE not $course
[moodle.git] / question / edit.php
CommitLineData
516cf3eb 1<?php // $Id$
2/**
e586cfb4 3* Page to edit the question bank
516cf3eb 4*
e586cfb4 5* TODO: add logging
516cf3eb 6*
516cf3eb 7* @author Martin Dougiamas and many others. This has recently been extensively
8* rewritten by Gustav Delius and other members of the Serving Mathematics project
9* {@link http://maths.york.ac.uk/serving_maths}
10* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
4323d029 11* @package questionbank
516cf3eb 12*/
85c375c3 13
e586cfb4 14 require_once("../config.php");
516cf3eb 15 require_once("editlib.php");
16
271e6dec 17 list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions');
18
19 question_showbank_actions($thispageurl, $cm);
516cf3eb 20
271e6dec 21 $context = $contexts->lowest();
70c01adb 22 $streditingquestions = get_string('editquestions', "quiz");
b72ff476 23 if ($cm!==null) {
271e6dec 24 $strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
25 ? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
70c01adb 26 : "";
3b27b0fe 27 $navlinks = array();
28 $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity');
29 $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title');
30 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
31 $navigation = build_navigation($navlinks);
b72ff476 32 print_header_simple($streditingquestions, '', $navigation, "", "", true, $strupdatemodule);
70c01adb 33
34 $currenttab = 'edit';
35 $mode = 'questions';
b72ff476 36 ${$cm->modname} = $module;
37 include($CFG->dirroot."/mod/$cm->modname/tabs.php");
70c01adb 38 } else {
b72ff476 39 // Print basic page layout.
3b27b0fe 40 $navlinks = array();
41 $navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
42 $navigation = build_navigation($navlinks);
271e6dec 43
b72ff476 44 print_header_simple($streditingquestions, '', $navigation);
271e6dec 45
70c01adb 46 // print tabs
47 $currenttab = 'questions';
48 include('tabs.php');
49 }
271e6dec 50
51
09275894 52 echo '<table class="boxaligncenter" border="0" cellpadding="2" cellspacing="0">';
e586cfb4 53 echo '<tr><td valign="top">';
516cf3eb 54
271e6dec 55 question_showbank('questions', $contexts, $thispageurl, $cm, $pagevars['qpage'], $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
36e298bc 56 $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
516cf3eb 57
58 echo '</td></tr>';
59 echo '</table>';
60
271e6dec 61 print_footer($COURSE);
516cf3eb 62?>