From 51abc39695fc68e8b5a4688223106376ff47cf24 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Fri, 4 Feb 2011 14:33:48 +0100 Subject: [PATCH 1/3] MDL-26188 Workshop: get rid of a method that is not used anyway The protected method get_allocations_recordset() is a relict from earlier development phases of Workshop module. Removing it as it confuses recent Eloy's recordset usage detection tool. --- mod/workshop/allocation/manual/lib.php | 36 -------------------------- 1 file changed, 36 deletions(-) diff --git a/mod/workshop/allocation/manual/lib.php b/mod/workshop/allocation/manual/lib.php index 7fa6378e6c9..fb623a210f6 100644 --- a/mod/workshop/allocation/manual/lib.php +++ b/mod/workshop/allocation/manual/lib.php @@ -335,42 +335,6 @@ class workshop_manual_allocator implements workshop_allocator { public static function delete_instance($workshopid) { return; } - - /** - * Returns the list of all allocations where the given users are involved - * - * We must use recordset here because we do not have any unique identifier available - * - * @param array [userid] => whatever - * @return moodle_recordset|null - */ - protected function get_allocations_recordset(array $users) { - global $DB, $PAGE; - - if (empty($users)) { - return null; - } - - list($authorids, $authorparams) = $DB->get_in_or_equal(array_keys($users), SQL_PARAMS_NAMED, 'a0000'); - list($reviewerids, $reviewerparams) = $DB->get_in_or_equal(array_keys($users), SQL_PARAMS_NAMED, 'r0000'); - $params = array_merge($authorparams, $reviewerparams); - $params['workshopid'] = $this->workshop->id; - - $sql = "SELECT author.id AS authorid, author.firstname AS authorfirstname, author.lastname AS authorlastname, - author.picture AS authorpicture, author.imagealt AS authorimagealt, author.email AS authoremail, - s.id AS submissionid, s.title AS submissiontitle, s.grade AS submissiongrade, - a.id AS assessmentid, a.timecreated AS timeallocated, a.reviewerid, - reviewer.firstname AS reviewerfirstname, reviewer.lastname AS reviewerlastname, - reviewer.picture as reviewerpicture, reviewer.imagealt AS reviewerimagealt - FROM {user} author - LEFT JOIN {workshop_submissions} s ON (s.authorid = author.id) - LEFT JOIN {workshop_assessments} a ON (s.id = a.submissionid) - LEFT JOIN {user} reviewer ON (a.reviewerid = reviewer.id) - WHERE (author.id $authorids OR reviewer.id $reviewerids) AND (s.id IS NULL OR s.workshopid = :workshopid) - ORDER BY author.lastname,author.firstname,author.id,reviewer.lastname,reviewer.firstname,reviewer.id"; - - return $DB->get_recordset_sql($sql, $params); - } } /** From d239b952a538be653d42ba59bf222a096cc8a6fb Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Fri, 4 Feb 2011 14:37:09 +0100 Subject: [PATCH 2/3] MDL-26296 Workshop: trivial change in manual allocator CSS When only two rows of the allocations table are displayed with the new allocation highlighted, it is better not highlight the odd row. --- mod/workshop/allocation/manual/styles.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/workshop/allocation/manual/styles.css b/mod/workshop/allocation/manual/styles.css index 0582feb562a..39141869607 100644 --- a/mod/workshop/allocation/manual/styles.css +++ b/mod/workshop/allocation/manual/styles.css @@ -10,6 +10,11 @@ background-color: #eee; } +.path-mod-workshop .manual-allocator .allocations .r0.highlightreviewerof, +.path-mod-workshop .manual-allocator .allocations .r0.highlightreviewedby { + background-color: inherit; +} + .path-mod-workshop .manual-allocator .allocations .peer .image { margin-right: 5px; vertical-align: middle; From 32ea207a4878dba3e10874cab72651c8510b5f62 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Tue, 18 Jan 2011 13:11:02 +0100 Subject: [PATCH 3/3] MDL-26298 Workshop: fixed trivial typos in phpDoc blocks --- mod/workshop/allocation/random/lib.php | 2 +- mod/workshop/allocation/random/settings_form.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/workshop/allocation/random/lib.php b/mod/workshop/allocation/random/lib.php index 13a41859063..12f6dd3c94b 100644 --- a/mod/workshop/allocation/random/lib.php +++ b/mod/workshop/allocation/random/lib.php @@ -409,7 +409,7 @@ class workshop_random_allocator implements workshop_allocator { * (bool)excludesamegroup - whether to prevent peer submissions from the same group in visible group mode * * @param array $authors structure of grouped authors - * @param resource $reviewers structure of grouped reviewers + * @param array $reviewers structure of grouped reviewers * @param array $assessments currently assigned assessments to be kept * @param array $o reference to an array of log messages * @param array $options allocation options diff --git a/mod/workshop/allocation/random/settings_form.php b/mod/workshop/allocation/random/settings_form.php index 3762e418089..b4620354f42 100644 --- a/mod/workshop/allocation/random/settings_form.php +++ b/mod/workshop/allocation/random/settings_form.php @@ -31,7 +31,7 @@ require_once($CFG->dirroot.'/lib/formslib.php'); /** * Allocator settings form * - * This is used by {@see workshop_random_allocator::ui()} to set up allocation paramters. + * This is used by {@see workshop_random_allocator::ui()} to set up allocation parameters. * * @copyright 2009 David Mudrak * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later