ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Calculates peer review distribution (rater to peer assignments) More...
Public Member Functions | |
__construct (array $user_ids, $num_assignments) | |
ExcPeerReviewDistribution constructor. More... | |
getUserOrder () | |
Get user order. More... | |
getPeersOfRater ($user_id) | |
Get peers of rater. More... | |
Protected Member Functions | |
initDistribution () | |
Init distribution. More... | |
randomUserOrder ($user_ids) | |
Random user order. More... | |
Protected Attributes | |
$user_ids = [] | |
$user_order = [] | |
$num_assignments | |
Calculates peer review distribution (rater to peer assignments)
This is a simple algorithm, that ensures that each rater has $num_assignments peers to review and each peer has $num_assignments raters.
It starts by creating a random order of the users. After that it assignes the next $num_assignments users to a rater with index $i ($i+1 to $i+$numassignments) as peers. (Starting back from 0 if the counter exceeds the number of users)
Note that this will not include all theoretical combinations, but the randomization is good enough and the code much easier to maintain.
u0 u1 u2 u3 u4 (raters) u0 2 1 u1 1 2 u2 2 1 u3 2 1 u4 2 1 (peers)
Example above for 5 users and 2 assignments.
Definition at line 32 of file class.ExcPeerReviewDistribution.php.
ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution::__construct | ( | array | $user_ids, |
$num_assignments | |||
) |
ExcPeerReviewDistribution constructor.
int[] | $user_ids | |
int | $num_assignments |
Definition at line 54 of file class.ExcPeerReviewDistribution.php.
References ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\$num_assignments, and ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\initDistribution().
ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution::getPeersOfRater | ( | $user_id | ) |
Get peers of rater.
int | $user_id |
Definition at line 108 of file class.ExcPeerReviewDistribution.php.
References $key, and ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\$num_assignments.
ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution::getUserOrder | ( | ) |
Get user order.
Definition at line 97 of file class.ExcPeerReviewDistribution.php.
References ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\$user_order.
|
protected |
Init distribution.
Definition at line 71 of file class.ExcPeerReviewDistribution.php.
References ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\randomUserOrder().
Referenced by ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\__construct().
|
protected |
Random user order.
array |
Definition at line 81 of file class.ExcPeerReviewDistribution.php.
References ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\$user_ids.
Referenced by ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\initDistribution().
|
protected |
Definition at line 47 of file class.ExcPeerReviewDistribution.php.
Referenced by ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\__construct(), and ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\getPeersOfRater().
|
protected |
Definition at line 37 of file class.ExcPeerReviewDistribution.php.
Referenced by ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\randomUserOrder().
|
protected |
Definition at line 42 of file class.ExcPeerReviewDistribution.php.
Referenced by ILIAS\Exercise\PeerReview\ExcPeerReviewDistribution\getUserOrder().