Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403] [Versions 401 and 403] [Versions 402 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  $pagevars['entryid'] = $entryid;
  38  $pagevars['returnurl'] = $returnurl;
  39  $url = new moodle_url($thispageurl, ['entryid' => $entryid, 'returnurl' => $returnurl]);
  40  $PAGE->set_url($url);
  41  
  42  // Additional param to differentiate with other question bank view.
  43  $extraparams['entryid'] = $entryid;
  44  $extraparams['returnurl'] = $returnurl;
  45  $questionbank = new \qbank_history\question_history_view($contexts, $url, $COURSE, null, $pagevars, $extraparams);
  46  
  47  $streditingquestions = get_string('history_header', 'qbank_history');
  48  $PAGE->set_title($streditingquestions);
  49  $PAGE->set_heading($streditingquestions);
  50  $context = $contexts->lowest();
  51  $PAGE->set_context($context);
  52  $PAGE->navbar->add(get_string('question'), new moodle_url($returnurl));
  53  $PAGE->navbar->add($streditingquestions, $url);
  54  
  55  echo $OUTPUT->header();
  56  // Print the question area.
  57  $questionbank->display();
  58  echo $OUTPUT->footer();