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

[Request]: Automated export of quizzes #35

Open melanietreitinger opened 1 month ago

melanietreitinger commented 1 month ago

Description

Currently the plugin only generates PDFs when someone presses a button.

It could be useful to have a feature which allows automated exports of quizzes.

There could be a scheduled task which runs hourly(?) and checks for quizzes which have expired and then does the export.

Additional resources and references

No response

ngandrass commented 1 month ago

Automated export / archiving is a request I noticed in the past so I'm glad that you wrote it down here :+1:

There are a few cases we need to consider with this:

  1. When should the automatic archiving happen?
    • Once per quiz after it is closed?
    • Every night when new attempts were made that have not yet been exported?
    • What happens if an old quiz is re-opened after some time?
  2. What should be archived during automated archiving?
    • Only the new attempts or always all attempts as a whole?
    • Currently, the plugin does not support partial exports in a way that is easy to use and understand for the user. The worker service does support exporting only a subset of the attempts but every batch. It is simply not exposed within the frontend yet. However, each export would currently result in a separate archive job, each with its own archive. Therefore, there currently is no way for the user to tell which attempts are contained within which quiz archive nor search for jobs containing specific attempts.
  3. How is a quiz marked for automated archiving?
    • Should there be a global setting that causes all quizzes to be archived automatically?
    • Should there be a course category based selection?
    • Should individual quizzes be marked for automated archiving?
  4. If automated archiving can happen more than once (e.g., when new attempts were made since the last archiving): What should happen to the old data? Should it be deleted automatically?
  5. Do we need different presets for automated archiving than for manual archive job creation?

That are just some of the questions that came to my mind regarding this topic. I'd be happy to learn more about your (and hopefully also others) requirements for this feature.

Kind regards Niels

melanietreitinger commented 1 month ago

"When should the automatic archiving happen?" The first two scenarios could both be options which can be selected by admins. When an old quiz is re-opened it should be treated as any new quiz and all attempts present at the new end of the quiz should be exported.

"What should be archived during automated archiving?" That depends on the settings above:

💡 Since your plugin is not designed for individual exports of attempts, it would be fine to me if we only have the scenario "Once per quiz after it is closed: all attempts as a whole"!

"Should there be a global setting that causes all quizzes to be archived automatically?" -> yes

"Should there be a course category based selection?" -> not important for us, but might be a request from others

"Should individual quizzes be marked for automated archiving?" -> no, not necessary for teachers to configure this

"If automated archiving can happen more than once..." -> no problem if we only export once after the quiz is closed, isn't it?

"Do we need different presets for automated archiving than for manual archive job creation?" -> this might be useful

ngandrass commented 1 month ago

Thanks for your response!

To me it sounds like for now the following behavior could be a viable first version of this feature:

--

[1]: I'd create a Moodle task for it which is run by cron and therefore is configurable according to the needs of Moodle administrators [2]: Failures can happen if, for example, the server is rebooted during archive generation

melanietreitinger commented 1 month ago

Sounds great! 👍