You don't need to actually save the responses, the core question system handles that for you, providing you till it what the response comprises. You do that with the get_expected_data method https://github.com/moodle/moodle/blob/master/question/type/questionbase.php#L293. Probably worth looking at some examples of that in different question types to see typical implementations.
General developer forum
Help: How to save question user response?
This discussion has been locked so you can no longer reply to it.