Skip to content

Commit 36804c0

Browse files
committed
api-wording - Redirect to sample page
1 parent a463444 commit 36804c0

7 files changed

Lines changed: 112 additions & 14 deletions

File tree

api/emulation/Localization.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,17 @@ function current_language() {
3636
function get_string($identifier, $component, $a = null) {
3737
$userlanguage = current_language();
3838

39+
static $string = [];
3940
switch ($userlanguage)
4041
{
4142
case 'de':
42-
static $string = [];
4343
if (empty($string)) {
4444
// Load en values as defaults.
4545
include(__DIR__ .'/../../lang/en/qtype_stack.php');
4646
include(__DIR__ .'/../../lang/de/qtype_stack.php');
4747
}
4848
break;
4949
default:
50-
static $string = [];
5150
if (empty($string)) {
5251
include(__DIR__ .'/../../lang/en/qtype_stack.php');
5352
}

api/public/api.css

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,63 @@ a.nav-link:link, a.nav-link:visited, a.nav-link:hover, a.nav-link:active {
5656
.sidebar {width: 100%; height: auto; position: relative; border-style: solid; border-width: 0px 0px 1px 0px; border-color: #e0dfdf}
5757
.sidebar a {text-align: center; float: none;}
5858
.main-content {margin-left: 0; padding: 0px;}
59-
}
59+
}
60+
.container-footer {
61+
width: 100%;
62+
padding-right: 1rem;
63+
padding-left: 1rem;
64+
max-width: 97.75rem;
65+
margin-right: auto;
66+
margin-left: auto
67+
}
68+
@media (min-width: 768px) {
69+
.container-footer {
70+
padding-right:2rem;
71+
padding-left: 2rem
72+
}
73+
}
74+
.footer-discover {
75+
background: #252525
76+
}
77+
.footer-discover-heading {
78+
width: 100%;
79+
padding-right: 1rem;
80+
padding-left: 1rem;
81+
max-width: 97.75rem;
82+
margin-right: auto;
83+
margin-left: auto;
84+
font-size: calc(1.34375rem + .65625vw);
85+
padding-top: 1.5rem;
86+
padding-bottom: 1.3rem;
87+
margin-bottom: 0;
88+
font-family: "Crimson Text",serif;
89+
font-weight: 400;
90+
line-height: 1;
91+
color: #b0b0b0;
92+
text-transform: uppercase
93+
}
94+
@media (min-width: 768px) {
95+
.footer-discover-heading {
96+
padding-right:2rem;
97+
padding-left: 2rem
98+
}
99+
}
100+
@media (min-width: 1600px) {
101+
.footer-discover-heading {
102+
font-size:2rem
103+
}
104+
}
105+
.footer {
106+
padding: 1rem 0;
107+
color: #d4d4d4;
108+
background: linear-gradient(to bottom,#3a3a3a 0,#252525 100%) repeat scroll 0 0;
109+
background-color: #3a3a3a;
110+
}
111+
footer a {
112+
color: white;
113+
text-decoration: none
114+
}
115+
footer a:hover {
116+
--edgel-link-color-rgb: var(--edgel-link-hover-color-rgb);
117+
text-decoration: underline
118+
}

api/public/favicon.ico

101 KB
Binary file not shown.

api/public/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
$app->post('/grade', GradingController::class);
5252
$app->post('/validate', ValidationController::class);
5353
$app->post('/download', DownloadController::class);
54-
54+
$app->redirect('/{page}', '/sample.php', 301);
5555
$app->run();

api/public/sample.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
// Required to pass Moodle code check. Uses emulation stub.
2929
require_login();
3030
// It's cleaner to just show the contents of the question library directory.
31-
$files = stack_question_library::get_file_list('../../samplequestions/stackdemo/stacklibrary/*');
31+
$files = stack_question_library::get_file_list('../../samplequestions/stackdemo/*');
3232

3333
$questions = [];
3434
foreach ($files->children as $file) {
3535
if (!$file->isdirectory) {
3636
$question = new StdClass();
37-
$questiondata = file_get_contents('../../samplequestions/stacklibrary/' . $file->path);
37+
$questiondata = file_get_contents('../../samplequestions/' . $file->path);
3838
$questionobject = simplexml_load_string($questiondata)->question;
3939
$question->definition = $questiondata;
4040
$question->name = (string) $questionobject->name->text;
@@ -142,6 +142,9 @@ function toggleAnswer(button) {
142142
STACK is also available for direct integration in Moodle, ILIAS and through LTI.
143143
For more information visit <a href="https://stack-assessment.org/">the STACK community page</a>.
144144
</p>
145+
<p>
146+
There is also a <a href="/stack.php">library of STACK questions</a> on this demo site.
147+
</p>
145148
<hr>
146149
</div>
147150
<div>
@@ -181,17 +184,19 @@ function toggleAnswer(button) {
181184
</div>
182185
</div>
183186
</div>
187+
<hr />
188+
<p style="font-size: 0.875em;color:gray;">
189+
The STACK source code, including this API, is Licensed under the GNU General Public, License Version 3.
190+
Documentation, sample questions and materials, are licensed under Creative Commons Attribution-ShareAlike 4.0 International.
191+
See the <a href="https://docs.stack-assessment.org/en/About/License/">STACK licence</a> page for full details.
192+
</p>
193+
<? readfile(__DIR__ . '/stackfooter.html') ?>
184194
</div>
185195
</div>
186196
<br>
187197
</div>
188198
</div>
189-
<hr />
190-
<p><span style="font-size: 0.875em;color:gray;">
191-
The STACK source code, including this API, is Licensed under the GNU General Public, License Version 3.
192-
Documentation, sample questions and materials, are licensed under Creative Commons Attribution-ShareAlike 4.0 International.
193-
See the <a href="https://docs.stack-assessment.org/en/About/License/">STACK licence</a> page for full details.
194-
</span></p>
199+
195200
</body>
196201
<script type="text/javascript">
197202
<?php

api/public/stack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function setQuestion(question) {
133133
</div>
134134
<?php echo stack_string('api_choose_q')?>:
135135
<?php
136-
$files = stack_question_library::get_file_list('../../samplequestions/*');
136+
$files = stack_question_library::get_file_list('../../samplequestions/stacklibrary/*');
137137
function render_directory($dirdetails) {
138138
echo '<div style="margin-left: 30px;">';
139139
foreach ($dirdetails as $file) {
@@ -193,7 +193,7 @@ function render_directory($dirdetails) {
193193
</div>
194194
</div>
195195
<br>
196-
196+
<? readfile(__DIR__ . '/stackfooter.html') ?>
197197
</body>
198198
<script>
199199
const yamlEditor = CodeMirror.fromTextArea(document.getElementById("xml"),

api/public/stackfooter.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
<footer>
3+
<div class="footer-discover">
4+
<h3 class="footer-discover-heading">
5+
The University of Edinburgh
6+
</h3></div>
7+
<div class="footer">
8+
<div class="container-footer">
9+
<div class="row">
10+
<div class="col-md-4">
11+
<ul class="list-unstyled">
12+
<li><a href="https://www.ed.ac.uk/about/website/website-terms-conditions">Terms &amp; conditions</a></li>
13+
<li><a href="https://edin.ac/privacy-information">Privacy &amp; cookies</a></li>
14+
<li><a href="https://www.ed.ac.uk/university-secretary-group/complaint-handling-procedure">Complaints procedure</a></li>
15+
<li><a href="https://www.ed.ac.uk/sustainability/what-we-do/supply-chains/initiatives/modern-slavery/statement">Modern slavery</a></li>
16+
</ul>
17+
</div>
18+
<div class="col-md-4">
19+
<ul class="list-unstyled">
20+
<li><a href="https://edin.ac/accessibility-statement">Website accessibility</a></li>
21+
<li><a href="https://www.ed.ac.uk/about/website/freedom-information">Freedom of information publication scheme</a></li>
22+
<li><a href="https://www.ed.ac.uk/data-protection">Data protection / Records Management</a></li>
23+
</ul>
24+
</div>
25+
</div>
26+
<div class="row">
27+
<div class="col-md-8 order-md-1">
28+
<p>
29+
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336, VAT Registration Number GB&nbsp;592&nbsp;9507&nbsp;00, and is acknowledged by the UK authorities as a “<a href="https://www.gov.uk/guidance/recognised-uk-degrees">Recognised body</a>” which has been granted degree awarding powers.
30+
</p>
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
</footer>

0 commit comments

Comments
 (0)