How to keep count of the number of times a file has been downloaded?

Re: How to keep count of the number of times a file has been downloaded?

by Frankie Kam -
Number of replies: 0
Picture of Plugin developers

Hi Itamar

Thank you for your reply! Seems that it's a mixed bag. 
Referring to https://docs.moodle.org/23/en/Dataform_Field_Types :-

[ [fieldname:url] ]  = works
[ [
fieldname:size] ] = works
[ [
fieldname:download] ] = works

[ [fieldname:content] ] = doesn't work. 
[ [fieldname:downloadcount] ] = doesn't work



The downloadcount shows up blank.

I examined the filename "mod/dataform/field/file/classes/renderer.php" for instances of the identifier downloadcount and this is what I retrieved.

Line 71:            } else if ($cleanpattern == "{$fieldname}:downloadcount") {

Line 73:                $displaybrowse = $this->display_browse($entry, array('downloadcount' => 1));

Line 141:        if (!empty($params['downloadcount'])) {

Line 281:        $patterns["$fieldname:downloadcount"] = array(false);


Leaving it as it is since it's all Greek to me.

Regards
Frankie Kam