This PR follows #964 and proposes a first implementation of grouped actions on tasks in TOC-based dispensers. This had become a must-have in order to separate course from task sets and move the course data in database only, making the task dispenser settings not modifiable from the files.
This implementation is HTML/JS based only, quite heavy and probably not the cleanest possible (it produces a lot of js code). However, I think it's worth to evaluate the user experience first before refactoring and making this definitive.
The implementation is based on the following requirements:
Each task has multiple settings (quite a lot, actually)
Each action will act on one setting only, otherwise this is not really useful, all selected tasks would have the same set of settings.
The current setting values should be quickly available, as there is no need for grouped actions if we must click on each task to know what the setting is.
That is, it should be a way to perform all the actions without even opening the task specific modal.
and resolves this by:
Adding a quick setting preview in the task list, using a filter (one setting at a time is shown)
Refreshing the quick preview each time a field is updated in the task edit modal. This is the dirtiest part of the code right now.
Allowing to select sections/tasks
Adding a grouped setting modal that show only the edit field selected in the filter. That is, if filtered on accessibility, only the accessibility can be changed in the modal.
Refreshing the tasks specific input fields each time the grouped action fields are changed, and trigger the change event of each of these fields, so that point 2 will also work when settings are edited through grouped actions.
Allowing to move and remove a bunch of tasks
Allowing to set the task settings for new tasks, because this is now independent.
Enabling, by default, a compact view of the task list, in order to apply the filters and save the changes more easily while navigating through a long list of tasks.
This whole UI, while still not being the optimal solution, is slowly becoming an implementation nightmare. It's probably the first signs that jQuery is not sufficient anymore as a Javascript frontend framework.
Another issue: this implementation is still not smartphone friendly. However, the main issue is the drag and drop that prevents appropriate usage of the rest of the UI. I think that either toggling on and off the drag and drop, or completely removing it, might be a first solution. But this would be for a future PR...
This PR follows #964 and proposes a first implementation of grouped actions on tasks in TOC-based dispensers. This had become a must-have in order to separate course from task sets and move the course data in database only, making the task dispenser settings not modifiable from the files.
This implementation is HTML/JS based only, quite heavy and probably not the cleanest possible (it produces a lot of js code). However, I think it's worth to evaluate the user experience first before refactoring and making this definitive.
The implementation is based on the following requirements:
and resolves this by:
This whole UI, while still not being the optimal solution, is slowly becoming an implementation nightmare. It's probably the first signs that jQuery is not sufficient anymore as a Javascript frontend framework.
Another issue: this implementation is still not smartphone friendly. However, the main issue is the drag and drop that prevents appropriate usage of the rest of the UI. I think that either toggling on and off the drag and drop, or completely removing it, might be a first solution. But this would be for a future PR...