2006-02-24 10:21:40 +00:00
|
|
|
<?php // $Id$
|
2009-01-19 05:30:01 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// //
|
|
|
|
// NOTICE OF COPYRIGHT //
|
|
|
|
// //
|
|
|
|
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
|
|
|
// http://moodle.org //
|
|
|
|
// //
|
|
|
|
// Copyright (C) 1999 onwards Martin Dougiamas and others //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License for more details: //
|
|
|
|
// //
|
|
|
|
// http://www.gnu.org/copyleft/gpl.html //
|
|
|
|
// //
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-02-24 10:21:40 +00:00
|
|
|
/**
|
2006-02-24 10:35:28 +00:00
|
|
|
* Page to edit the question bank
|
2006-02-24 10:21:40 +00:00
|
|
|
*
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
2007-03-19 17:22:46 +00:00
|
|
|
* @package questionbank
|
2009-01-19 05:30:01 +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-08-09 21:51:09 +00:00
|
|
|
list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) = question_edit_setup('questions');
|
2009-01-22 05:38:18 +00:00
|
|
|
$questionbank = new question_bank_view($contexts, $thispageurl, $COURSE, $cm);
|
2009-01-21 07:21:43 +00:00
|
|
|
$questionbank->process_actions();
|
2007-08-09 21:51:09 +00:00
|
|
|
|
2009-01-19 05:30:01 +00:00
|
|
|
// TODO log this page view.
|
2006-02-24 10:21:40 +00:00
|
|
|
|
2009-02-25 07:14:03 +00:00
|
|
|
$localcss = '<link rel="stylesheet" type="text/css" href="'.$CFG->wwwroot.
|
|
|
|
'/lib/yui/container/assets/container.css" />';
|
2007-08-09 21:51:09 +00:00
|
|
|
$context = $contexts->lowest();
|
2006-03-01 09:30:21 +00:00
|
|
|
$streditingquestions = get_string('editquestions', "quiz");
|
2007-05-03 10:10:01 +00:00
|
|
|
if ($cm!==null) {
|
2007-08-09 21:51:09 +00:00
|
|
|
$strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
|
|
|
|
? update_module_button($cm->id, $COURSE->id, get_string('modulename', $cm->modname))
|
2006-03-01 09:30:21 +00:00
|
|
|
: "";
|
2007-07-05 04:40:48 +00:00
|
|
|
$navlinks = array();
|
2007-08-13 13:21:22 +00:00
|
|
|
$navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$COURSE->id", 'type' => 'activity');
|
2007-08-15 11:36:01 +00:00
|
|
|
$navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?id={$cm->id}", 'type' => 'title');
|
2007-07-05 04:40:48 +00:00
|
|
|
$navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
|
|
|
|
$navigation = build_navigation($navlinks);
|
2009-06-26 09:06:16 +00:00
|
|
|
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.
|
2007-07-05 04:40:48 +00:00
|
|
|
$navlinks = array();
|
|
|
|
$navlinks[] = array('name' => $streditingquestions, 'link' => '', 'type' => 'title');
|
|
|
|
$navigation = build_navigation($navlinks);
|
2007-08-09 21:51:09 +00:00
|
|
|
|
2009-06-26 09:06:16 +00:00
|
|
|
print_header_simple($streditingquestions, '', $navigation, '', '');
|
2007-08-09 21:51:09 +00:00
|
|
|
|
2006-03-01 09:30:21 +00:00
|
|
|
// print tabs
|
|
|
|
$currenttab = 'questions';
|
|
|
|
include('tabs.php');
|
|
|
|
}
|
2007-08-09 21:51:09 +00:00
|
|
|
|
2009-02-25 07:14:03 +00:00
|
|
|
echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
|
2009-01-21 07:21:43 +00:00
|
|
|
$questionbank->display('questions', $pagevars['qpage'],
|
2009-01-19 05:30:01 +00:00
|
|
|
$pagevars['qperpage'], $pagevars['qsortorder'], $pagevars['qsortorderdecoded'],
|
|
|
|
$pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'], $pagevars['showquestiontext']);
|
2009-02-25 07:14:03 +00:00
|
|
|
echo "</div>\n";
|
2006-02-24 10:21:40 +00:00
|
|
|
|
2009-08-06 14:19:16 +00:00
|
|
|
echo $OUTPUT->footer();
|
2006-02-24 10:21:40 +00:00
|
|
|
?>
|