Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69570

Reset and delete all submissions doesn't delete the assignfeedback_editpdf files

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_311_STABLE
    • master
    • Hide
      1. Prerequisite: A Moodle site with a document converter enabled and configured.
      2. Create a course.
      3. Add an assignment with default options:
        1. Feedback types: Annotate PDF.
      4. Check the database table "files". Use this query to get the latest files with component 'assignfeedback_editpdf':

       

      SELECT * FROM mdl_files WHERE component='assignfeedback_editpdf' ORDER BY id DESC

       

      This query shows the starting point. It is also possible to count the registers using "count ( *)" instead of showing them all.

      1. As a student, submit an odt, doc or docx file to the assignment.
      2. As a teacher, go to grade the assignment. Do some random annotations and save.
      3. Use the query mentioned in point 4 to verify that in the table "files" have now more records with component "assignfeedback_editpdf" and some of the fileareas "download, combined, partial, importhtml, pages, readonlypages and stamps". All the files that have appeared must be deleted upon reset.
      4. Go to the main page of the course, go to reset, click select default, click reset course and continue to finish.
      5. Check again the table "files". All the records that appeared in point 7 must have disappeared.
      Show
      Prerequisite: A Moodle site with a document converter enabled and configured. Create a course. Add an assignment with default options: Feedback types: Annotate PDF. Check the database table "files". Use this query to get the latest files with component 'assignfeedback_editpdf':   SELECT * FROM mdl_files WHERE component='assignfeedback_editpdf' ORDER BY id DESC   This query shows the starting point. It is also possible to count the registers using "count ( *)" instead of showing them all. As a student, submit an odt, doc or docx file to the assignment. As a teacher, go to grade the assignment. Do some random annotations and save. Use the query mentioned in point 4 to verify that in the table "files" have now more records with component "assignfeedback_editpdf" and some of the fileareas "download, combined, partial, importhtml, pages, readonlypages and stamps". All the files that have appeared must be deleted upon reset. Go to the main page of the course, go to reset, click select default, click reset course and continue to finish. Check again the table "files". All the records that appeared in point 7 must have disappeared.

    Description

      When resetting a course and deleting all submissions of an assignment with PDF annotation enabled, we've realized that the submissions are deleted but the assignfeedback_editpdf files linked to them aren't. That leaves orphaned files on the MoodleData, and they can make storage troubles in the long term.

      I don't know if the approach should be to delete them when deleting the submissions or to create a scheduled task looking for and deleting orphaned assignment feedback files.

      Replication steps:

      1. Create a course, enrol a student and create an assignment for file submission with PDF annotation enabled
      2. As a student, submit a file to the assignment (not a PDF, to force the conversion)
      3. As a teacher, go to the "Grade" page of the student's submission (the submission should be converted to PDF when doing it if it wasn't already converted by the scheduled task)
      4. Reset the course checking "Delete all submissions" on the assignment section
      5. As an admin, make a backup with user data and download it
      6. Change the extension from MBZ to ZIP and browse the content. The PDF version of the submission is correctly deleted, but in the files.xml you should find the file again
      7. The file itself should be inside the files folder. On this example is this: files/83/8351695938a60ce9b524ea2e53f29e168a26cf16
      8. I've seen on the database that on the files table most of these orphaned files have these filearea values : readonlypages, pages and combined.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              izendegi Iñigo Zendegi
              Ferran Recio Ferran Recio
              Víctor Déniz Falcón Víctor Déniz Falcón
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
              Votes:
              48 Vote for this issue
              Watchers:
              45 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 30 minutes
                  3h 30m