Update API code from University of Aachen for merge back into the main code base with minimal changes to existing STACK code.
To allow the API to return appropriate data describing input configuration, the abstract stack_input class has been extended with the following methods:
get_api_solution($tavalue): Returns the model answer of the input in the same format in which it would be input by the user
get_api_solution_render($tadisplay): Returns a rendered version of the model answer of this input.
render_api_data($tavalue): Returns an array of configuration options which should be exposed via the API.
The get_api_solution and get_api_solution_render functions have sensible default implementations, which are only overwritten for more complex input types. The render_api_data function on the other hand is abstract, and needs to be implemented by each concrete input type individually.
Escalated visibilities
To be accessible directly, the following property/method visibilities have been promoted to public:
The search property inside the stack_multilang class.
The has_necessary_prt_inputs function of the qtype_stack_question class.
Minor changes
Some new language keys have been added.
Some imports inside the question.php and mathsoutputfilterbase.class.php files have been wrapped inside an if statement, to only be performed in non api contexts.
A new get_ta_render_for_input function has been added to the qtype_stack_question class.
A new pluginfiles property has been added to the qtype_stack_question class.
iframe.block.php handles plot URLs and iframe creation conditional on context (i.e API vs not API).
textdownload.block.php sets the document link href conditionally on context.
A new mathsoutputapi.class.php file has been added.
Not done
gitlab-ci.yml will need to be converted to a github workflow if we want to generate pre-built Docker images
Update API code from University of Aachen for merge back into the main code base with minimal changes to existing STACK code.
To allow the API to return appropriate data describing input configuration, the abstract
stack_input
class has been extended with the following methods:get_api_solution($tavalue)
: Returns the model answer of the input in the same format in which it would be input by the userget_api_solution_render($tadisplay)
: Returns a rendered version of the model answer of this input.render_api_data($tavalue)
: Returns an array of configuration options which should be exposed via the API.The
get_api_solution
andget_api_solution_render
functions have sensible default implementations, which are only overwritten for more complex input types. Therender_api_data
function on the other hand is abstract, and needs to be implemented by each concrete input type individually.Escalated visibilities
To be accessible directly, the following property/method visibilities have been promoted to public:
search
property inside thestack_multilang
class.has_necessary_prt_inputs
function of theqtype_stack_question
class.Minor changes
question.php
andmathsoutputfilterbase.class.php
files have been wrapped inside an if statement, to only be performed in non api contexts.get_ta_render_for_input
function has been added to theqtype_stack_question
class.pluginfiles
property has been added to theqtype_stack_question
class.iframe.block.php
handles plot URLs and iframe creation conditional on context (i.e API vs not API).textdownload.block.php
sets the document link href conditionally on context.mathsoutputapi.class.php
file has been added.Not done