Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Manual pre-allocation feature (Part 1) #2

Draft
wants to merge 18 commits into
base: feature/restrict-choices-group
Choose a base branch
from

Conversation

DrCuriosity
Copy link
Owner

Given further database field changes, this builds on my previous PRs.

This feature relates to issue learnweb#208. This is quite a large chunk of work all at once, for which I unreservedly apologise.

The feature accounts for situations where particular users in the course need to be pre-assigned to specific choices before the rating process has occurred. This could for example account for students:

  • who have skills or backgrounds that make their participation necessary in e.g. a specific research project
  • who have particular access or support needs that make specific choices a necessity rather than a preference
  • whose participation is tied to a specific fellowship, industry partnership or other funding source

This pull request is "Part 1" of a larger change, providing a manual pre-allocation interface so that administrators can:

  • Pre-allocate users to a choice
  • Specify a reason that they have been pre-allocated before the rating process.

Part 2 will add further features, including settings at a plugin and course module level to specify a default set of
reasons to select from, and better visibility for pre-allocation data in the allocations reports.

Summary of Significant Changes

AMD Javascript and templates:

  • form-user-selector: adapted from the user lookup in mod_forum, calling mod_ratingallocate_search_users instead

DB:

  • ratingallocate_allocations: new fields: "manual", "reason", "allocatorid"
  • Added mod_ratingallocate_search_users service for user lookups

Classes:

  • external/search_users: webservice for looking up users not pre-allocated to the current choice

Forms:

  • New preallocate_form: Adds user preallocations for a ratingallocation choice. The pre-allocating administrator and a text reason are recorded. (Future work will support choosing from one or more default reasons as well.)

Lang strings:

  • For the preallocate_form above, and integrating it into other actions

Locallib:

  • New actions: preallocate_choice and preallocate_remove
  • Refactoring add_allocation, clear_all_allocations to support manual pre-allocations
  • Filter choices shown if they are already full due to pre-allocation (filter_choices_by_full_preallocations)
  • Users with pre-allocated choice are given not offer to rate other choices (in process_default)
  • Other helper functions:
    • get_manual_preallocations
    • get_preallocated_userids
    • get_preallocation_counts
    • filter_choices_by_full_preallocations

Renderer:

  • Icon link to preallocation form from choice editing (in render_tools)
  • Show preallocated users for choice with ratingallocate_preallocations_table
  • Option given to remove user preallocations from the above table, with confirmation dialog

Strategy/solver:

  • In strategies, additionally filter out choices that full due to preallocations (template_options plus 04-06)
  • Modify solver-template to:
    • Preserve existing pre-allocations
    • Adjust maxsize values down to account for pre-allocated users
    • Filter out full choices
    • Filter out ratings for full choices, and ratings be pre-allocated users if any

Tests:

  • mod_ratingallocate_manual_preallocation_test: Tests around manual preallocation, especially the parts nearest the solver.

…on; test_fill_choices() to test distribute_user() allocations in this case.
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.

1 participant