Here is how you can work it out:
https://github.com/moodle/moodle/blob/master/question/format/gift/format.php#L267 calls https://github.com/moodle/moodle/blob/master/question/format.php#L268 which call the method in your question type if it exists. You can see arguments passed there.