mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-10211 Show/hide and lock/unlock of final grades
This commit is contained in:
parent
aae28dd55d
commit
a9d5bde75d
@ -48,7 +48,7 @@ $perpage = optional_param('perpage', 3, PARAM_INT); // number of users on
|
||||
$action = optional_param('action', 0, PARAM_ALPHA);
|
||||
$move = optional_param('move', 0, PARAM_INT);
|
||||
$type = optional_param('type', 0, PARAM_ALPHA);
|
||||
$target = optional_param('target', 0, PARAM_INT);
|
||||
$target = optional_param('target', 0, PARAM_ALPHANUM);
|
||||
|
||||
// Grab the grade_tree for this course
|
||||
$gtree = new grade_tree($courseid, false);
|
||||
@ -95,7 +95,17 @@ if ($sortitemid) {
|
||||
|
||||
// Perform actions on categories, items and grades
|
||||
if (!empty($target) && !empty($action) && confirm_sesskey()) {
|
||||
$element = $gtree->locate_element($target);
|
||||
|
||||
// If targetting a grade, create a pseudo-element
|
||||
if (preg_match('/^grade([0-9]*)/', $target, $matches)) {
|
||||
$grade_grades_id = $matches[1];
|
||||
$element = new stdClass();
|
||||
$grade_grades = new grade_grades(array('id' => $grade_grades_id));
|
||||
$element->element = array('object' => $grade_grades);
|
||||
} else {
|
||||
$element = $gtree->locate_element($target);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'edit':
|
||||
break;
|
||||
|
@ -721,7 +721,7 @@ function grade_get_icons($object, $tree) {
|
||||
if (get_class($object) != 'grade_grades') {
|
||||
$identifier = $object->get_sortorder();
|
||||
} else {
|
||||
$identifier = 'grade_grades_' . $object->id;
|
||||
$identifier = 'grade' . $object->id;
|
||||
}
|
||||
|
||||
$html .= '<a href="report.php?report=grader&target=' . $identifier
|
||||
|
Loading…
x
Reference in New Issue
Block a user