I'm not a coder but I wonder if there is sequel that can do what you need via the configurable reports block.
For future reference - if you build your questions into the Questionnaire module then this IS possible quite easily. You make 1 questionnaire module in a tucked away location (such as a "questionnaire course" that only those who should see the results would have access to this course). Then you make that questionnaire Public (click here for the docs). Then you add a new questionnaire module into each course that should contain your questions and select this public questionnaire so then all of the submitted answers get fed back into this ONE questionnaire (in the tucked away course). There are pros and cons depending on what exactly you need but check the docs for future reference.
Just found this out last year. Now I can have my admin see student answers in 1 location instead of having to gather all the answers from all the courses and manually combine them into one file. Time saver!