Permalink
Browse files

Merge branch 'MDL-33117_grade_display_22' of git://github.com/andyjda…

…vis/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 086a156 + 7dc9feb commit 9b112d78bc1a6c17452b7d0b93b65570afd0ba0f @danpoltawski danpoltawski committed Oct 2, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 grade/report/user/lib.php
View
20 grade/report/user/lib.php
@@ -226,6 +226,26 @@ function inject_rowspans(&$element) {
}
$count = 1;
foreach ($element['children'] as $key=>$child) {
+
+ $grade_object = $child['object'];
+ // If grade object isn't hidden
+ if ($grade_object->hidden != 1) {
+
+ // If grade object is an module instance
+ if (!empty($grade_object->itemmodule) && !empty($grade_object->iteminstance)) {
+
+ $instances = $this->gtree->modinfo->get_instances();
+ // If we can find the module instance
+ if (!empty($instances[$grade_object->itemmodule][$grade_object->iteminstance])) {
+
+ $cm = $instances[$grade_object->itemmodule][$grade_object->iteminstance];
+ // Skip generating rowspans if the user cannot see the module instance
+ if (!$cm->uservisible) {
+ continue;
+ }
+ }
+ }
+ }
$count += $this->inject_rowspans($element['children'][$key]);
}
$element['rowspan'] = $count;

0 comments on commit 9b112d7

Please sign in to comment.