mirror of
https://github.com/moodle/moodle.git
synced 2025-02-15 13:24:56 +01:00
Merge branch 'PULL-226-workshop' of git://github.com/mudrd8mz/moodle
This commit is contained in:
commit
0032523aed
@ -335,42 +335,6 @@ class workshop_manual_allocator implements workshop_allocator {
|
|||||||
public static function delete_instance($workshopid) {
|
public static function delete_instance($workshopid) {
|
||||||
return;
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,6 +10,11 @@
|
|||||||
background-color: #eee;
|
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 {
|
.path-mod-workshop .manual-allocator .allocations .peer .image {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
@ -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
|
* (bool)excludesamegroup - whether to prevent peer submissions from the same group in visible group mode
|
||||||
*
|
*
|
||||||
* @param array $authors structure of grouped authors
|
* @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 $assessments currently assigned assessments to be kept
|
||||||
* @param array $o reference to an array of log messages
|
* @param array $o reference to an array of log messages
|
||||||
* @param array $options allocation options
|
* @param array $options allocation options
|
||||||
|
@ -31,7 +31,7 @@ require_once($CFG->dirroot.'/lib/formslib.php');
|
|||||||
/**
|
/**
|
||||||
* Allocator settings form
|
* 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 <david.mudrak@gmail.com>
|
* @copyright 2009 David Mudrak <david.mudrak@gmail.com>
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
|
Loading…
x
Reference in New Issue
Block a user