Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 39 and 400]

Unit tests for Random allocation

Copyright: 2009 David Mudrak <david.mudrak@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 334 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes


Class: allocator_test  - X-Ref

Unit tests for Random allocation

setUp()   X-Ref
No description

tearDown()   X-Ref
No description

test_self_allocation_empty_values()   X-Ref
No description

test_self_allocation_equal_user_groups()   X-Ref
No description

test_self_allocation_different_user_groups()   X-Ref
No description

test_self_allocation_skip_existing()   X-Ref
No description

test_get_author_ids()   X-Ref
No description

test_index_submissions_by_authors()   X-Ref
No description

test_index_submissions_by_authors_duplicate_author()   X-Ref
No description

test_get_unique_allocations()   X-Ref
No description

test_get_unkept_assessments_no_keep_selfassessments()   X-Ref
No description

test_get_unkept_assessments_keep_selfassessments()   X-Ref
No description

test_convert_assessments_to_links()   X-Ref
Aggregates assessment info per author and per reviewer


test_convert_assessments_to_links_empty()   X-Ref
Trivial case


test_get_element_with_lowest_workload_deterministic()   X-Ref
If there is a single element with the lowest workload, it should be chosen


test_get_element_with_lowest_workload_impossible()   X-Ref
If there are no elements available, must return false


test_get_element_with_lowest_workload_random()   X-Ref
If there are several elements with the lowest workload, one of them should be chosen randomly


test_get_element_with_lowest_workload_random_floats()   X-Ref
Floats should be rounded before they are compared

This should test

test_filter_current_assessments()   X-Ref
Filter new assessments so they do not contain existing