forked from maths/moodle-qtype_stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
79 lines (69 loc) · 3.22 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
// This file is part of STACK - http://stack.maths.ed.ac.uk/
//
// Stack is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Stack is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Stack. If not, see <http://www.gnu.org/licenses/>.
/**
* Configuration settings declaration information for the Stack question type.
*
* @package qtype_stack
* @copyright 2021 The University of Edinburgh
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../../../../config.php');
require_once(__DIR__ . '/../stack/utils.class.php');
require_once(__DIR__ . '/../locallib.php');
// Authentication. Because of the cache, it is safe to make this available to any
// logged in user.
require_login();
require_capability('qtype/stack:usediagnostictools', context_system::instance());
// Useful links.
$links = [
get_string('stackDoc_docs_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/doc/doc.php/')]),
get_string('chat_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/caschat.php')]),
get_string('bulktestindexintro_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/bulktestindex.php')]),
get_string('todo_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/todo.php')]),
get_string('dependenciesintro_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/dependencies.php')]),
get_string('stackInstall_replace_dollars_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/replacedollarsindex.php')]),
get_string('stackInstall_testsuite_title_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/answertests.php')]),
get_string('stackInstall_input_title_desc', 'qtype_stack',
['link' => (string) new moodle_url('/question/type/stack/adminui/studentinputs.php')]),
];
// Set up the page object.
$PAGE->set_context(context_system::instance());
$PAGE->set_url('/question/type/stack/adminui/index.php');
$title = stack_string('settingusefullinks');
$PAGE->set_pagelayout('report');
$PAGE->set_title($title);
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
$list = '';
foreach ($links as $link) {
$list .= html_writer::tag('li', $link);
}
echo html_writer::tag('ul', $list);
/* Add the version number and logos to the front page. */
$settings = get_config('qtype_stack');
$libs = array_map('trim', explode(',', $settings->maximalibraries));
asort($libs);
$libs = implode(', ', $libs);
$vstr = $settings->version . ' (' . $libs . ')';
echo html_writer::tag('p', stack_string('stackDoc_version', $vstr));
echo $OUTPUT->footer();