2006-02-24 10:21:40 +00:00
|
|
|
<?php // $Id$
|
|
|
|
/**
|
2006-02-24 10:35:28 +00:00
|
|
|
* Page to edit the question bank
|
2006-02-24 10:21:40 +00:00
|
|
|
*
|
2006-02-24 10:35:28 +00:00
|
|
|
* TODO: add logging
|
2006-02-24 10:21:40 +00:00
|
|
|
*
|
|
|
|
* @author Martin Dougiamas and many others. This has recently been extensively
|
|
|
|
* rewritten by Gustav Delius and other members of the Serving Mathematics project
|
|
|
|
* {@link http://maths.york.ac.uk/serving_maths}
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
2007-03-19 17:22:46 +00:00
|
|
|
* @package questionbank
|
2006-02-24 10:21:40 +00:00
|
|
|
*/
|
2007-05-07 16:57:23 +00:00
|
|
|
|
2006-02-24 10:35:28 +00:00
|
|
|
require_once("../config.php");
|
2006-02-24 10:21:40 +00:00
|
|
|
require_once("editlib.php");
|
|
|
|
|
2007-05-03 10:10:01 +00:00
|
|
|
list($thispageurl, $courseid, $cmid, $cm, $module, $pagevars) = question_edit_setup();
|
2007-05-04 10:46:33 +00:00
|
|
|
|
2006-02-24 10:35:28 +00:00
|
|
|
if (! $course = get_record("course", "id", $courseid)) {
|
2006-02-24 10:21:40 +00:00
|
|
|
error("This course doesn't exist");
|
|
|
|
}
|
2006-08-21 08:40:06 +00:00
|
|
|
$context = get_context_instance(CONTEXT_COURSE, $courseid);
|
|
|
|
|
2006-02-24 10:21:40 +00:00
|
|
|
|
2006-03-01 09:30:21 +00:00
|
|
|
$streditingquestions = get_string('editquestions', "quiz");
|
2007-05-03 10:10:01 +00:00
|
|
|
if ($cm!==null) {
|
2006-09-13 09:08:14 +00:00
|
|
|
$strupdatemodule = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $course->id))
|
2007-05-03 10:10:01 +00:00
|
|
|
? update_module_button($cm->id, $course->id, get_string('modulename', $cm->modname))
|
2006-03-01 09:30:21 +00:00
|
|
|
: "";
|
2007-05-03 10:10:01 +00:00
|
|
|
$crumbs = array();
|
|
|
|
$crumbs[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$course->id", 'type' => 'activity');
|
|
|
|
$crumbs[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?cmid={$cm->id}", 'type' => 'title');
|
|
|
|
$crumbs[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
|
|
|
|
$navigation = build_navigation($crumbs);
|
|
|
|
print_header_simple($streditingquestions, '', $navigation, "", "", true, $strupdatemodule);
|
2006-03-01 09:30:21 +00:00
|
|
|
|
|
|
|
$currenttab = 'edit';
|
|
|
|
$mode = 'questions';
|
2007-05-03 10:10:01 +00:00
|
|
|
${$cm->modname} = $module;
|
|
|
|
include($CFG->dirroot."/mod/$cm->modname/tabs.php");
|
2006-03-01 09:30:21 +00:00
|
|
|
} else {
|
2007-05-03 10:10:01 +00:00
|
|
|
// Print basic page layout.
|
|
|
|
$crumbs = array();
|
|
|
|
$crumbs[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
|
|
|
|
$navigation = build_navigation($crumbs);
|
|
|
|
|
|
|
|
print_header_simple($streditingquestions, '', $navigation);
|
|
|
|
|
2006-03-01 09:30:21 +00:00
|
|
|
// print tabs
|
|
|
|
$currenttab = 'questions';
|
|
|
|
include('tabs.php');
|
|
|
|
}
|
2007-05-03 10:10:01 +00:00
|
|
|
|
|
|
|
|
2007-01-09 09:07:16 +00:00
|
|
|
echo '<table class="boxaligncenter" border="0" cellpadding="2" cellspacing="0">';
|
2006-02-24 10:35:28 +00:00
|
|
|
echo '<tr><td valign="top">';
|
2006-02-24 10:21:40 +00:00
|
|
|
|
2007-05-04 10:46:33 +00:00
|
|
|
question_showbank($thispageurl, $cm, $pagevars['qpage'], $pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
|
|
|
|
$pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
|
2006-02-24 10:21:40 +00:00
|
|
|
|
|
|
|
echo '</td></tr>';
|
|
|
|
echo '</table>';
|
|
|
|
|
|
|
|
print_footer($course);
|
|
|
|
?>
|