| Línea 28... |
Línea 28... |
| 28 |
use core_question\local\bank\view;
|
28 |
use core_question\local\bank\view;
|
| Línea 29... |
Línea 29... |
| 29 |
|
29 |
|
| 30 |
require_once(__DIR__ . '/../config.php');
|
30 |
require_once(__DIR__ . '/../config.php');
|
| Línea -... |
Línea 31... |
| - |
|
31 |
require_once($CFG->dirroot . '/question/editlib.php');
|
| - |
|
32 |
|
| - |
|
33 |
// Since Moodle 5.0 any request with the courseid parameter is deprecated and will redirect to the banks management page.
|
| - |
|
34 |
if ($courseid = optional_param('courseid', 0, PARAM_INT)) {
|
| - |
|
35 |
redirect(new moodle_url('/question/banks.php', ['courseid' => $courseid]));
|
| 31 |
require_once($CFG->dirroot . '/question/editlib.php');
|
36 |
}
|
| 32 |
|
37 |
|
| Línea 33... |
Línea 38... |
| 33 |
list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
|
38 |
list($thispageurl, $contexts, $cmid, $cm, $module, $pagevars) =
|
| 34 |
question_edit_setup('questions', '/question/edit.php');
|
39 |
question_edit_setup('questions', '/question/edit.php');
|
| Línea 41... |
Línea 46... |
| 41 |
|
46 |
|
| 42 |
if ($PAGE->course->id == $SITE->id) {
|
47 |
if ($PAGE->course->id == $SITE->id) {
|
| 43 |
$PAGE->set_primary_active_tab('home');
|
48 |
$PAGE->set_primary_active_tab('home');
|
| Línea -... |
Línea 49... |
| - |
|
49 |
}
|
| - |
|
50 |
|
| 44 |
}
|
51 |
// Mods that publish questions need a modified navbar breadcrumb here as they are managed differently to other module types.
|
| - |
|
52 |
if (plugin_supports('mod', $cm->modname, FEATURE_PUBLISHES_QUESTIONS, false)) {
|
| - |
|
53 |
$PAGE->navbar->ignore_active();
|
| - |
|
54 |
$coursenode = $PAGE->navigation->find($PAGE->course->id, navigation_node::TYPE_COURSE);
|
| - |
|
55 |
$modnode = $PAGE->navigation->find($cm->id, navigation_node::TYPE_ACTIVITY);
|
| - |
|
56 |
$PAGE->navbar->add($coursenode->text, $coursenode->action, $coursenode->type, $coursenode->shorttext, icon: $coursenode->icon);
|
| - |
|
57 |
$PAGE->navbar->add(get_string('questionbank_plural', 'core_question'),
|
| - |
|
58 |
\core_question\local\bank\question_bank_helper::get_url_for_qbank_list($PAGE->course->id)
|
| - |
|
59 |
);
|
| - |
|
60 |
$PAGE->navbar->add($modnode->text, $modnode->action, $modnode->type, $modnode->shorttext, icon: $modnode->icon);
|
| 45 |
|
61 |
}
|
| Línea 46... |
Línea 62... |
| 46 |
$thispageurl->param('deleteall', 1);
|
62 |
|
| 47 |
$questionbank = new view($contexts, $thispageurl, $COURSE, $cm, $pagevars);
|
63 |
$questionbank = new view($contexts, $thispageurl, $COURSE, $cm, $pagevars);
|
| 48 |
|
64 |
|
| 49 |
$context = $contexts->lowest();
|
65 |
$context = $contexts->lowest();
|
| 50 |
$streditingquestions = get_string('editquestions', 'question');
|
66 |
$streditingquestions = get_string('editquestions', 'question');
|
| Línea 51... |
Línea 67... |
| 51 |
$PAGE->set_title($streditingquestions);
|
67 |
$PAGE->set_title($streditingquestions);
|
| - |
|
68 |
$PAGE->set_heading($COURSE->fullname);
|
| - |
|
69 |
$PAGE->activityheader->disable();
|
| - |
|
70 |
|
| - |
|
71 |
echo $OUTPUT->header();
|
| - |
|
72 |
if (!\core_question\local\bank\question_bank_helper::has_bank_migration_task_completed_successfully()) {
|
| - |
|
73 |
$defaultactivityname = \core_question\local\bank\question_bank_helper::get_default_question_bank_activity_name();
|
| - |
|
74 |
echo $OUTPUT->notification(
|
| - |
|
75 |
get_string('transfernotfinished', 'mod_' . $defaultactivityname),
|
| - |
|
76 |
\core\output\notification::NOTIFY_WARNING,
|
| - |
|
77 |
false,
|
| Línea 52... |
Línea 78... |
| 52 |
$PAGE->set_heading($COURSE->fullname);
|
78 |
);
|
| 53 |
$PAGE->activityheader->disable();
|
79 |
echo $OUTPUT->footer();
|
| Línea 54... |
Línea 80... |
| 54 |
|
80 |
exit();
|
| Línea 62... |
Línea 88... |
| 62 |
echo $renderer->render($qbankaction);
|
88 |
echo $renderer->render($qbankaction);
|
| Línea 63... |
Línea 89... |
| 63 |
|
89 |
|
| 64 |
// Print the question area.
|
90 |
// Print the question area.
|
| Línea -... |
Línea 91... |
| - |
|
91 |
$questionbank->display();
|
| - |
|
92 |
|
| - |
|
93 |
[$categoryid, $contextid] = explode(',', $pagevars['cat']);
|
| 65 |
$questionbank->display();
|
94 |
$questionbank->init_bulk_actions_js();
|
| 66 |
|
- |
|
| 67 |
// Log the view of this category.
|
95 |
|
| 68 |
list($categoryid, $contextid) = explode(',', $pagevars['cat']);
|
96 |
// Log the view of this category.
|
| 69 |
$category = new stdClass();
|
97 |
$category = new stdClass();
|
| 70 |
$category->id = $categoryid;
|
98 |
$category->id = $categoryid;
|
| 71 |
$catcontext = context::instance_by_id($contextid);
|
99 |
$catcontext = context::instance_by_id($contextid);
|