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


Public Member Functions | |
| __construct (workshop $workshop) | |
| init () | |
| ui () | |
Static Public Member Functions | |
| static | delete_instance ($workshopid) |
| static | available_numofreviews_list () |
Data Fields | |
| const | MSG_SUCCESS = 1 |
| const | USERTYPE_AUTHOR = 1 |
| const | USERTYPE_REVIEWER = 2 |
Protected Member Functions | |
| self_allocation ($authors=array(), $reviewers=array(), $assessments=array()) | |
| add_new_allocations (array $newallocations, array $dataauthors, array $datareviewers) | |
| index_submissions_by_authors ($submissions) | |
| get_author_ids ($newallocations) | |
| get_unique_allocations ($newallocations) | |
| get_unkept_assessments ($assessments, $newallocations, $keepselfassessments) | |
| random_allocation ($authors, $reviewers, $assessments, &$o, array $options) | |
| convert_assessments_to_links ($assessments) | |
| get_element_with_lowest_workload ($workload) | |
| shuffle_assoc (&$array) | |
| filter_current_assessments (&$newallocations, $assessments) | |
Protected Attributes | |
| $workshop | |
| $mform | |
| __construct | ( | workshop $ | workshop | ) |
| add_new_allocations | ( | array $ | newallocations, |
| array $ | dataauthors, | ||
| array $ | datareviewers | ||
| ) | [protected] |
Creates new assessment records
| array | $newallocations | pairs 'reviewerid' => 'authorid' |
| array | $dataauthors | authors by group, group [0] contains all authors |
| array | $datareviewers | reviewers by group, group [0] contains all reviewers |
Definition at line 318 of file lib.php.


| static available_numofreviews_list | ( | ) | [static] |
| convert_assessments_to_links | ( | $ | assessments | ) | [protected] |
Extracts the information about reviews from the authors' and reviewers' perspectives
| array | $assessments | array of assessments as returned by workshop::get_all_assessments() |
Reimplemented in testable_workshop_random_allocator.
Definition at line 627 of file lib.php.

| static delete_instance | ( | $ | workshopid | ) | [static] |
Delete all data related to a given workshop module instance
This plugin does not store any data.
| int | $workshopid | id of the workshop module instance being deleted |
Implements workshop_allocator.
| filter_current_assessments | ( | &$ | newallocations, |
| $ | assessments | ||
| ) | [protected] |
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 in testable_workshop_random_allocator.
Definition at line 694 of file lib.php.

| get_author_ids | ( | $ | newallocations | ) | [protected] |
Extracts unique list of authors' IDs from the structure of new allocations
| array | $newallocations | of pairs 'reviewerid' => 'authorid' |
Reimplemented in testable_workshop_random_allocator.
Definition at line 366 of file lib.php.

| get_element_with_lowest_workload | ( | $ | workload | ) | [protected] |
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 in testable_workshop_random_allocator.
Definition at line 652 of file lib.php.

| get_unique_allocations | ( | $ | newallocations | ) | [protected] |
Removes duplicate allocations
| mixed | $newallocations | array of 'reviewerid' => 'authorid' pairs |
Reimplemented in testable_workshop_random_allocator.
Definition at line 383 of file lib.php.

| get_unkept_assessments | ( | $ | assessments, |
| $ | newallocations, | ||
| $ | keepselfassessments | ||
| ) | [protected] |
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 in testable_workshop_random_allocator.
Definition at line 400 of file lib.php.

| index_submissions_by_authors | ( | $ | submissions | ) | [protected] |
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 in testable_workshop_random_allocator.
Definition at line 347 of file lib.php.

| init | ( | ) |
Allocate submissions as requested by user
Implements workshop_allocator.
Definition at line 63 of file lib.php.

| random_allocation | ( | $ | authors, |
| $ | reviewers, | ||
| $ | assessments, | ||
| &$ | o, | ||
| array $ | options | ||
| ) | [protected] |
Allocates submission reviews randomly
The algorithm of this function has been described at http://moodle.org/mod/forum/discuss.php?d=128473 Please see the PDF attached to the post before you study the implementation. The goal of the function is to connect each "circle" (circles are representing either authors or reviewers) with a required number of "squares" (the other type than circles are).
The passed $options array must provide keys: (int)numofreviews - number of reviews to be allocated to each circle (int)numper - what user type the circles represent. (bool)excludesamegroup - whether to prevent peer submissions from the same group in visible group mode
| array | $authors | structure of grouped authors |
| array | $reviewers | structure of grouped reviewers |
| array | $assessments | currently assigned assessments to be kept |
| array | $o | reference to an array of log messages |
| array | $options | allocation options |
Definition at line 441 of file lib.php.


| self_allocation | ( | $ | authors = array(), |
| $ | reviewers = array(), |
||
| $ | assessments = array() |
||
| ) | [protected] |
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 in testable_workshop_random_allocator.
Definition at line 285 of file lib.php.

| shuffle_assoc | ( | &$ | array | ) | [protected] |
| ui | ( | ) |
Returns the HTML code to print the user interface
Implements workshop_allocator.
Definition at line 189 of file lib.php.

| const MSG_SUCCESS = 1 |
| const USERTYPE_AUTHOR = 1 |
| const USERTYPE_REVIEWER = 2 |