Effect of Removing Submitted Assignments ?

Effect of Removing Submitted Assignments ?

by Muhammad Abdul Basit -
Number of replies: 10

I want to free some disk space by deleting submitted assignments. I have two questions:

1. If a teacher removes (the available option is Remove Submission instead of Delete) all submissions against any assignment, whether students' submissions will be deleted and will it result in freeing disk space (reducing moodledata size)?

2. In case the submissions are removed against an assignment whether or not graded annotated files, feedback and grades against those submissions will also be removed?

Average of ratings: -
In reply to Muhammad Abdul Basit

Re: Effect of Removing Submitted Assignments ?

by erika alarcon -
Picture of Testers

Hello, if you delete exams it will free up the disk space, but it seems more effective if you Restart the courses that are no longer going to be used

In reply to erika alarcon

Re: Effect of Removing Submitted Assignments ?

by Muhammad Abdul Basit -

Thank you. 

This course is in progress so I cannot reset the course all together. 

But I am wondering whether it will be OK if I use the option of Reset the course and select only deletion of submitted assignments in resetting process. Will it be ok? 

Can anyone confirm? 

In reply to erika alarcon

Re: Effect of Removing Submitted Assignments ?

by Rodel Cariño -


We are encountering disk space issue also and we tried to remove submissions but looks no effect to recover disk space, I think Moodle just removed the file submission link and it did not actually delete the file. I tried to check the Cron execution log if there's scheduled task to delete those assignments that I removed submissions but there's none. Any help please on how to recover disk space from Removed Submissions of Assignments?

In reply to Rodel Cariño

Re: Effect of Removing Submitted Assignments ?

by Muhammad Abdul Basit -

Removing submissions should result in freeing disk space.  Firstly I would suggest to reduce Moodle Recycle Bin time period of retaining deleted items.  Secondly make sure that your cron is running fine after short intervals (preferably after one minute).

In reply to Muhammad Abdul Basit

Re: Effect of Removing Submitted Assignments ?

by Rodel Cariño -
Our recycle bin time was set to 2 days and cron runs every 5 mins. Could that recycle bin/freeing up disk space applies to course or activity level deletion only and not to students submissions? we've already deleted thousands of submissions (images of 1 to 5mb) since 3 weeks but we don't reclaim additional disk space.
In reply to Rodel Cariño

Re: Effect of Removing Submitted Assignments ?

by Ken Task -
Picture of Particularly helpful Moodlers
Don't think recyclebin applies to students ... at all ... just teachers and higher roles.
How did you delete student submissions? Would think that process to be 2 fold ... using the contenthash value in mdl_files and physically the contenthash named file in sea of files in filedir. But going back to the courses, student work kinda messed up?
Not sure there is a solution for what you seek! sad
'SoS', Ken
In reply to Ken Task

Re: Effect of Removing Submitted Assignments ?

by Rodel Cariño -
As admin, in the Calendar, we looked for the activities, once graded, we removed the submissions(Calendar->Activity->View All Submissions->Edit->Remove Submission) - they were pictures taken from their activity books
In reply to Ken Task

Re: Effect of Removing Submitted Assignments ?

by Rodel Cariño -

It makes no sense why Moodle let those removed submissions just left orphaned, it should also be physically deleted once submission was removed. I'll try to study the Moodle ERD if i can do something about it sad sad sad

In reply to Rodel Cariño

Re: Effect of Removing Submitted Assignments ?

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

As far as I am aware, deleting an assignment submission will delete the files associated with it.

You do need to be aware that:

a) files are stored based on their content, not based on their name, so if another user uploaded a file with identical content, then there would only be 1 copy of that file on the disk in the first place (which won't be removed until every reference to it in Moodle is deleted)

b) Deleted files are moved to 'trash' and are not cleaned out until a day or so later.


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

Re: Effect of Removing Submitted Assignments ?

by Muhammad Abdul Basit -
Yes, you are right. Removing assignment submission results in reducing moodledata size and freeing disk space. I recently experienced this when we removed the assignment submissions.
But there is one issue on my site that teachers, as well as admin users, are facing that in some of the assignments when we delete the submission, the error occurs "The submission of 'student_name' cannot be removed." I tried to find a solution to this problem but didn't succeed.

Though I started a separate discussion (https://moodle.org/mod/forum/discuss.php?d=411360) to seek help in this issue but didn't receive any reply so far. Can anyone help me resolve this problem?
Thank you