edit.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // This file is part of Moodle - http://moodle.org/
  3. //
  4. // Moodle is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // Moodle is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * Page to edit the question bank
  18. *
  19. * @package moodlecore
  20. * @subpackage questionbank
  21. * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
  22. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23. */
  24. require_once(__DIR__ . '/../config.php');
  25. require_once($CFG->dirroot . '/question/editlib.php');
  26. list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
  27. question_edit_setup('questions', '/question/edit.php');
  28. $url = new moodle_url($thispageurl);
  29. if (($lastchanged = optional_param('lastchanged', 0, PARAM_INT)) !== 0) {
  30. $url->param('lastchanged', $lastchanged);
  31. }
  32. $PAGE->set_url($url);
  33. $questionbank = new core_question\bank\view($contexts, $thispageurl, $COURSE, $cm);
  34. $questionbank->process_actions();
  35. // TODO log this page view.
  36. $context = $contexts->lowest();
  37. $streditingquestions = get_string('editquestions', 'question');
  38. $PAGE->set_title($streditingquestions);
  39. $PAGE->set_heading($COURSE->fullname);
  40. echo $OUTPUT->header();
  41. echo '<div class="questionbankwindow boxwidthwide boxaligncenter">';
  42. $questionbank->display('questions', $pagevars['qpage'], $pagevars['qperpage'],
  43. $pagevars['cat'], $pagevars['recurse'], $pagevars['showhidden'],
  44. $pagevars['qbshowtext']);
  45. echo "</div>\n";
  46. echo $OUTPUT->footer();