XML Quiz - Randomizing questions & level of difficulty questions

Hi Folks,
I’ve been tasked to do a quiz in XML with a few caveats and I need some help.

The quiz needs to pull randomized questions from the XML file and also I need to have this sort from 3 levels of difficulty. For example, a user would possibly get fed 3 easy 3 medium or 4 hard questions.

My XML is set up as follows:
<QUIZ>
<QUESTION TEXT=“Harry Markowitz won the Nobel Prize in Economics for a paper on portfolio diversification that he wrote while…” ANSWER=“2”>
<CHOICE>A. on the faculty at Columbia</CHOICE>
<CHOICE>B. a grad student at Chicago</CHOICE>
<CHOICE>C. a janitor at MIT</CHOICE>
<CHOICE>D. a patent clerk in Hamburg</CHOICE>
</QUESTION>
</QUIZ>

These questions are being stored in an array called questionsArray. So I guess all I need to do is call these from the array @ random, but the level thing is really kickin’ my butt. Im just kind of lost on this one and I was hoping for some insight all the way around on this. For some reason XML in Flash scares me. It always ends up being nightmare. Someone please wake me up from the nightmare:-\

Thanks,
Michael

hmm… maybe set your XML file up something like this…


<QUIZ>
   <QUESTION>
      <TEXT>What is the name of our Solar System?</TEXT>
      <LEVEL>1 (or "easy" or whatever)</LEVEL>
      <CHOICE>Blah</CHOICE>
      <CHOICE>Milky Way</CHOICE>
      <CHOICE>Saturn</CHOICE>
      <ANSWER>b</ANSWER>
   </QUESTION>

   <QUESTION>
      <TEXT>What is the cross product of two vectors a and b?</TEXT>
      <LEVEL>2 (or "medium" or whatever)</LEVEL>
      <CHOICE>the projection of a onto b</CHOICE>
      <CHOICE>A vector perpendicular to the plane fromed by a and b</CHOICE>
      <CHOICE>Your mom</CHOICE>
      <ANSWER>b</ANSWER>
   </QUESTION>
</QUIZ>

well… something like that… if u need a ny more help in loading that into flash…well… ask! :stuck_out_tongue:

-Aditya
:thumb:

Thanks aditya,
That makes sense so far…

My next question is…How do I load that in there? I guess I don’t understand how I need handle the levels

Thanks Muchly,
Michael