mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Assignment MDL-22611 added has_capability check to grade number that may link to gradebook.
This commit is contained in:
parent
ffba884984
commit
753c1de5ca
1 changed files with 8 additions and 3 deletions
|
@ -2141,9 +2141,14 @@ class mod_assignment_online_grading_form extends moodleform {
|
|||
}
|
||||
}
|
||||
}
|
||||
$mform->addElement('static', 'finalgrade', get_string('currentgrade', 'assignment').':' ,
|
||||
'<a href="'.$CFG->wwwroot.'/grade/report/grader/index.php?id='. $this->_customdata->courseid .'" >'.
|
||||
$this->_customdata->grading_info->items[0]->grades[$this->_customdata->userid]->str_grade . '</a>');
|
||||
$course_context = get_context_instance(CONTEXT_MODULE , $this->_customdata->cm->id);
|
||||
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
|
||||
$grade = '<a href="'.$CFG->wwwroot.'/grade/report/grader/index.php?id='. $this->_customdata->courseid .'" >'.
|
||||
$this->_customdata->grading_info->items[0]->grades[$this->_customdata->userid]->str_grade . '</a>';
|
||||
}else{
|
||||
$grade = $this->_customdata->grading_info->items[0]->grades[$this->_customdata->userid]->str_grade;
|
||||
}
|
||||
$mform->addElement('static', 'finalgrade', get_string('currentgrade', 'assignment').':' ,$grade);
|
||||
$mform->setType('finalgrade', PARAM_INT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue