Tim thank you for your explanation. I began to understand the time exploring everything that concerned the types of questions. I confess, however, that the link will greatly help me:
Or where is my main weakness is in everything that concerns the API files.
I do not know yet exactly how I'll be able to upload a file in the internal file system of moodle as the types of questions to expect more from a user upload. I do not know how to simulate a file picker in a phpunit test.
I discoved this documentation:
With this documentation, I should be able to import the file in the folder "test" and insert it into the database:
$filename = 'myfile.docx';
$mytestfile = $CFG->dirroot . '/questions/type/myqtype/tests/files/' . $filename;
$context = get_context_instance(???);
$fs = get_file_storage();
$file_record = array('contextid'=>$context->id, 'component'=>'qtype_myqtype', 'filearea'=>'???',
'itemid'=>0, 'filepath'=>'/', 'filename'=>$filename,
Once the file is inserted into the database, then I can create my object "question_file_loader" required as a response to unit test pass.
Am I on the right track for the filing of the file?