How to summarize Database Documents times viewed

How to summarize Database Documents times viewed

by HUGO ALDO ESPOSITO -
Number of replies: 2

I have a database activity with documents, most of them in PDF format and also some links to documents outside my site.

I need to have a method to summarize times each document is viewed.

I added one column to Moodle database table mdl_data_records named times_viewed but I can't 

made the hook to know where and how can catch te record access and add 1 to this new field created in order to have reading statistics from my database.

Does anybody can help me ??

Thank you all a lot

Average of ratings: -
In reply to HUGO ALDO ESPOSITO

Re: How to summarize Database Documents times viewed

by William Lu -
Picture of Particularly helpful Moodlers
Hi Hugo,

If it is you or other editing-teachers in charge of adding these resources, then, you could try this workaround:

In course editing mode:

1. Create a New stealth section (hide it from students and make it available).
2. Upload every file as a new resource.
3. Create every link as a new resource.

In Database activity:

4. Create a URL link field or a simple text field.
5. Add new entries, every single entry is a link to your resources.

In Course administration:

6. Reports > Logs, check for every resource accessing log, individually.


HTH
In reply to William Lu

Re: How to summarize Database Documents times viewed

by HUGO ALDO ESPOSITO -
Hi William ! ( better late than never )

Your workaround dont works for me because all my documents are links to external sites and also the database is in the
home page because I need to be accessed without login or registration or access as guest, the people to this repository is directed have
very poor knowlege of Moodle an IT in general.
Because the type of documents ( all links ) and the place where the database is located the log only save the number of the repository but not the document id.
If you have another idea I will receive it with pleasure.
Thank you a lot