Skip to content

Commit 6f22ed2

Browse files
committed
update static / self functions
1 parent ab28751 commit 6f22ed2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

block_my_feedback.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function init() {
3838

3939
if (!isset($USER->firstname)) {
4040
$this->title = get_string('pluginname', 'block_my_feedback');
41-
} else if ($this->is_teacher()) {
41+
} else if (self::is_teacher()) {
4242
$this->title = get_string('markingfor', 'block_my_feedback').' '.$USER->firstname;
4343
} else {
4444
$this->title = get_string('feedbackfor', 'block_my_feedback').' '.$USER->firstname;
@@ -62,7 +62,7 @@ public function get_content(): stdClass {
6262

6363
$template = new stdClass();
6464

65-
if ($this->is_teacher()) {
65+
if (self::is_teacher()) {
6666
// Teacher content.
6767
$template->mods = $this->fetch_marking($USER);
6868
} else {
@@ -183,7 +183,7 @@ public function get_mod_data($mod, $assess): ?stdClass {
183183
case 'assign':
184184

185185
// Check mod due date is relevant.
186-
$duedate = $this->duedate_in_range($mod->customdata['duedate']);
186+
$duedate = self::duedate_in_range($mod->customdata['duedate']);
187187
if (!$duedate) {
188188
return null;
189189
}
@@ -221,7 +221,7 @@ public function get_mod_data($mod, $assess): ?stdClass {
221221
*
222222
* @param stdClass $course
223223
*/
224-
public function is_course_current(stdClass $course): bool {
224+
public static function is_course_current(stdClass $course): bool {
225225
// Start date.
226226
if ($course->startdate > time()) {
227227
return false; // Before the start date.
@@ -246,7 +246,7 @@ public function is_course_current(stdClass $course): bool {
246246
*
247247
* @param int $duedate
248248
*/
249-
public function duedate_in_range(int $duedate): ?int {
249+
public static function duedate_in_range(int $duedate): ?int {
250250
// Only show dates within UCL limits for marking.
251251
$startdate = strtotime('-2 month'); // Longer time to try retain overdue marking at the top.
252252
$cutoffdate = strtotime('+1 month');

0 commit comments

Comments
 (0)