If you are building a Moodle question type, it is best not to use Ajax for that type of interaction.
It is important to understand the different question behaviours, and what they do. The best way to do that is to create an example question, with some hints, and preview it using all the different behaviours. That way you can see which parts of the overall experience are managed by the question type, and which are managed by the behaviour plug-in.