mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
Merge branch 'master_MDL-45715' of https://github.com/danmarsden/moodle
This commit is contained in:
commit
d4a89aa500
@ -202,7 +202,8 @@ class assign_grading_table extends table_sql implements renderable {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->assignment->get_instance()->markingallocation) {
|
||||
if ($this->assignment->get_instance()->markingworkflow &&
|
||||
$this->assignment->get_instance()->markingallocation) {
|
||||
if (has_capability('mod/assign:manageallocations', $this->assignment->get_context())) {
|
||||
// Check to see if marker filter is set.
|
||||
$markerfilter = (int)get_user_preferences('assign_markerfilter', '');
|
||||
@ -296,7 +297,8 @@ class assign_grading_table extends table_sql implements renderable {
|
||||
$headers[] = get_string('submissionteam', 'assign');
|
||||
}
|
||||
// Allocated marker.
|
||||
if ($this->assignment->get_instance()->markingallocation &&
|
||||
if ($this->assignment->get_instance()->markingworkflow &&
|
||||
$this->assignment->get_instance()->markingallocation &&
|
||||
has_capability('mod/assign:manageallocations', $this->assignment->get_context())) {
|
||||
// Add a column for the allocated marker.
|
||||
$columns[] = 'allocatedmarker';
|
||||
@ -504,7 +506,8 @@ class assign_grading_table extends table_sql implements renderable {
|
||||
$name = 'quickgrade_' . $row->id . '_workflowstate';
|
||||
$o .= html_writer::select($workflowstates, $name, $workflowstate, array('' => $notmarked));
|
||||
// Check if this user is a marker that can't manage allocations and doesn't have the marker column added.
|
||||
if ($this->assignment->get_instance()->markingallocation &&
|
||||
if ($this->assignment->get_instance()->markingworkflow &&
|
||||
$this->assignment->get_instance()->markingallocation &&
|
||||
!has_capability('mod/assign:manageallocations', $this->assignment->get_context())) {
|
||||
|
||||
$name = 'quickgrade_' . $row->id . '_allocatedmarker';
|
||||
|
@ -595,6 +595,9 @@ class assign {
|
||||
}
|
||||
$update->markingworkflow = $formdata->markingworkflow;
|
||||
$update->markingallocation = $formdata->markingallocation;
|
||||
if (empty($update->markingworkflow)) { // If marking workflow is disabled, make sure allocation is disabled.
|
||||
$update->markingallocation = 0;
|
||||
}
|
||||
|
||||
$returnid = $DB->insert_record('assign', $update);
|
||||
$this->instance = $DB->get_record('assign', array('id'=>$returnid), '*', MUST_EXIST);
|
||||
@ -945,6 +948,9 @@ class assign {
|
||||
}
|
||||
$update->markingworkflow = $formdata->markingworkflow;
|
||||
$update->markingallocation = $formdata->markingallocation;
|
||||
if (empty($update->markingworkflow)) { // If marking workflow is disabled, make sure allocation is disabled.
|
||||
$update->markingallocation = 0;
|
||||
}
|
||||
|
||||
$result = $DB->update_record('assign', $update);
|
||||
$this->instance = $DB->get_record('assign', array('id'=>$update->id), '*', MUST_EXIST);
|
||||
@ -3067,7 +3073,8 @@ class assign {
|
||||
$quickgrading = get_user_preferences('assign_quickgrading', false);
|
||||
$showonlyactiveenrolopt = has_capability('moodle/course:viewsuspendedusers', $this->context);
|
||||
|
||||
$markingallocation = $this->get_instance()->markingallocation &&
|
||||
$markingallocation = $this->get_instance()->markingworkflow &&
|
||||
$this->get_instance()->markingallocation &&
|
||||
has_capability('mod/assign:manageallocations', $this->context);
|
||||
// Get markers to use in drop lists.
|
||||
$markingallocationoptions = array();
|
||||
@ -3437,7 +3444,8 @@ class assign {
|
||||
require_once($CFG->dirroot . '/mod/assign/gradingbatchoperationsform.php');
|
||||
require_sesskey();
|
||||
|
||||
$markingallocation = $this->get_instance()->markingallocation &&
|
||||
$markingallocation = $this->get_instance()->markingworkflow &&
|
||||
$this->get_instance()->markingallocation &&
|
||||
has_capability('mod/assign:manageallocations', $this->context);
|
||||
|
||||
$batchformparams = array('cm'=>$this->get_course_module()->id,
|
||||
@ -5136,7 +5144,8 @@ class assign {
|
||||
$current->grade = floatval($current->grade);
|
||||
}
|
||||
$gradechanged = $gradecolpresent && $current->grade !== $modified->grade;
|
||||
$markingallocationchanged = $this->get_instance()->markingallocation &&
|
||||
$markingallocationchanged = $this->get_instance()->markingworkflow &&
|
||||
$this->get_instance()->markingallocation &&
|
||||
($modified->allocatedmarker !== false) &&
|
||||
($current->allocatedmarker != $modified->allocatedmarker);
|
||||
$workflowstatechanged = $this->get_instance()->markingworkflow &&
|
||||
@ -5319,7 +5328,8 @@ class assign {
|
||||
$showonlyactiveenrolopt = false;
|
||||
}
|
||||
|
||||
$markingallocation = $this->get_instance()->markingallocation &&
|
||||
$markingallocation = $this->get_instance()->markingworkflow &&
|
||||
$this->get_instance()->markingallocation &&
|
||||
has_capability('mod/assign:manageallocations', $this->context);
|
||||
// Get markers to use in drop lists.
|
||||
$markingallocationoptions = array();
|
||||
@ -5899,7 +5909,10 @@ class assign {
|
||||
$mform->addHelpButton('workflowstate', 'markingworkflowstate', 'assign');
|
||||
}
|
||||
|
||||
if ($this->get_instance()->markingallocation && has_capability('mod/assign:manageallocations', $this->context)) {
|
||||
if ($this->get_instance()->markingworkflow &&
|
||||
$this->get_instance()->markingallocation &&
|
||||
has_capability('mod/assign:manageallocations', $this->context)) {
|
||||
|
||||
$markers = get_users_by_capability($this->context, 'mod/assign:grade');
|
||||
$markerlist = array('' => get_string('choosemarker', 'assign'));
|
||||
foreach ($markers as $marker) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user