+
+ + +
+ + +
diff --git a/api/public/api.css b/api/public/api.css new file mode 100644 index 0000000000..5a0a08c320 --- /dev/null +++ b/api/public/api.css @@ -0,0 +1,59 @@ +.CodeMirror { border: 1px solid #ddd;} +.CodeMirror { + width: 100%; + float: left; + height: 400px; +} +.feedback { + color: #7d5a29; + background-color: #fcf2d4; + border-radius: 4px; + border: 1px solid #7d5a2933; + display: inline-block; + padding: 5px; +} +.validation { + border-radius: 4px; + border: 1px solid darkgrey; + padding: 5px; + display: inline-block; +} +.correct-answer { + background-color: white; + border-radius: 4px; + border: 1px solid darkgrey; + padding: 0px 5px 0px; + display: inline-block; +} +a.nav-link:link, a.nav-link:visited, a.nav-link:hover, a.nav-link:active { + color:black; + text-decoration:none; +} +.stack-library-file-list { + padding: 20px 0px 20px 0px; + height: 400px; + overflow-y: scroll; + border: 1px solid lightblue; + border-radius: 10px; +} +/* The side navigation menu */ +.sidebar {margin: 0; padding: 0; position: absolute; width: 200px;} +.sidebar a {display: block; color: black; padding: 16px; border-style: solid; border-width: 0px 0px 1px 0px; border-color: #e0dfdf; text-decoration: none;} +.sidebar a.active {background-color: #004f71; color: white; pointer-events: none;} +/* Page content. The value of the margin-left property should match the value of the sidebar's width property */ +.main-content {margin-left: 200px; padding: 1px 16px;} +/* On screens that are less than 800px wide, make the sidebar into a topbar */ +@media screen and (max-width: 800px) { + .sidebar {width: 100%; height: 110px; position: relative; border-style: solid; border-width: 0px 0px 1px 0px; border-color: #e0dfdf } + .sidebar a {float: left; border-style: none;} + .main-content {margin-left: 0; padding: 0px;} +} +/* On screens that are less than 720px wide, make the sidebar into a taller topbar as menu goes to three lines*/ +@media screen and (max-width: 720px) { + .sidebar {width: 100%; height: 160px; position: relative; border-style: solid; border-width: 0px 0px 1px 0px; border-color: #e0dfdf} +} +/* On screens that are less than 550px, display the bar vertically, instead of horizontally */ +@media screen and (max-width: 550px) { + .sidebar {height: auto;} + .sidebar a {text-align: center; float: none;} +} \ No newline at end of file diff --git a/api/public/sample.php b/api/public/sample.php new file mode 100644 index 0000000000..1329fa34f0 --- /dev/null +++ b/api/public/sample.php @@ -0,0 +1,450 @@ +. + +/** + * This page presents the user with a selection of questions to try. + * + * @package qtype_stack + * @copyright 2023 University of Edinburgh + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. + */ + +require_once('../config.php'); +require_once(__DIR__ . '../../emulation/MoodleEmulation.php'); +require_once(__DIR__ . '/../../stack/questionlibrary.class.php'); +// Required to pass Moodle code check. Uses emulation stub. +require_login(); +// @codingStandardsIgnoreStart +$files = stack_question_library::get_file_list('../../samplequestions/stacklibrary/Algebra-Refresher/01-Combinations-of-arithmetic-operations/*'); +$questions = []; +foreach ($files->children as $file) { + if (!$file->isdirectory) { + $question = new StdClass(); + $questiondata = file_get_contents('../../samplequestions/' . $file->path); + $questionobject = simplexml_load_string($questiondata)->question; + $question->definition = $questiondata; + $question->name = $questionobject->name->text; + $question->seeds = $questionobject->deployedseed; + $questions[] = $question; + } +} +?> + +
+ + + + + + + + + + + + + + + + + + + +