Skip to content
Browse files

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
  • Loading branch information...
1 parent 8545f86 commit c97933ffa3e32ba97ad690cd2dfd976ef7554bad @marinaglancy marinaglancy committed Nov 8, 2011
Showing with 19 additions and 11 deletions.
  1. +6 −2 grade/lib.php
  2. +10 −5 grade/report/grader/lib.php
  3. +2 −0 grade/report/grader/styles.css
  4. +1 −4 grade/report/user/lib.php
View
8 grade/lib.php
@@ -1177,7 +1177,11 @@ private function get_activity_link($element) {
// 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 @@ public function get_grade_analysis_icon(grade_grade $grade) {
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')));
}
View
15 grade/report/grader/lib.php
@@ -1007,10 +1007,10 @@ public function get_right_rows() {
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 @@ public function get_right_avg_row($rows=array(), $grouponly=false) {
* 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 @@ protected function get_icons($element) {
$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 @@ protected function get_icons($element) {
if ($this->get_pref('showlocks')) {
$lockunlockicon = $this->gtree->get_locking_icon($element, $this->gpr);
}
+
+ }
+
+ $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, 'grade_icons');
+ return $OUTPUT->container($editicon.$editcalculationicon.$showhideicon.$lockunlockicon.$gradeanalysisicon, 'grade_icons');
}
/**
View
2 grade/report/grader/styles.css
@@ -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,
View
5 grade/report/user/lib.php
@@ -304,6 +304,7 @@ private function fill_table_recursive(&$element) {
$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 @@ private function fill_table_recursive(&$element) {
$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'];
- }
}
}

0 comments on commit c97933f

Please sign in to comment.
Something went wrong with that request. Please try again.