$scales_list = substr($scales_list, 0, -1);
$scales_array = get_records_list('scale', 'id', $scales_list);
}
+
+ $canviewhidden = has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $this->course->id));
foreach ($this->users as $userid => $user) {
$columncount = 0;
$grade->feedback = '';
}
+ // MDL-11274
+ // Hide grades in the grader report if the current grader doesn't have 'moodle/grade:viewhidden'
+ if ($grade->is_hidden() && !$canviewhidden) {
+ if (isset($grade->finalgrade)) {
+ $studentshtml .= '<td class="cell c'.$columncount++.'">'.userdate($grade->timecreated,get_string('strftimedatetimeshort')).'</td>'; } else {
+ $studentshtml .= '<td class="cell c'.$columncount++.'">-</td>';
+ }
+ continue;
+ }
+
$grade->courseid = $this->courseid;
$grade->grade_item =& $this->items[$itemid]; // this speedsup is_hidden() and other grade_grade methods
}
$coursemodule = get_coursemodule_from_instance($itemmodule, $iteminstance, $this->course->id);
-
+
$dir = $CFG->dirroot . "/mod/$itemmodule/";
$url = $CFG->wwwroot . "/mod/$itemmodule/";
}
$url .= "?id=$coursemodule->id";
- return '<a href="' . $url . '">' . $modulename . '</a>';
+
+ // MDL-11274, Hide grades in the grader report if the current grader doesn't have 'moodle/grade:viewhidden'
+ if (has_capability('moodle/grade:viewhidden', get_context_instance(CONTEXT_COURSE, $coursemodule->course))) {
+ return '<a href="' . $url . '">' . $modulename . '</a>';
+ } else {
+ return $modulename;
+ }
}
return $modulename;
$string['strftimedate'] = '%%d %%B %%Y';
$string['strftimedateshort'] = '%%d %%B';
$string['strftimedatetime'] = '%%d %%B %%Y, %%I:%%M %%p';
+$string['strftimedatetimeshort'] = '%%d/%%m/%%Y %%H:%%M';
$string['strftimedaydate'] = '%%A, %%d %%B %%Y';
$string['strftimedaydatetime'] = '%%A, %%d %%B %%Y, %%I:%%M %%p';
$string['strftimedayshort'] = '%%A, %%d %%B';