by Andrew Sadler.
Thank you. Pretty much what I had been doing. Got my answer.
I passed '$contexts->having_add_and_use()' to the questioncategory form element, instead of simply '$contexts'. The same code also allowed me to do a foreach loop which I was using for debugging.