by Doug Stevens.
Just a bit more info:
A var_dump of $params above reveals what I believe are the correct arguments. I can confirm that the userid and instanceid are the correct parent and student users in Moodle:
array(1) {
["assignments"]=>
array(530) {
.
.
.
[209]=>array(5) {
["roleid"]=>
int(9)
["userid"]=>
int(37597)
["instanceid"]=>
int(34248)
["contextid"]=>
int(30)
["contextlevel"]=>
string(4) "user"
}
.
.
.
}
}