Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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;
1441 ariadna 39
$url = new moodle_url(
40
    $thispageurl,
41
    [
42
        'entryid' => $entryid,
43
        'returnurl' => $returnurl,
44
        'view' => '\qbank_history\question_history_view',
45
        'extraparams' => json_encode(['entryid' => $entryid, 'returnurl' => $returnurl]),
46
    ],
47
);
1 efrain 48
$PAGE->set_url($url);
49
 
50
// Additional param to differentiate with other question bank view.
51
$extraparams['entryid'] = $entryid;
52
$extraparams['returnurl'] = $returnurl;
1441 ariadna 53
$questionbank = new \qbank_history\question_history_view($contexts, $url, $COURSE, $cm, $pagevars, $extraparams);
1 efrain 54
 
55
$streditingquestions = get_string('history_header', 'qbank_history');
56
$PAGE->set_title($streditingquestions);
57
$PAGE->set_heading($streditingquestions);
58
$context = $contexts->lowest();
59
$PAGE->set_context($context);
60
$PAGE->navbar->add(get_string('question'), new moodle_url($returnurl));
61
$PAGE->navbar->add($streditingquestions, $url);
62
 
63
echo $OUTPUT->header();
64
// Print the question area.
65
$questionbank->display();
1441 ariadna 66
$questionbank->init_bulk_actions_js();
1 efrain 67
echo $OUTPUT->footer();