Select Git revision
vle_specific.php
vle_specific.php 12.00 KiB
<?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/>.
defined('MOODLE_INTERNAL') || die();
// This file defines question_display_options which the next class extends.
require_once(__DIR__.'/../../../lib/questionlib.php');
require_once('questiondisplayoptions.php');
/**
* A collection of things that are a bit VLE specific and have been
* extracted from the general logic.
*
* If you are porting to another platform you should check these out
* these are not going to stop you from progressing but you will need
* these at some point.
*
* There are two main things here:
*
* 1. Permission checking, the future error message system will tune its
* verbosity based on whether the user is a teacher or not.
*
* 2. Attached file management, any links that need rewriting to
* access attached fiels should be handled by this. This is relevant
* for all bits of CASText.
*
*
* Elsewhere there are other major things:
*
* 1. The JSXGraph block in the CASText system uses JavaScript and loads
* it through the system, you will probably need to replace the block,
* should be enough to replace the portion of the block pushing out
* the script and the script itself may require some tuning related
* to the JavaScript Module system. If you don't want to support
* binding of inputs to JSXGraphs, just throw the block away.
*
* CASText blocks can be replaced during execution so you do not even
* need to touch the original file. Simply use the `register`-function
* in the block-factory to replace the class handling that particular
* block. Same logic can be used to add blocks if for example your file
* management would need a new one.
*
* 2. The inputs and their related JavaScripts, these are the difficult
* ones. Again replacing scripts and the loading logic for them can
* prove to be hard and you may even choose to live without
* the instant validation feature those scripts provide. Other than
* that the recommended way is to map whatever way you deal with
* $_POST or even $_GET data so that those inputs receive similar
* $response arrays as they would in Moodle. Mapping functions for
* dealing with the script handling would be a good idea, or dummy
* functions if one does not care about those.
*
* 3. Storage of the question, you can freely store thigns as you wish
* but it would be nice to have unique identifiers for all
* the things that the original Moodle database model has separated
* to tables. And naturally mapping to similar arrays/objects on
* on the code side will help.