|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| self_allocation ($authors=array(), $reviewers=array(), $assessments=array()) | |
| get_author_ids ($newallocations) | |
| index_submissions_by_authors ($submissions) | |
| get_unique_allocations ($newallocations) | |
| get_unkept_assessments ($assessments, $newallocations, $keepselfassessments) | |
| convert_assessments_to_links ($assessments) | |
| get_element_with_lowest_workload ($workload) | |
| filter_current_assessments (&$newallocations, $assessments) | |
Make protected methods we want to test public
Definition at line 36 of file testallocator.php.
| convert_assessments_to_links | ( | $ | assessments | ) |
Extracts the information about reviews from the authors' and reviewers' perspectives
| array | $assessments | array of assessments as returned by workshop::get_all_assessments() |
Reimplemented from workshop_random_allocator.
Definition at line 52 of file testallocator.php.
| filter_current_assessments | ( | &$ | newallocations, |
| $ | assessments | ||
| ) |
Filter new allocations so that they do not contain an already existing assessment
| mixed | $newallocations | array of ('reviewerid' => 'authorid') tuples |
| array | $assessments | array of assessment records |
Reimplemented from workshop_random_allocator.
Definition at line 58 of file testallocator.php.
| get_author_ids | ( | $ | newallocations | ) |
Extracts unique list of authors' IDs from the structure of new allocations
| array | $newallocations | of pairs 'reviewerid' => 'authorid' |
Reimplemented from workshop_random_allocator.
Definition at line 40 of file testallocator.php.
| get_element_with_lowest_workload | ( | $ | workload | ) |
Selects an element with the lowest workload
If there are more elements with the same workload, choose one of them randomly. This may be used to select a group or user.
| array | $workload | [groupid] => (int)workload |
Reimplemented from workshop_random_allocator.
Definition at line 55 of file testallocator.php.
| get_unique_allocations | ( | $ | newallocations | ) |
Removes duplicate allocations
| mixed | $newallocations | array of 'reviewerid' => 'authorid' pairs |
Reimplemented from workshop_random_allocator.
Definition at line 46 of file testallocator.php.
| get_unkept_assessments | ( | $ | assessments, |
| $ | newallocations, | ||
| $ | keepselfassessments | ||
| ) |
Returns the list of assessments to remove
If user selects "removecurrentallocations", we should remove all current assessment records and insert new ones. But this would needlessly waste table ids. Instead, let us find only those assessments that have not been re-allocated in this run of allocation. So, the once-allocated submissions are kept with their original id.
| array | $assessments | list of current assessments |
| mixed | $newallocations | array of 'reviewerid' => 'authorid' pairs |
| bool | $keepselfassessments | do not remove already allocated self assessments |
Reimplemented from workshop_random_allocator.
Definition at line 49 of file testallocator.php.
| index_submissions_by_authors | ( | $ | submissions | ) |
Flips the structure of submission so it is indexed by authorid attribute
It is the caller's responsibility to make sure the submissions are not teacher examples so no user is the author of more submissions.
| string | $submissions | array indexed by submission id |
Reimplemented from workshop_random_allocator.
Definition at line 43 of file testallocator.php.
| self_allocation | ( | $ | authors = array(), |
| $ | reviewers = array(), |
||
| $ | assessments = array() |
||
| ) |
Allocates submissions to their authors for review
If the submission has already been allocated, it is skipped. If the author is not found among reviewers, the submission is not assigned.
| array | $authors | grouped of { |
| array | $reviewers | grouped by { |
| array | $assessments | as returned by { |
Reimplemented from workshop_random_allocator.
Definition at line 37 of file testallocator.php.