This is probably a simple question, but I don't even know what search terms to use to find an answer.
I'm trying to update an existing php plug-in in a Learning Management System (Moodle). The code for one part of the plug-in is essentially just a copy of some code from the core code.
Plug in code:
$grade = $assign->get_user_grade($params['userid'], false);
which mostly copies core Moodle code:
$grade = $this->get_user_grade($userid, false, $attemptnumber);
The plug-in is missing the "attemptnumber" parameter, and I want to include it. When I change the code to:
$grade = $assign->get_user_grade($params['userid'], false, ['attemptnumber']);
my code editor says I have a syntax error. What's wrong with it, and how do I fix it?