How can I download assignment files uploaded by other user?

How can I download assignment files uploaded by other user?

by Kiran S -
Number of replies: 6

Hi,

A user has uploaded their assignment to someone (say peer). One who uploads can download their assignment using the URL. But the other one (peer), who needs the assignment is unable to download the assignment using the same URL because of the permissions. It says file not found on the server.

How can I make the other user (peer) to download the assignment successfully?

http://mydomain.com/pluginfile.php/120/assignsubmission_file/submission_files/5/sample.pdf?forcedownload=1

Thanks
Kiran

Average of ratings: -
In reply to Kiran S

Re: How can I download assignment files uploaded by other user?

by Davo Smith -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

You either need to rewrite the function assignfeedback_file_pluginfile in mod/assign/submission/file/lib.php OR you need to create your own copy of mod/assign/submission/file, rename it and create a new plugin to do specifically what you want (the second is more complex, but generally thought to be better).

You will need to decide for yourself how you will allocate which people are allowed to download other student's assignments (always allowing anyone to download any assignment would, clearly, be a bad idea). You may wish to put together a new page allowing allocation of peers to each other, or a setting to allow students in the same group to download each others files, or something similar.

Davo

Average of ratings: Useful (2)
In reply to Davo Smith

Re: How can I download assignment files uploaded by other user?

by triveni mergu -

Hi

make sure once, are you able to see all the submitted files from others in

http://domain-name/mod/assign/view.php?id=5&action=grading

Average of ratings: Useful (1)
In reply to Davo Smith

Re: How can I download assignment files uploaded by other user?

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Looks like re-implementing what the Workshop module does...
Average of ratings: Useful (1)
In reply to Davo Smith

Re: How can I download assignment files uploaded by other user?

by Kiran S -

I commented out return false in lib,php file

 if (!$assign->get_instance()->teamsubmission &&

        !$assign->can_view_submission($userid)) {

        //return false;

    }


Thanks Davo. It worked! smile

Thanks Triveni & David for the help! smile


In reply to Kiran S

Re: How can I download assignment files uploaded by other user?

by Davo Smith -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

As long as you realise that the change you have made will allow any user on the site (including guest users) to download any assignment file they want - I'd certainly not be comfortable with allowing that on any site I was managing, but if that's the way it needs to work for you ...

(I'd certainly agree with David that you should be investigating the 'workshop' activity instead - that way you can control who downloads each assignment and capture peer-assessments at the same time).

In reply to Davo Smith

Re: How can I download assignment files uploaded by other user?

by triveni mergu -

or else we can restrict a user to download files by giving condition as if the user role is site admin then return true else false. so that only site admin can only view/download.