Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 403]

   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  /**
  18   * Question history preview.
  19   *
  20   * @package    qbank_history
  21   * @copyright  2022 Catalyst IT Australia Pty Ltd
  22   * @author     Safat Shahin <safatshahin@catalyst-au.net>
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   */
  25  
  26  require_once(__DIR__ . '/../../../config.php');
  27  require_once($CFG->dirroot . '/question/editlib.php');
  28  
  29  require_login();
  30  core_question\local\bank\helper::require_plugin_enabled('qbank_history');
  31  
  32  $entryid = required_param('entryid', PARAM_INT);
  33  $returnurl = required_param('returnurl', PARAM_LOCALURL);
  34  
  35  list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
  36          question_edit_setup('questions', '/question/bank/history/history.php');
  37  
  38  $url = new moodle_url($thispageurl, ['entryid' => $entryid, 'returnurl' => $returnurl]);
  39  $PAGE->set_url($url);
  40  $questionbank = new \qbank_history\question_history_view($contexts, $url, $COURSE, $entryid, $returnurl, $cm);
  41  
  42  $streditingquestions = get_string('history_header', 'qbank_history');
  43  $PAGE->set_title($streditingquestions);
  44  $PAGE->set_heading($streditingquestions);
  45  $context = $contexts->lowest();
  46  $PAGE->set_context($context);
  47  $PAGE->navbar->add(get_string('question'), new moodle_url($returnurl));
  48  $PAGE->navbar->add($streditingquestions, $url);
  49  
  50  echo $OUTPUT->header();
  51  // Print the question area.
  52  $questionbank->display($pagevars, 'questions');
  53  echo $OUTPUT->footer();