learnweb / moodle-mod_ratingallocate

:pray: "Fair allocation" moodle activity
https://moodle.org/plugins/view/mod_ratingallocate
20 stars 29 forks source link

Distribution of unallocated users as background process #263

Closed PhMemmel closed 1 year ago

PhMemmel commented 1 year ago

Currently, the distribution of unallocated users will be done directly in the same request that the user triggers by hitting the button. Sometimes, with many students to allocate and group restrictions active this can take some moments. To avoid that the user runs into a timeout or considers the request to be failed it would be safer to let the calculation being done in the background by a separate process.

  1. option: Clicking the button will add the distribution task to be picked up by the same scheduled task currently responsible for the normal distribution algorithm.
  2. option: As far as I understand the only purpose of using a scheduled task instead of an ad hoc task is that it is possible to make the algorithm run after the voting phase has ended so the trainer does not have to trigger it manually. The distribution of unallocated users does not have that. So it maybe would be sufficient to just use a simple ad-hoc task for that.
  3. option: Unify both options and refactor the current scheduled task to just be a simple ad-hoc task. However that means (from my understanding) that the trainer will have to trigger the algorithm manually which would be fine for me, because most of my users do not really understand that the distribution happens automatically anyway :-)

BTW: Should it be made configurable that the algorithm is being run in the background or should this just be forced?

Any feedback welcome!

NinaHerrmann commented 1 year ago

As I suppose allocating the "left-over" students does not take to much time I would prefer an ad-hoc task. (Additionally, benefiting the teacher to have faster results :) ) I like you presented multiple solutions, but I would not change the scheduled task for the main allocation algorithm, as by adding more algorithms it might eat up a lot of time... Also I really like that you can change the schedule of those task ;)

From my point of view force it ;)

Thank you so much for your contribution!