From 069de416af63f1e8747e7490ea2ca1f7c2e3b41c Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Wed, 22 Jun 2011 17:40:40 +0200 Subject: [PATCH 1/2] MDL-27196 workshop - hardcoded string in the number of errors strategy form --- mod/workshop/form/numerrors/assessment_form.php | 2 +- mod/workshop/lang/en/workshop.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/workshop/form/numerrors/assessment_form.php b/mod/workshop/form/numerrors/assessment_form.php index 37238e584c0..37babb8a4d9 100644 --- a/mod/workshop/form/numerrors/assessment_form.php +++ b/mod/workshop/form/numerrors/assessment_form.php @@ -71,7 +71,7 @@ class workshop_numerrors_assessment_form extends workshop_assessment_form { // evaluation of the assertion $label = get_string('dimensiongrade', 'workshopform_numerrors'); - $mform->addElement('radio', 'grade__idx_' . $i, 'Your assessment', $fields->{'grade0__idx_'.$i}, 0); // todo localize + $mform->addElement('radio', 'grade__idx_' . $i, get_string('yourassessment', 'workshop'), $fields->{'grade0__idx_'.$i}, 0); $mform->addElement('radio', 'grade__idx_' . $i, '', $fields->{'grade1__idx_'.$i}, 1); $mform->setDefault('grade__idx_' . $i, 0); diff --git a/mod/workshop/lang/en/workshop.php b/mod/workshop/lang/en/workshop.php index bb280fee084..9031486bd7a 100644 --- a/mod/workshop/lang/en/workshop.php +++ b/mod/workshop/lang/en/workshop.php @@ -266,4 +266,5 @@ $string['workshop:viewauthornames'] = 'View author names'; $string['workshop:viewauthorpublished'] = 'View authors of published submissions'; $string['workshop:viewpublishedsubmissions'] = 'View published submissions'; $string['workshop:viewreviewernames'] = 'View reviewer names'; +$string['yourassessment'] = 'Your assessment'; $string['yoursubmission'] = 'Your submission'; From e4394d00c4129123438edb77fe48c57186e3d469 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Wed, 22 Jun 2011 17:58:48 +0200 Subject: [PATCH 2/2] MDL-27196 workshop - hardcoded strings in the random allocator --- .../random/lang/en/workshopallocation_random.php | 5 +++++ mod/workshop/allocation/random/lib.php | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mod/workshop/allocation/random/lang/en/workshopallocation_random.php b/mod/workshop/allocation/random/lang/en/workshopallocation_random.php index 6a541defdcc..d6f3e395432 100644 --- a/mod/workshop/allocation/random/lang/en/workshopallocation_random.php +++ b/mod/workshop/allocation/random/lang/en/workshopallocation_random.php @@ -44,5 +44,10 @@ $string['numperauthor'] = 'per submission'; $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'; diff --git a/mod/workshop/allocation/random/lib.php b/mod/workshop/allocation/random/lib.php index 12f6dd3c94b..21b5d02602a 100644 --- a/mod/workshop/allocation/random/lib.php +++ b/mod/workshop/allocation/random/lib.php @@ -426,14 +426,14 @@ class workshop_random_allocator implements workshop_allocator { 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 @@ class workshop_random_allocator implements workshop_allocator { 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 @@ class workshop_random_allocator implements workshop_allocator { } 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;