home | about this site | will call | papers, tutorials, etc | online journal | random thoughts

 

     
  Using XML and Flash  
  This is an example of a quiz created in Flash. The title, question and answers are dynamic text that are read from and XML file. This allows the Flash module to be easily reused with different content. This quiz and the XML file may be downloaded. The text can be changed in the XML file to create a new quiz.  
     
  Try the quiz. Try the quiz.  
     
  This quiz loads the questions and answers from an XML file. The file text is shown below. You may copy this code and paste in a text editor. All of the text in green can be changed to create a new quiz with this Flash template. Just make sure that you save the Flash file (swf) and XML file in the same folder.  
     

 

 

<!DOCTYPE quiz [
  <!ELEMENT quiz (title, items)>
  <!ELEMENT title (#PCDATA)>
  <!ELEMENT items (item)+>
  <!ELEMENT item (question, answer, answer+)>
  <!ELEMENT question (#PCDATA)>
  <!ELEMENT answer (#PCDATA)>
  <!ATTLIST answer correct (y) #IMPLIED>
]>

<quiz>
 <title>A Quiz About Internet Stuff (8/23/2005)</title>
  <items>
   <item>
    <question>A java program that runs within a browser</question>
    <answer correct="y">Applet</answer>
    <answer>NetBIOS</answer>
    <answer>Backbone</answer>
    <answer>Imagemap</answer>
   </item>
   <item>
    <question>Extensible Markup Language.</question>
    <answer correct="y">XML</answer>
    <answer>EPS</answer>
    <answer>Firewall</answer>
    <answer>Dynamic Link Library</answer>
   </item>
   <item>
    <question>Security software installed between a company LAN and the     Internet.</question>
    <answer>Servlet</answer>
    <answer correct="y">Firewall</answer>
    <answer>Plug-in</answer>
    <answer>OLE Control</answer>
   </item>
   <item>
    <question>The Internet began as this in 1969.</question>
    <answer>Archie</answer>
    <answer>Cisco</answer>
    <answer>DOD</answer>
    <answer correct="y">ARPANET</answer>
   </item>
  </items>
</quiz>