June 2017
Beginner to intermediate
368 pages
8h 31m
English
A detailed guide on the use of the File Storage API in a Moodle form is provided in the documentation at ;https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms. Essentially, any file (and in our case this will be an image) a user adds to the editor is given a unique identifier and then stored as a draft file in the file storage area--which bit of the storage area depends on the component type.
This process is handled in the call to data_preprocessing() as follows:
function data_preprocessing(&$default_values){ global $DB; if (!empty($this->_instance) && ($options = $DB- >get_records_menu('choice_options',array('choiceid'=>$this- >_instance), 'id', 'id,text')) && ($options2 = $DB->get_records_menu('choice_options', ...Read now
Unlock full access