@@ -42,8 +42,12 @@ class check_feedback_status extends external_api {
4242 public static function execute_parameters (): external_function_parameters {
4343 return new external_function_parameters ([
4444 'assignmentid ' => new external_value (PARAM_INT , 'The assignment instance id ' ),
45- 'userid ' => new external_value (PARAM_INT , 'The user id to check feedback for, 0 to check all pending tasks ' ,
46- VALUE_DEFAULT , 0 ),
45+ 'userid ' => new external_value (
46+ PARAM_INT ,
47+ 'The user id to check feedback for, 0 to check all pending tasks ' ,
48+ VALUE_DEFAULT ,
49+ 0
50+ ),
4751 ]);
4852 }
4953
@@ -73,7 +77,7 @@ public static function execute(int $assignmentid, int $userid = 0): array {
7377
7478 if ($ params ['userid ' ] > 0 ) {
7579 // Per-user mode: check if feedback exists for a specific user.
76- $ canview = ($ params ['userid ' ] == $ GLOBALS ['USER ' ]->id )
80+ $ canview = ($ params ['userid ' ] == $ globals ['USER ' ]->id )
7781 || has_capability ('mod/assign:grade ' , $ context );
7882 if (!$ canview ) {
7983 throw new \required_capability_exception ($ context , 'mod/assign:grade ' , 'nopermissions ' , '' );
@@ -105,7 +109,7 @@ public static function execute(int $assignmentid, int $userid = 0): array {
105109 'pattern ' => '%"assignment": ' . $ params ['assignmentid ' ] . '% ' ,
106110 ]);
107111
108- // feedbackexists=true means "done" (no more pending tasks).
112+ // The feedbackexists=true item means "done" (no more pending tasks).
109113 return ['feedbackexists ' => !$ pending ];
110114 }
111115
0 commit comments