Skip to content

WR-483012 Add cleaner_question_attempts subplugin#225

Open
agaranin wants to merge 2 commits intocatalyst:MOODLE_500_STABLEfrom
agaranin:MOODLE_500_STABLE_wr483012_1
Open

WR-483012 Add cleaner_question_attempts subplugin#225
agaranin wants to merge 2 commits intocatalyst:MOODLE_500_STABLEfrom
agaranin:MOODLE_500_STABLE_wr483012_1

Conversation

@agaranin
Copy link
Copy Markdown

@agaranin agaranin commented Mar 9, 2026

Summary

  • New datacleaner subplugin that deletes old question attempt data (question_usages, question_attempts, question_attempt_steps,
    question_attempt_step_data) based on a configurable age threshold (default: 30 days)
  • Uses Moodle's question_engine::delete_questions_usage_by_activities() API for safe cascade deletion with chunked processing (10K usages per
    batch)
  • Fast path: when minimum age is 0, truncates all 4 tables directly and cleans only response file metadata (preserves question definition files)
  • Sortorder 9 (pre-wash zone, runs before courses cleaner)

Closes #227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cleaner_question_attempts subplugin to delete old question attempt data

2 participants