Associate a file to a text

Associate a file to a text

by Helson C -
Number of replies: 2

Hello,

I need create a plugin who each user can send a file (pdf, doc, txt) and associate a text.

I know how can send a file to moodle through the api, create a form and save it in db.

How i can connect the file sent to the text?

In short, 

each user access the form, send a file and a type a description of it. 

Meantime, the file and description need to be public to another users.


I need a way to do this.

Thanks in advance.

Average of ratings: -
In reply to Helson C

Re: Associate a file to a text

by Just H -

Instead of messing around with the api why not use the core database activity module or the existing dataform plugin?

In reply to Just H

Re: Associate a file to a text

by Helson C -

Hey Just,

Thank you for you answer!

I do not like to work with activity modules because the plugin need stay outside a course.

My company bought a theme who don't have a moodle front page, in other words, this theme don't have blocks and "edit button" in frontpage and etc... and I can't add activities to it.

Thereby, i need a plugin who can accessible in "my home", in a way that all users of the site can see.

I think in add a new link in navigation block to access the plugin and see all files and text sent by the users.

What i had said before is a mistake, the users cant send this file, only the admin who can send.

If it is not too much to ask, I would like to know how to associate an item from the file manager with a text.


Thanks in advance.