MDL-30161: link from gradebook (grading analysis) only appears now in Grader report but for all items; in User report the link under activity name contains userid

This commit is contained in:
Marina Glancy
2011-11-08 14:09:50 +08:00
parent 8545f86cc9
commit c97933ffa3
4 changed files with 19 additions and 11 deletions
+6 -2
View File
@@ -1177,7 +1177,11 @@ class grade_structure {
// If module has grade.php, link to that, otherwise view.php
if ($hasgradephp[$itemmodule]) {
return new moodle_url('/mod/' . $itemmodule . '/grade.php', array('id' => $cm->id, 'itemnumber' => $itemnumber));
$args = array('id' => $cm->id, 'itemnumber' => $itemnumber);
if (isset($element['userid'])) {
$args['userid'] = $element['userid'];
}
return new moodle_url('/mod/' . $itemmodule . '/grade.php', $args);
} else {
return new moodle_url('/mod/' . $itemmodule . '/view.php', array('id' => $cm->id));
}
@@ -1259,7 +1263,7 @@ class grade_structure {
return '';
}
return $OUTPUT->action_icon($url, new pix_icon('i/search',
return $OUTPUT->action_icon($url, new pix_icon('t/preview',
get_string('gradeanalysis', 'core_grades')));
}
+10 -5
View File
@@ -1007,10 +1007,10 @@ class grade_report_grader extends grade_report {
if ($item->needsupdate) {
$itemcell->text .= html_writer::tag('span', get_string('error'), array('class'=>"gradingerror$hidden$gradepass"));
} else {
if ($this->get_pref('showanalysisicon') and !is_null($gradeval)) {
$itemcell->text .= html_writer::tag('span', grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null), array('class'=>"gradevalue$hidden$gradepass"));
if ($this->get_pref('showanalysisicon')) {
$itemcell->text .= $this->gtree->get_grade_analysis_icon($grade);
}
$itemcell->text .= html_writer::tag('span', grade_format_gradevalue($gradeval, $item, true, $gradedisplaytype, null), array('class'=>"gradevalue$hidden$gradepass"));
}
}
@@ -1445,7 +1445,7 @@ class grade_report_grader extends grade_report {
* figures out the state of the object and builds then returns a div
* with the icons needed for the grader report.
*
* @param object $object
* @param array $object
* @return string HTML
*/
protected function get_icons($element) {
@@ -1467,7 +1467,6 @@ class grade_report_grader extends grade_report {
$lockunlockicon = '';
if (has_capability('moodle/grade:manage', $this->context)) {
if ($this->get_pref('showcalculations')) {
$editcalculationicon = $this->gtree->get_calculation_icon($element, $this->gpr);
}
@@ -1479,9 +1478,15 @@ class grade_report_grader extends grade_report {
if ($this->get_pref('showlocks')) {
$lockunlockicon = $this->gtree->get_locking_icon($element, $this->gpr);
}
}
return $OUTPUT->container($editicon.$editcalculationicon.$showhideicon.$lockunlockicon, 'grade_icons');
$gradeanalysisicon = '';
if ($this->get_pref('showanalysisicon') && $element['type'] == 'grade') {
$gradeanalysisicon .= $this->gtree->get_grade_analysis_icon($element['object']);
}
return $OUTPUT->container($editicon.$editcalculationicon.$showhideicon.$lockunlockicon.$gradeanalysisicon, 'grade_icons');
}
/**
+2
View File
@@ -471,6 +471,8 @@ width:2000px;
float:right;
}
.path-grade-report-grader .action-icon {margin-left:0.3em;}
.path-grade-report-grader .gradestable th.user,
.path-grade-report-grader .gradestable th.range,
.path-grade-report-grader .flexible th,
+1 -4
View File
@@ -304,6 +304,7 @@ class grade_report_user extends grade_report {
$depth = $element['depth'];
$grade_object = $element['object'];
$eid = $grade_object->id;
$element['userid'] = $this->user->id;
$fullname = $this->gtree->get_element_header($element, true, true, true);
$data = array();
$hidden = '';
@@ -393,10 +394,6 @@ class grade_report_user extends grade_report {
$data['grade']['class'] = $class;
$gradeval = $this->blank_hidden_total($this->courseid, $grade_grade->grade_item, $gradeval);
$data['grade']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true);
if ($this->get_pref('showanalysisicon') and !is_null($gradeval)) {
$data['grade']['content'] = $this->gtree->get_grade_analysis_icon($grade_grade) . $data['grade']['content'];
}
}
}