2009-11-04 11:57:52 +00:00
|
|
|
<?php
|
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");
|
|
|
|
|
2010-01-16 15:39:56 +00:00
|
|
|
$url = new moodle_url('/question/edit.php');
|
2009-09-16 02:43:58 +00:00
|
|
|
if (($lastchanged = optional_param('lastchanged', 0, PARAM_INT)) !== 0) {
|
|
|
|
$url->param('lastchanged', $lastchanged);
|
|
|
|
}
|
|
|
|
if (($category = optional_param('category', 0, PARAM_TEXT)) !== 0) {
|
|
|
|
$url->param('category', $category);
|
|
|
|
}
|
|
|
|
if (($qpage = optional_param('qpage', 0, PARAM_INT)) !== 0) {
|
|
|
|
$url->param('qpage', $qpage);
|
|
|
|
}
|
|
|
|
if (($cat = optional_param('cat', 0, PARAM_TEXT)) !== 0) {
|
|
|
|
$url->param('cat', $cat);
|
|
|
|
}
|
|
|
|
if (($courseid = optional_param('courseid', 0, PARAM_INT)) !== 0) {
|
|
|
|
$url->param('courseid', $courseid);
|
|
|
|
}
|
|
|
|
if (($returnurl = optional_param('returnurl', 0, PARAM_INT)) !== 0) {
|
|
|
|
$url->param('returnurl', $returnurl);
|
|
|
|
}
|
|
|
|
$PAGE->set_url($url);
|
|
|
|
|
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
|
|
|
|
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) {
|
2009-09-08 01:43:08 +00:00
|
|
|
$PAGE->navbar->add($streditingquestions);
|
|
|
|
$PAGE->set_title($streditingquestions);
|
|
|
|
echo $OUTPUT->header();
|
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.
|
2009-09-08 01:43:08 +00:00
|
|
|
$PAGE->navbar->add($streditingquestions);
|
|
|
|
$PAGE->set_title($streditingquestions);
|
|
|
|
echo $OUTPUT->header();
|
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();
|
2009-11-04 11:57:52 +00:00
|
|
|
|