Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-27196 workshop - hardcoded strings in the random allocator

  • Loading branch information...
commit 39af096daf42f94081c8007ac0434ba6f1dbf240 1 parent 0ff186d
@mudrd8mz mudrd8mz authored
View
5 mod/workshop/allocation/random/lang/en/workshopallocation_random.php
@@ -44,5 +44,10 @@
$string['numperreviewer'] = 'per reviewer';
$string['pluginname'] = 'Random allocation';
$string['randomallocationdone'] = 'Random allocation done';
+$string['resultnomorepeers'] = 'No more peers available';
+$string['resultnomorepeersingroup'] = 'No more peers available in this separate group';
+$string['resultnotenoughpeers'] = 'Not enough peers available';
+$string['resultnumperauthor'] = 'Trying to allocate {$a} review(s) per author';
+$string['resultnumperreviewer'] = 'Trying to allocate {$a} review(s) per reviewer';
$string['removecurrentallocations'] = 'Remove current allocations';
$string['stats'] = 'Current allocation statistics';
View
10 mod/workshop/allocation/random/lib.php
@@ -426,14 +426,14 @@ protected function random_allocation($authors, $reviewers, $assessments, &$o, ar
if (self::USERTYPE_AUTHOR == $numper) {
// circles are authors, squares are reviewers
- $o[] = 'info::Trying to allocate ' . $numofreviews . ' review(s) per author'; // todo translate
+ $o[] = 'info::'.get_string('resultnumperauthor', 'workshopallocation_random', $numofreviews);
$allcircles = $authors;
$allsquares = $reviewers;
// get current workload
list($circlelinks, $squarelinks) = $this->convert_assessments_to_links($assessments);
} elseif (self::USERTYPE_REVIEWER == $numper) {
// circles are reviewers, squares are authors
- $o[] = 'info::trying to allocate ' . $numofreviews . ' review(s) per reviewer'; // todo translate
+ $o[] = 'info::'.get_string('resultnumperreviewer', 'workshopallocation_random', $numofreviews);
$allcircles = $reviewers;
$allsquares = $authors;
// get current workload
@@ -513,14 +513,14 @@ protected function random_allocation($authors, $reviewers, $assessments, &$o, ar
if (NOGROUPS == $gmode) {
if (in_array(0, $failedgroups)) {
$keeptrying = false;
- $o[] = 'error::indent::No more peers available'; // todo translate
+ $o[] = 'error::indent::'.get_string('resultnomorepeers', 'workshopallocation_random');
break;
}
$targetgroup = 0;
} elseif (SEPARATEGROUPS == $gmode) {
if (in_array($circlegroupid, $failedgroups)) {
$keeptrying = false;
- $o[] = 'error::indent::No more peers available in this separate group'; // todo translate
+ $o[] = 'error::indent::'.get_string('resultnomorepeersingroup', 'workshopallocation_random');
break;
}
$targetgroup = $circlegroupid;
@@ -541,7 +541,7 @@ protected function random_allocation($authors, $reviewers, $assessments, &$o, ar
}
if ($targetgroup === false) {
$keeptrying = false;
- $o[] = 'error::indent::Not enough peers available'; // todo translate
+ $o[] = 'error::indent::'.get_string('resultnotenoughpeers', 'workshopallocation_random');
break;
}
$o[] = 'debug::indent::next square should be from group id ' . $targetgroup;
Please sign in to comment.
Something went wrong with that request. Please try again.