Drag and drop question

I am making a simple quiz type drag and drop where the user drags a word to a fill-in-the-blank area and the word fills-in. All the text is coming from an xml file. I plan on using (unless advised otherwise) “id” attributes on each of the xml nodes to link the question with the correct answer. One Answer can be used for more than one question.

My question is how do I handle the comparison? I am leaning towards a 2-dimensional array somehow. Any advice here?


<firstnode>
 <draggers>
  <dragger id="1">Dippity Dew</dragger>
 
  <dragger id="2">Sun</dragger>
 </draggers>
 
 <targets>
  <target id="1">This forms on your dippity early in the morning.</target>
 
  <target id="2">Big yellow thing in the sky.</target>
 
  <target id="2">Made up of gasses.</target>
 
 </targets>
</firstnode>