Moodle
  1. Moodle
  2. MDL-25524

Random Allocation removes previous allocations AFTER creating allocations

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Workshop
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      2822

      Description

      When using Random Allocation when Manual Allocation has already been utilised, the option to remove the existing allocations is useful, but the operations are performed in the wrong order, producing unexpected results.

      Steps to reproduce:

      Given a Workshop with five sample students:
      1. Manually assign each of the students two submissions to assess.
      2. Go into Random Allocation
      3. Give the Number of Reviews as 3 per submission
      4. Check the box to Remove current allocations
      5. Click Save Changes
      6. The log tells all: one allocation was made per submission, and then 10 allocations were deleted. Checking the allocations page, we can see that there is now only one allocation per submission.

      Expected results:

      "Remove current allocations" should delete all allocations BEFORE random allocation begins.

      Actual results:

      After selecting three reviews per submission, we end up with only one review allocated per submission.

        Activity

        Hide
        David Mudrak added a comment -

        Confirmed, this is a bug. Thanks Morgan for spotting this!

        Show
        David Mudrak added a comment - Confirmed, this is a bug. Thanks Morgan for spotting this!
        Hide
        David Mudrak added a comment -

        Fixed in CVS HEAD now.

        There was a bug in the code that tries to reuse the current allocation records. For example, if you repeat the random allocation with fixed number of reviews per submissions and you check 'Remove current allocations', there is a chance that some submission is randomly allocated again to the same reviewer as it already is at the moment. So, instead of removing all allocations and creating them again (which would needlessly waste database records), the allocator tries to reuse the current allocation records and deallocates just those that were not reallocated. But due to a bug, it failed to detect current allocations and therefore is removed all.
        It should work now. Please upgrade your site a retest.

        Thanks for the report Morgan - good catch!

        Show
        David Mudrak added a comment - Fixed in CVS HEAD now. There was a bug in the code that tries to reuse the current allocation records. For example, if you repeat the random allocation with fixed number of reviews per submissions and you check 'Remove current allocations', there is a chance that some submission is randomly allocated again to the same reviewer as it already is at the moment. So, instead of removing all allocations and creating them again (which would needlessly waste database records), the allocator tries to reuse the current allocation records and deallocates just those that were not reallocated. But due to a bug, it failed to detect current allocations and therefore is removed all. It should work now. Please upgrade your site a retest. Thanks for the report Morgan - good catch!

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: