OK, I actually hacked the shortanswer plugin and now I can get the userid, courseid and question name. I was hoping to also get the question category.
The question object does have a category field, but at the moment it is just an number, it doesn't have the actual question category.
Once I have userid, courseid, question category and question name, I can pass that to a url which will return a question specification or an answer as required.
The following is a section of the output when I use print_object with the question object (note that the category value is not the category):