ngandrass / moodle-quiz_archiver

Archives quiz attempts as PDF and HTML files for long-term storage independent of Moodle
GNU General Public License v3.0
5 stars 3 forks source link

job_preset_archive_retention_time doesn't seem to work #8

Closed martinoesterreicher closed 6 months ago

martinoesterreicher commented 6 months ago

The task \quiz_archiver\task\autodelete_job_artifacts is running every hour. Setting "job_preset_archive_retention_time" is set to 1 day and is locked.

A teacher could set a different time, although its locked in the settings. I created an archive on friday and its still here after the weekend and wasnt being autodeleted.

Am I doing something wrong?

ngandrass commented 6 months ago

Thanks for reporting!

A teacher could set a different time, although its locked in the settings.

The unlockable retention time preset is fixed with commit f678200d8e231f041d3076fdd25dd5be20727c8b, which will be part of the next release :tada:

I created an archive on friday and its still here after the weekend and wasnt being autodeleted.

I could not reproduce problem that artifacts are not being deleted even though the cronjob/task is executed. Just to make sure: You have created an quiz archive with a retention time set to 1 day, not changing the value in the job creation form and the artifact file was not deleted properly after 1 day?

Please open the details modal for the affected job an check the Deletion property: image

image

Thanks!

ngandrass commented 6 months ago

Quick addition since it is not directly obvious:

Only the archived user data (attempt PDFs, attachments, ...) is deleted, while the job metadata is kept until manually deleted. This procedure allows to document the deletion of archive data in a traceable manner, while the privacy relevant user data is deleted.

Jobs with deleted archives show as:

image

martinoesterreicher commented 6 months ago

The unlockable retention time preset is fixed with commit https://github.com/ngandrass/moodle-quiz_archiver/commit/f678200d8e231f041d3076fdd25dd5be20727c8b, which will be part of the next release 🎉

awesome

And thanks for clarifying. Automatic deletion should be enabled for the archive job I created. But when I check its telling me that Deletion is disabled. Quiz Archiver settings look like: quiz archiver settings

while the settings for the archive job looks like: settings for archive job

and the archive information looks like: archive information

I will wait for the new update and test again. :)

ngandrass commented 6 months ago

Thanks for your quick reply!

I will wait for the new update and test again. :)

And I was thinking to wait with the release so that it could include fixes for the lock-error as well as the archives not being deleted ;)

Automatic deletion should be enabled for the archive job I created. But when I check its telling me that Deletion is disabled.

Your settings look fine to me. But, I got an idea ... let me check something quickly.

ngandrass commented 6 months ago

Found it! Turns out that the Moodle Forms API behaves a little unexpected when using the disabled properties. I could quickly patch it for this one field, but would like to create a proper fix for this whole type of problems to prevent future issues.

Long story short: There should be a new release that addresses all these issues today. I'll let you know here once it's out :)

martinoesterreicher commented 6 months ago

Awesome thanks. :)

ngandrass commented 6 months ago

Version 1.2.2 just released, incorporating the fixes :tada:

GitHub: https://github.com/ngandrass/moodle-quiz_archiver/releases/tag/v1.2.2 Moodle Plugin Directory: https://moodle.org/plugins/quiz_archiver/1.2.2/30827

I'll close this issue for now but feel free to re-open it, if you encounter further problems with archive deletion.


P.S.: You can set a short duration for archive deletion while also overriding the cronjob / task schedule within the Moodle Admin UI. This allows you to test archive deletion a lot faster ;)