插件本地插件稳定版

Old quiz and question attempts deletion

local_deleteoldquizattemptsВадим Дворовенко

  • Moodle 1.9–5.1
  • 更新 2025-02-16

Deletes old quiz and question attempts by scheduler task or by CLI command.
Installation
Copy the deleteoldquizattempts folder into your Moodle /local directory and visit your Admin Notification page to  complete the installation.
Usage
Navigate to plugin settings and specify maximum lifetime of quiz attempts. Older attempts will be automatically deleted with scheduler task.
You can also specify to delete unused hidden questions. Hidden questions are questions, that were logically deleted, but were not deleted physically, because they were referenced in some quiz attempts. After quiz attempts deletion, such questions are
probably no longer required.
You can also delete quiz attempts and unused hidden questions with command line job.
Deleting quiz attempts with CLI
Dispay help.
sudo -u www-data /usr/bin/php local/deleteoldquizattempts/cli/delete_attempts.php –help
Delete attempts that are older than 90 days and shows progress.
sudo -u www-data /usr/bin/php local/deleteoldquizattempts/cli/delete_attempts.php –days=90 –verbose
Delete attempts that are created before specified timestamp.
sudo -u www-data /usr/bin/php local/deleteoldquizattempts/cli/delete_attempts.php –timestamp=1514764800 –timelimit=300
Delete attempts that are created before 2018-01-01 00:00:00 (UTC).
sudo -u www-data /usr/bin/php local/deleteoldquizattempts/cli/delete_attempts.php –date=”2018-01-01 00:00:00″
Delete attempts for specified quiz (check id in *_quiz table).
sudo -u www-data /usr/bin/php local/deleteoldquizattempts/cli/delete_attempts.php –days=90 –quizid=99
Delete attempts for all quizzes in specified course.

返回插件目录