Skip to content

Instantly share code, notes, and snippets.

@stronk7
Last active September 9, 2016 09:07
Show Gist options
  • Save stronk7/29fe38510bc88c3b5579617bd4676a5c to your computer and use it in GitHub Desktop.
Save stronk7/29fe38510bc88c3b5579617bd4676a5c to your computer and use it in GitHub Desktop.
hide and lock grade items example
diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php
index 18e7c16..a246696 100644
--- a/grade/report/grader/lib.php
+++ b/grade/report/grader/lib.php
@@ -838,6 +838,12 @@ class grade_report_grader extends grade_report {
}
} else {
// Element is a grade_item
+ if ($element['object']->itemname == 'One database') {
+ $element['object']->itemname = 'Deletion in progress';
+ $element['object']->hidden = true;
+ $element['object']->locked = true;
+ $element['object']->lockedtime = time();
+ }
if ($element['object']->id == $this->sortitemid) {
if ($this->sortorder == 'ASC') {
$arrow = $this->get_sort_arrow('up', $sortlink);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment