Tags are not currently spported in GIFT. Just to give the history, GIFT has been in Moodle for years. Tags for questions are a relatively recent addition. At the time, GIFT format was not exteded to include tag support.
Could we add it now? The main consideration for if we can do that is to keep both backwards and forwards compatitibility. That is, if you have a GIFT format file that works in the current version of Moodle, then it should still import into tomorrow's Moodle and give the same questions. And, if you create a GIFT file with tags to import into tomorrow's Moodle, then it is nice if it can be imported into current (or old) Moodle without causing errors (although the tags will be ignored.)
Also, as well as tags, I would like to be able to set the question ID number. We should be able to do both at the same time.
Let us look at Current GIFT format, and see how we could change it, here is a simple example:
// Here is a question.
::Addition question:: What is 2 + 2? {#4}
My first thought was to change the ::Addition question:: bit which gives the question name, one could imaging ::Addition question::tag:add::tag:basic::id:four::. However, if we did this, then when importing into old Moodle, the extra "tag:add::tag:basic::id:four::" bit would be treated as part of the question text.
So, I think the way we have to do this by putting the tags in the comments:
// Here is a question.
// [tag:add] [tag:basic] [id:four]
::Addition question:: What is 2 + 2? {#4}
That looks quite nice and clear to me. Easy to type, easy to process in code. Can anyone think of somthing better?
(Note, there would be no limit on where the tags and idnumber appeared in the comment. The following would produce exactly the same question, but I would not recommend it.
// [tag: basic] Here is a [id: four ] que[tag:add ]stion.
::Addition question:: What is 2 + 2? {#4}