How to save filemanager input and display it to student and teacher/manager

Re: How to save filemanager input and display it to student and teacher/manager

by Edmund Evangelista -
Number of replies: 2

I have the same situation. I had been reading all about this File API but could not get started because I am lost on how to start it. I know how to save the data entered by any user into a textbox/textarea and save it across related tables. But the file attachment is my problem because the sample code shown in File API are excerpts only. Can we have complete steps to store/load an attachment using filemanager of File API? As well as scripts/line of code along each steps? 

In reply to Edmund Evangelista

Re: How to save filemanager input and display it to student and teacher/manager

by Raymond Mlambo -

I really hope that someone can provide a solution for this, coz thats exactly the problem that I'm facing.

I've managed to get the file upload, saving and serving to users working in my plugins, particularly in the view.php pages. I did this through studying the code in /mod/resource and /mod/videofile. But I cant seem to get it to work, especially on a standalone form where I just want a user to upload a file and get it saved for later assessment by the teacher.

for instance, I have a separate page called "studentsfinalupload.php" where a student uploads a final document for his fellow students to look at. The form and the class instance are in this same page, and I would like to handle everything there. Some assistance would be greatly appreciated, and would really go a long way simplifying this API.


In reply to Raymond Mlambo

Re: How to save filemanager input and display it to student and teacher/manager

by Edmund Evangelista -

Raymond we have the same agenda. Mine is to develop a page that will allow teachers to upload their syllabus, store the metadata into the database using a particular course module. The syllabus uploaded should be automatically positioned on Week 0 of a particular course. I can do all the positioning of the data in Week 0 as well as store metadata in correlated tables via code behind, my only problem is to save the syllabus physically to the moodledata and reflect it back to the course using FileAPI.

The reason behind why this is done on the page I had developed is so that I could trigger a field that this particular course had uploaded a syllabus. Later on, it is easy for me to generate a report of all courses who never uploaded a syllabus.