How to get the content from uploaded file

How to get the content from uploaded file

by Tim Kernegger -
Number of replies: 3

Hi,

I am currently writing a automatically graded question type plugin. Therefore I override the function "grade_response(array $response)". I need to merge two uploaded files into a new file and execute the new file. I used a file manager to upload the files.

I read the documentation but I don't really get it. Thanks in advance.

Regards,

Tim

Average of ratings: -
In reply to Tim Kernegger

Re: How to get the content from uploaded file

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

The assignsubmission_pdf plugin combines multiple uploaded PDF files into one, so it contains code that is probably a good starting point too. The source code by Davo Smith is relatively old, but it is compatible with Moodle 3.x, see https://github.com/davosmith/moodle-assignsubmission_pdf. The relevant code starts at https://github.com/davosmith/moodle-assignsubmission_pdf/blob/master/locallib.php#L304, I think.