Correctly export global ID.

Bug report from João Gandar. The questionnaire ID was written
to the file instead of the global_id.