home *** CD-ROM | disk | FTP | other *** search
/ Practice Anatomy Lab / PAL.ISO / pc / PAL.swf / scripts / __Packages / com / argosy / ui / QuestionViewer.as < prev    next >
Encoding:
Text File  |  2007-03-19  |  67.8 KB  |  1,539 lines

  1. class com.argosy.ui.QuestionViewer extends com.argosy.ui.LabelViewer
  2. {
  3.    var current_question;
  4.    var question_holder;
  5.    var check_button;
  6.    var feedback_tf;
  7.    var feedback_icon;
  8.    var button_holder;
  9.    var xml_loader;
  10.    var question_array;
  11.    var base_url;
  12.    var questionMode;
  13.    var summary_alert;
  14.    var isTimedExam;
  15.    var activity_timer;
  16.    var uiPanel;
  17.    var summary_mc;
  18.    var load_bar;
  19.    var instructions_tf;
  20.    var caption_tf;
  21.    var location_tf;
  22.    var image_holder;
  23.    var image_loader;
  24.    var mask;
  25.    var onEnterFrame;
  26.    var bg;
  27.    var back_button;
  28.    var next_button;
  29.    static var label_style;
  30.    static var color_array = [null,11653866,7983018,8243956,10003677,3983555,48851];
  31.    var isComplete = false;
  32.    var activity_time_limit = 1;
  33.    var image_loaded = false;
  34.    var uiPanelWidth = 220;
  35.    var showAllOutlines = false;
  36.    var showAllLabels = false;
  37.    var showRollOvers = true;
  38.    function QuestionViewer()
  39.    {
  40.       super();
  41.    }
  42.    function recordAnswer()
  43.    {
  44.       switch(this.current_question.type)
  45.       {
  46.          case "fill_in":
  47.             var _loc4_ = false;
  48.             for(var _loc3_ in this.current_question.answers)
  49.             {
  50.                if(this.trimSpaces(this.current_question.user_input).toLowerCase() == this.trimSpaces(this.current_question.answers[_loc3_]).toLowerCase())
  51.                {
  52.                   _loc4_ = true;
  53.                }
  54.             }
  55.             break;
  56.          case "multi_choice":
  57.             _loc4_ = false;
  58.             if(this.current_question.selection.correct == "true")
  59.             {
  60.                _loc4_ = true;
  61.             }
  62.             break;
  63.          case "true_false":
  64.             _loc4_ = false;
  65.             if(this.current_question.user_input == this.current_question.answer)
  66.             {
  67.                _loc4_ = true;
  68.             }
  69.             break;
  70.          case "matching":
  71.             _loc4_ = true;
  72.             this.current_question.correct_count = 0;
  73.             this.current_question.question_count = this.question_holder.questions.length;
  74.             var _loc3_ = 0;
  75.             while(_loc3_ < this.question_holder.questions.length)
  76.             {
  77.                if(this.current_question.user_input[_loc3_].answer == this.current_question.user_input[_loc3_].user_input || this.current_question.user_input[_loc3_].answer.toUpperCase() == this.current_question.user_input[_loc3_].user_input.toUpperCase())
  78.                {
  79.                   this.current_question.user_input[_loc3_].isCorrect = true;
  80.                   this.current_question.correct_count = this.current_question.correct_count + 1;
  81.                }
  82.                else
  83.                {
  84.                   this.current_question.user_input[_loc3_].isCorrect = false;
  85.                   _loc4_ = false;
  86.                }
  87.                _loc3_ = _loc3_ + 1;
  88.             }
  89.             break;
  90.          case "flag":
  91.          case "pin":
  92.             _loc4_ = true;
  93.             this.current_question.correct_count = 0;
  94.             this.current_question.question_count = this.question_holder.flags.length;
  95.             if(this.current_question.user_input == undefined)
  96.             {
  97.                _loc4_ = false;
  98.             }
  99.             else
  100.             {
  101.                _loc3_ = 0;
  102.                while(_loc3_ < this.question_holder.flags.length)
  103.                {
  104.                   if(this.current_question.user_input[_loc3_].correct == this.current_question.user_input[_loc3_].user)
  105.                   {
  106.                      this.current_question.correct_count = this.current_question.correct_count + 1;
  107.                   }
  108.                   else
  109.                   {
  110.                      _loc4_ = false;
  111.                   }
  112.                   _loc3_ = _loc3_ + 1;
  113.                }
  114.             }
  115.       }
  116.       this.current_question.isCorrect = _loc4_;
  117.       this.current_question.isGraded = true;
  118.       _global.setTimeout(this,"recordImage",100);
  119.    }
  120.    function recordImage()
  121.    {
  122.       if(this.image_loaded)
  123.       {
  124.          if(this.current_question.image == undefined)
  125.          {
  126.             this.current_question.image = new flash.display.BitmapData(this.width,this.height);
  127.          }
  128.          this.current_question.image.draw(this);
  129.       }
  130.       else
  131.       {
  132.          _global.setTimeout(this,"recordImage",100);
  133.       }
  134.    }
  135.    function checkAnswer()
  136.    {
  137.       this.recordFlagData();
  138.       this.check_button.enabled = false;
  139.       this.check_button._alpha = 50;
  140.       this.current_question.locked = true;
  141.       this.revealAnswer();
  142.       _global.setTimeout(this,"recordImage",10);
  143.    }
  144.    function restoreFeedback()
  145.    {
  146.       this.check_button.enabled = false;
  147.       this.check_button._alpha = 50;
  148.       var _loc2_ = this.current_question.isCorrect;
  149.    }
  150.    function revealAnswer()
  151.    {
  152.       if(this.current_question.locked)
  153.       {
  154.          this.check_button.enabled = false;
  155.          this.check_button._alpha = 50;
  156.       }
  157.       else
  158.       {
  159.          this.check_button.enabled = true;
  160.          this.check_button._alpha = 100;
  161.       }
  162.       var _loc3_ = this.current_question.isCorrect;
  163.       switch(this.current_question.type)
  164.       {
  165.          case "fill_in":
  166.             this.question_holder.input_tf.type = "dynamic";
  167.             if(_loc3_)
  168.             {
  169.                this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>";
  170.                this.feedback_icon.gotoAndStop("correct");
  171.             }
  172.             else
  173.             {
  174.                this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>The correct answer is:<br/></location><right>" + this.current_question.answers[0] + "</right></p>";
  175.                this.feedback_icon.gotoAndStop("incorrect");
  176.             }
  177.             break;
  178.          case "multi_choice":
  179.             for(var _loc2_ in this.current_question.options)
  180.             {
  181.                this.current_question.options[_loc2_].mc.enabled = false;
  182.                if(this.current_question.options[_loc2_].correct == "true")
  183.                {
  184.                   this.current_question.options[_loc2_].mc.radio_button.gotoAndStop("correct");
  185.                }
  186.             }
  187.             if(_loc3_)
  188.             {
  189.                this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>";
  190.                this.current_question.selection.mc.feedback.gotoAndStop("correct");
  191.             }
  192.             else
  193.             {
  194.                this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>The correct answer is:<br/></location><right>" + this.current_question.answer_text + "</right></p>";
  195.                this.current_question.selection.mc.feedback.gotoAndStop("incorrect");
  196.                this.current_question.selection.mc.radio_button.gotoAndStop("incorrect");
  197.             }
  198.             break;
  199.          case "true_false":
  200.             this.question_holder.true_button.enabled = false;
  201.             this.question_holder.false_button.enabled = false;
  202.             var _loc4_ = this.current_question.answer.split("");
  203.             _loc4_[0] = _loc4_[0].toUpperCase();
  204.             var _loc5_ = _loc4_.join("");
  205.             if(_loc3_)
  206.             {
  207.                this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>";
  208.                this.feedback_icon.gotoAndStop("correct");
  209.             }
  210.             else
  211.             {
  212.                this.feedback_tf._y = this.check_button._y + this.check_button._height + 10;
  213.                this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>The correct answer is:<br/></location><right>" + _loc5_ + "</right></p>";
  214.             }
  215.             break;
  216.          case "matching":
  217.             var _loc2_ = 0;
  218.             while(_loc2_ < this.question_holder.questions.length)
  219.             {
  220.                this.question_holder.questions[_loc2_].input_tf.textEnabled = false;
  221.                _loc2_ = _loc2_ + 1;
  222.             }
  223.             _loc2_ = 0;
  224.             while(_loc2_ < this.question_holder.questions.length)
  225.             {
  226.                if(this.current_question.user_input[_loc2_].isCorrect)
  227.                {
  228.                   this.question_holder.questions[_loc2_].feedback.gotoAndStop("correct");
  229.                   this.question_holder.questions[_loc2_].feedback_tf.htmlText = "<p></p>";
  230.                }
  231.                else
  232.                {
  233.                   this.question_holder.questions[_loc2_].feedback.gotoAndStop("incorrect");
  234.                   this.question_holder.questions[_loc2_].feedback_tf.htmlText = "<p><wrong>" + this.current_question.user_input[_loc2_].answer + "</wrong></p>";
  235.                   _loc3_ = false;
  236.                }
  237.                _loc2_ = _loc2_ + 1;
  238.             }
  239.             if(_loc3_)
  240.             {
  241.                this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>";
  242.             }
  243.             else
  244.             {
  245.                this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong></p>";
  246.             }
  247.             break;
  248.          case "flag":
  249.          case "pin":
  250.             _loc2_ = 0;
  251.             while(_loc2_ < this.question_holder.flags.length)
  252.             {
  253.                this.question_holder.flags[_loc2_].enabled = false;
  254.                this.question_holder.flags[_loc2_].dragDummy.enabled = false;
  255.                _loc2_ = _loc2_ + 1;
  256.             }
  257.             if(this.current_question.user_input != undefined)
  258.             {
  259.                _loc2_ = 0;
  260.                while(_loc2_ < this.question_holder.flags.length)
  261.                {
  262.                   if(this.current_question.user_input[_loc2_].correct == this.current_question.user_input[_loc2_].user)
  263.                   {
  264.                      this.question_holder.flags[_loc2_].feedback.gotoAndStop("correct");
  265.                      this.question_holder.correct_count = this.question_holder.correct_count + 1;
  266.                   }
  267.                   else
  268.                   {
  269.                      this.question_holder.flags[_loc2_].feedback.gotoAndStop("incorrect");
  270.                      _loc3_ = false;
  271.                   }
  272.                   _loc2_ = _loc2_ + 1;
  273.                }
  274.             }
  275.             else
  276.             {
  277.                _loc2_ = 0;
  278.                while(_loc2_ < this.question_holder.flags.length)
  279.                {
  280.                   this.question_holder.flags[_loc2_].feedback.gotoAndStop("incorrect");
  281.                   _loc2_ = _loc2_ + 1;
  282.                }
  283.                _loc3_ = false;
  284.             }
  285.             this.showCorrectFlags();
  286.             if(_loc3_)
  287.             {
  288.                this.feedback_tf.htmlText = "<p><right>" + this.current_question.feedback.correct + "</right></p>";
  289.             }
  290.             else
  291.             {
  292.                this.feedback_tf.htmlText = "<p><wrong>" + this.current_question.feedback.incorrect + "</wrong><br/><location>Correct placement is now shown.</location></p>";
  293.             }
  294.       }
  295.       this.current_question.isCorrect = _loc3_;
  296.       if(this.feedback_icon._currentframe == 1 || this.feedback_icon == undefined)
  297.       {
  298.          while(this.feedback_tf._y + this.feedback_tf._height + 10 >= this.button_holder._y && this.feedback_tf._y > this.check_button._y + this.check_button._height + 5)
  299.          {
  300.             this.feedback_tf._y -= 1;
  301.          }
  302.       }
  303.       else
  304.       {
  305.          while(this.feedback_tf._y + this.feedback_tf._height + 10 >= this.button_holder._y && this.feedback_tf._y > this.feedback_icon._y + this.feedback_icon._height + 5)
  306.          {
  307.             this.feedback_tf._y -= 1;
  308.          }
  309.       }
  310.    }
  311.    function loadContent(url)
  312.    {
  313.       this.xml_loader.load(url);
  314.    }
  315.    function xml_loaded(success)
  316.    {
  317.       if(success == false || this.xml_loader.status != 0)
  318.       {
  319.          trace("XML Loaded: " + success + "  XML Parse Error: " + this.xml_loader.status);
  320.       }
  321.       else
  322.       {
  323.          this.question_array = [];
  324.          this.base_url = this.xml_loader.firstChild.attributes.base_url;
  325.          this.questionMode = this.xml_loader.firstChild.attributes.type;
  326.          var _loc3_ = 0;
  327.          while(_loc3_ < this.xml_loader.firstChild.childNodes.length)
  328.          {
  329.             if(this.xml_loader.firstChild.childNodes[_loc3_].nodeName == "question")
  330.             {
  331.                var _loc2_ = new Object();
  332.                _loc2_.id = this.xml_loader.firstChild.childNodes[_loc3_].attributes.id;
  333.                _loc2_.type = this.xml_loader.firstChild.childNodes[_loc3_].attributes.type;
  334.                _loc2_.index = this.question_array.length;
  335.                _loc2_.isCorrect = null;
  336.                _loc2_.isGraded = false;
  337.                _loc2_.locked = false;
  338.                _loc2_.memory = false;
  339.                _loc2_.summary = "";
  340.                switch(_loc2_.type)
  341.                {
  342.                   case "fill_in":
  343.                      this.createFillinQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]);
  344.                      break;
  345.                   case "multi_choice":
  346.                      this.createMultiChoiceQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]);
  347.                      break;
  348.                   case "true_false":
  349.                      this.createTrueFalseQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]);
  350.                      break;
  351.                   case "flag":
  352.                   case "pin":
  353.                      this.createFlagQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]);
  354.                      break;
  355.                   case "matching":
  356.                      this.createMatchingQuestion(_loc2_,this.xml_loader.firstChild.childNodes[_loc3_]);
  357.                }
  358.                this.question_array.push(_loc2_);
  359.             }
  360.             _loc3_ = _loc3_ + 1;
  361.          }
  362.       }
  363.       this.activity_time_limit = this.question_array.length * 40 / 60;
  364.       this.startActivity();
  365.    }
  366.    function startActivity(timer_flag)
  367.    {
  368.       this.isComplete = false;
  369.       if(this.questionMode == "Lab Practical")
  370.       {
  371.          if(timer_flag == undefined)
  372.          {
  373.             this.summary_alert.setContent("Timed Exam","Do you want to activate the timer for the lab practical? Doing so will limit how much time you can spend on each question. ","YES","NO",this,"startActivity");
  374.          }
  375.          else
  376.          {
  377.             this.isTimedExam = timer_flag;
  378.             if(this.isTimedExam)
  379.             {
  380.                this.activity_timer.start_timer(this.activity_time_limit);
  381.             }
  382.             else
  383.             {
  384.                this.activity_timer.clear_timer();
  385.             }
  386.             this.loadQuestion(this.question_array[0]);
  387.          }
  388.       }
  389.       else
  390.       {
  391.          this.activity_timer.clear_timer();
  392.          this.loadQuestion(this.question_array[0]);
  393.       }
  394.       this.uiPanel._visible = true;
  395.    }
  396.    function reset()
  397.    {
  398.       this.summary_mc.clearContent();
  399.       for(var _loc2_ in this.question_array)
  400.       {
  401.          this.question_array[_loc2_].user_input = null;
  402.          this.question_array[_loc2_].selection = null;
  403.          this.question_array[_loc2_].question_count = null;
  404.          this.question_array[_loc2_].correct_count = null;
  405.          this.question_array[_loc2_].isCorrect = null;
  406.          this.question_array[_loc2_].isGraded = false;
  407.          this.question_array[_loc2_].locked = false;
  408.          this.question_array[_loc2_].memory = false;
  409.          this.question_array[_loc2_].summary = "";
  410.          delete this.question_array[_loc2_].image;
  411.       }
  412.       this.startActivity();
  413.    }
  414.    function createMatchingQuestion(new_question, node)
  415.    {
  416.       new_question.user_input = [];
  417.       new_question.questions = [];
  418.       var _loc7_ = 0;
  419.       while(_loc7_ < node.childNodes.length)
  420.       {
  421.          var _loc1_ = node.childNodes[_loc7_];
  422.          switch(_loc1_.nodeName)
  423.          {
  424.             case "image":
  425.                new_question.image_id = _loc1_.attributes.image_id;
  426.                new_question.image_url = _loc1_.attributes.image_url;
  427.                new_question.hotspot_array = [];
  428.                var _loc2_ = 0;
  429.                while(_loc2_ < _loc1_.childNodes.length)
  430.                {
  431.                   if(_loc1_.childNodes[_loc2_].nodeName == "caption")
  432.                   {
  433.                      new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  434.                   }
  435.                   else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot")
  436.                   {
  437.                      var _loc3_ = new com.argosy.ui.LabelHotSpot();
  438.                      _loc3_.showAllOutlines = true;
  439.                      _loc3_.showRollOvers = false;
  440.                      _loc3_.showAllLabels = true;
  441.                      _loc3_.id = _loc1_.childNodes[_loc2_].attributes.id;
  442.                      _loc3_.color = _loc1_.childNodes[_loc2_].attributes.color;
  443.                      _loc3_.audio = _loc1_.childNodes[_loc2_].attributes.audio;
  444.                      _loc3_.type = _loc1_.childNodes[_loc2_].attributes.type;
  445.                      _loc3_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  446.                      new_question.hotspot_array.push(_loc3_);
  447.                   }
  448.                   _loc2_ = _loc2_ + 1;
  449.                }
  450.                break;
  451.             case "topinstructions":
  452.                new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>";
  453.                break;
  454.             case "instructions":
  455.                new_question.instructions = _loc1_.firstChild.nodeValue;
  456.                break;
  457.             case "statement":
  458.                var _loc6_ = new Object();
  459.                var _loc5_ = 0;
  460.                while(_loc5_ < _loc1_.childNodes.length)
  461.                {
  462.                   if(_loc1_.childNodes[_loc5_].nodeName == "matchtext")
  463.                   {
  464.                      _loc6_.id = _loc1_.childNodes[_loc5_].attributes.id;
  465.                      _loc6_.question_text = _loc1_.childNodes[_loc5_].firstChild.nodeValue;
  466.                   }
  467.                   else if(_loc1_.childNodes[_loc5_].nodeName == "answer")
  468.                   {
  469.                      _loc6_.answer_text = _loc1_.childNodes[_loc5_].firstChild.nodeValue;
  470.                   }
  471.                   _loc5_ = _loc5_ + 1;
  472.                }
  473.                new_question.questions.push(_loc6_);
  474.                break;
  475.             case "feedback":
  476.                new_question.feedback = {};
  477.                for(var _loc9_ in _loc1_.childNodes)
  478.                {
  479.                   new_question.feedback[_loc1_.childNodes[_loc9_].nodeName] = _loc1_.childNodes[_loc9_].firstChild.nodeValue;
  480.                   if(new_question.feedback[_loc1_.childNodes[_loc9_].nodeName].toLowerCase() == "correct.")
  481.                   {
  482.                      new_question.feedback[_loc1_.childNodes[_loc9_].nodeName] = "Correct";
  483.                   }
  484.                   else if(new_question.feedback[_loc1_.childNodes[_loc9_].nodeName].toLowerCase() == "incorrect.")
  485.                   {
  486.                      new_question.feedback[_loc1_.childNodes[_loc9_].nodeName] = "Incorrect";
  487.                   }
  488.                }
  489.          }
  490.          _loc7_ = _loc7_ + 1;
  491.       }
  492.    }
  493.    function createTrueFalseQuestion(new_question, node)
  494.    {
  495.       var _loc5_ = 0;
  496.       while(_loc5_ < node.childNodes.length)
  497.       {
  498.          var _loc1_ = node.childNodes[_loc5_];
  499.          new_question.user_input = "";
  500.          switch(_loc1_.nodeName)
  501.          {
  502.             case "image":
  503.                new_question.image_id = _loc1_.attributes.image_id;
  504.                new_question.image_url = _loc1_.attributes.image_url;
  505.                new_question.hotspot_array = [];
  506.                var _loc2_ = 0;
  507.                while(_loc2_ < _loc1_.childNodes.length)
  508.                {
  509.                   if(_loc1_.childNodes[_loc2_].nodeName == "caption")
  510.                   {
  511.                      new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  512.                   }
  513.                   else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot")
  514.                   {
  515.                      var _loc4_ = new com.argosy.ui.LabelHotSpot();
  516.                      _loc4_.showAllOutlines = true;
  517.                      _loc4_.showRollOvers = false;
  518.                      _loc4_.showAllLabels = true;
  519.                      _loc4_.id = _loc1_.childNodes[_loc2_].attributes.id;
  520.                      _loc4_.color = _loc1_.childNodes[_loc2_].attributes.color;
  521.                      _loc4_.audio = _loc1_.childNodes[_loc2_].attributes.audio;
  522.                      _loc4_.type = _loc1_.childNodes[_loc2_].attributes.type;
  523.                      _loc4_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  524.                      new_question.hotspot_array.push(_loc4_);
  525.                   }
  526.                   _loc2_ = _loc2_ + 1;
  527.                }
  528.                break;
  529.             case "topinstructions":
  530.                new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>";
  531.                break;
  532.             case "instructions":
  533.                new_question.instructions = _loc1_.firstChild.nodeValue;
  534.                break;
  535.             case "answer":
  536.             case "answers":
  537.                new_question.answer = _loc1_.attributes.correct;
  538.                break;
  539.             case "feedback":
  540.                new_question.feedback = {};
  541.                for(var _loc7_ in _loc1_.childNodes)
  542.                {
  543.                   new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = _loc1_.childNodes[_loc7_].firstChild.nodeValue;
  544.                   if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "correct.")
  545.                   {
  546.                      new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Correct";
  547.                   }
  548.                   else if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "incorrect.")
  549.                   {
  550.                      new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Incorrect";
  551.                   }
  552.                }
  553.                break;
  554.          }
  555.          _loc5_ = _loc5_ + 1;
  556.       }
  557.    }
  558.    function createFillinQuestion(new_question, node)
  559.    {
  560.       var _loc6_ = 0;
  561.       while(_loc6_ < node.childNodes.length)
  562.       {
  563.          var _loc1_ = node.childNodes[_loc6_];
  564.          new_question.user_input = "";
  565.          switch(_loc1_.nodeName)
  566.          {
  567.             case "image":
  568.                new_question.image_id = _loc1_.attributes.image_id;
  569.                new_question.image_url = _loc1_.attributes.image_url;
  570.                new_question.hotspot_array = [];
  571.                var _loc2_ = 0;
  572.                while(_loc2_ < _loc1_.childNodes.length)
  573.                {
  574.                   if(_loc1_.childNodes[_loc2_].nodeName == "caption")
  575.                   {
  576.                      new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  577.                   }
  578.                   else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot")
  579.                   {
  580.                      var _loc4_ = new com.argosy.ui.LabelHotSpot();
  581.                      _loc4_.showAllOutlines = true;
  582.                      _loc4_.showRollOvers = false;
  583.                      _loc4_.showAllLabels = true;
  584.                      _loc4_.id = _loc1_.childNodes[_loc2_].attributes.id;
  585.                      _loc4_.color = _loc1_.childNodes[_loc2_].attributes.color;
  586.                      _loc4_.audio = _loc1_.childNodes[_loc2_].attributes.audio;
  587.                      _loc4_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  588.                      _loc4_.type = _loc1_.childNodes[_loc2_].attributes.type;
  589.                      new_question.hotspot_array.push(_loc4_);
  590.                   }
  591.                   _loc2_ = _loc2_ + 1;
  592.                }
  593.                break;
  594.             case "topinstructions":
  595.                new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>";
  596.                break;
  597.             case "instructions":
  598.                new_question.instructions = _loc1_.firstChild.nodeValue;
  599.                break;
  600.             case "answers":
  601.                new_question.answers = [];
  602.                var _loc5_ = 0;
  603.                while(_loc5_ < _loc1_.childNodes.length)
  604.                {
  605.                   new_question.answers.push(_loc1_.childNodes[_loc5_].firstChild.nodeValue);
  606.                   _loc5_ = _loc5_ + 1;
  607.                }
  608.                break;
  609.             case "feedback":
  610.                new_question.feedback = {};
  611.                for(var _loc8_ in _loc1_.childNodes)
  612.                {
  613.                   new_question.feedback[_loc1_.childNodes[_loc8_].nodeName] = _loc1_.childNodes[_loc8_].firstChild.nodeValue;
  614.                   if(new_question.feedback[_loc1_.childNodes[_loc8_].nodeName].toLowerCase() == "correct.")
  615.                   {
  616.                      new_question.feedback[_loc1_.childNodes[_loc8_].nodeName] = "Correct";
  617.                   }
  618.                   else if(new_question.feedback[_loc1_.childNodes[_loc8_].nodeName].toLowerCase() == "incorrect.")
  619.                   {
  620.                      new_question.feedback[_loc1_.childNodes[_loc8_].nodeName] = "Incorrect";
  621.                   }
  622.                }
  623.          }
  624.          _loc6_ = _loc6_ + 1;
  625.       }
  626.    }
  627.    function createMultiChoiceQuestion(new_question, node)
  628.    {
  629.       var _loc9_ = 0;
  630.       while(_loc9_ < node.childNodes.length)
  631.       {
  632.          var _loc1_ = node.childNodes[_loc9_];
  633.          switch(_loc1_.nodeName)
  634.          {
  635.             case "image":
  636.                new_question.image_id = _loc1_.attributes.image_id;
  637.                new_question.image_url = _loc1_.attributes.image_url;
  638.                new_question.hotspot_array = [];
  639.                var _loc2_ = 0;
  640.                while(_loc2_ < _loc1_.childNodes.length)
  641.                {
  642.                   if(_loc1_.childNodes[_loc2_].nodeName == "caption")
  643.                   {
  644.                      new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  645.                   }
  646.                   else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot")
  647.                   {
  648.                      var _loc4_ = new com.argosy.ui.LabelHotSpot();
  649.                      _loc4_.showAllOutlines = true;
  650.                      _loc4_.showRollOvers = false;
  651.                      _loc4_.showAllLabels = true;
  652.                      _loc4_.id = _loc1_.childNodes[_loc2_].attributes.id;
  653.                      _loc4_.color = _loc1_.childNodes[_loc2_].attributes.color;
  654.                      _loc4_.audio = _loc1_.childNodes[_loc2_].attributes.audio;
  655.                      _loc4_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  656.                      _loc4_.type = _loc1_.childNodes[_loc2_].attributes.type;
  657.                      new_question.hotspot_array.push(_loc4_);
  658.                   }
  659.                   _loc2_ = _loc2_ + 1;
  660.                }
  661.                break;
  662.             case "topinstructions":
  663.                new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>";
  664.                break;
  665.             case "instructions":
  666.                new_question.instructions = _loc1_.firstChild.nodeValue;
  667.                break;
  668.             case "options":
  669.                new_question.options = [];
  670.                var _loc8_ = 0;
  671.                while(_loc8_ < _loc1_.childNodes.length)
  672.                {
  673.                   var _loc6_ = _loc1_.childNodes[_loc8_];
  674.                   var _loc7_ = {};
  675.                   _loc7_.id = _loc6_.attributes.id;
  676.                   _loc7_.correct = _loc6_.attributes.correct;
  677.                   var _loc5_ = 0;
  678.                   while(_loc5_ < _loc6_.childNodes.length)
  679.                   {
  680.                      switch(_loc6_.childNodes[_loc5_].nodeName)
  681.                      {
  682.                         case "label":
  683.                            _loc7_.label = _loc6_.childNodes[_loc5_].firstChild.nodeValue;
  684.                            break;
  685.                         case "feedback":
  686.                            _loc7_.feedback = _loc6_.childNodes[_loc5_].firstChild.nodeValue;
  687.                      }
  688.                      _loc5_ = _loc5_ + 1;
  689.                   }
  690.                   new_question.options.push(_loc7_);
  691.                   _loc8_ = _loc8_ + 1;
  692.                }
  693.                break;
  694.             case "feedback":
  695.                new_question.feedback = {};
  696.                for(var _loc11_ in _loc1_.childNodes)
  697.                {
  698.                   new_question.feedback[_loc1_.childNodes[_loc11_].nodeName] = _loc1_.childNodes[_loc11_].firstChild.nodeValue;
  699.                   if(new_question.feedback[_loc1_.childNodes[_loc11_].nodeName].toLowerCase() == "correct.")
  700.                   {
  701.                      new_question.feedback[_loc1_.childNodes[_loc11_].nodeName] = "Correct";
  702.                   }
  703.                   else if(new_question.feedback[_loc1_.childNodes[_loc11_].nodeName].toLowerCase() == "incorrect.")
  704.                   {
  705.                      new_question.feedback[_loc1_.childNodes[_loc11_].nodeName] = "Incorrect";
  706.                   }
  707.                }
  708.          }
  709.          _loc9_ = _loc9_ + 1;
  710.       }
  711.    }
  712.    function createFlagQuestion(new_question, node)
  713.    {
  714.       var _loc5_ = 0;
  715.       while(_loc5_ < node.childNodes.length)
  716.       {
  717.          var _loc1_ = node.childNodes[_loc5_];
  718.          switch(_loc1_.nodeName)
  719.          {
  720.             case "image":
  721.                new_question.image_id = _loc1_.attributes.image_id;
  722.                new_question.image_url = _loc1_.attributes.image_url;
  723.                new_question.hotspot_array = [];
  724.                var _loc2_ = 0;
  725.                while(_loc2_ < _loc1_.childNodes.length)
  726.                {
  727.                   if(_loc1_.childNodes[_loc2_].nodeName == "caption")
  728.                   {
  729.                      new_question.caption = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  730.                   }
  731.                   else if(_loc1_.childNodes[_loc2_].nodeName == "hotspot")
  732.                   {
  733.                      var _loc3_ = new com.argosy.ui.LabelHotSpot();
  734.                      _loc3_.showAllOutlines = false;
  735.                      _loc3_.showRollOvers = false;
  736.                      _loc3_.showAllLabels = false;
  737.                      _loc3_.id = _loc1_.childNodes[_loc2_].attributes.id;
  738.                      _loc3_.color = _loc1_.childNodes[_loc2_].attributes.color;
  739.                      _loc3_.audio = _loc1_.childNodes[_loc2_].attributes.audio;
  740.                      _loc3_.label = _loc1_.childNodes[_loc2_].firstChild.nodeValue;
  741.                      _loc3_.type = _loc1_.childNodes[_loc2_].attributes.type;
  742.                      new_question.hotspot_array.push(_loc3_);
  743.                   }
  744.                   _loc2_ = _loc2_ + 1;
  745.                }
  746.                new_question.hotspot_array.sort(function(a, b)
  747.                {
  748.                   return Math.round(Math.random() * 100 - 50);
  749.                }
  750.                );
  751.                break;
  752.             case "topinstructions":
  753.                new_question.topinstructions = "<p><instruction>" + _loc1_.firstChild.nodeValue + "</instruction></p>";
  754.                break;
  755.             case "instructions":
  756.                new_question.instructions = _loc1_.firstChild.nodeValue;
  757.                break;
  758.             case "feedback":
  759.                new_question.feedback = {};
  760.                for(var _loc7_ in _loc1_.childNodes)
  761.                {
  762.                   new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = _loc1_.childNodes[_loc7_].firstChild.nodeValue;
  763.                   if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "correct.")
  764.                   {
  765.                      new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Correct";
  766.                   }
  767.                   else if(new_question.feedback[_loc1_.childNodes[_loc7_].nodeName].toLowerCase() == "incorrect.")
  768.                   {
  769.                      new_question.feedback[_loc1_.childNodes[_loc7_].nodeName] = "Incorrect";
  770.                   }
  771.                }
  772.          }
  773.          _loc5_ = _loc5_ + 1;
  774.       }
  775.    }
  776.    function loadNextNumber()
  777.    {
  778.       if(this.questionMode == "Lab Practical")
  779.       {
  780.       }
  781.       this.loadQuestionNumber(this.current_question.index + 1);
  782.    }
  783.    function loadLastNumber()
  784.    {
  785.       if(this.questionMode == "Lab Practical")
  786.       {
  787.       }
  788.       this.loadQuestionNumber(this.current_question.index - 1);
  789.    }
  790.    function loadQuestionNumber(image_num)
  791.    {
  792.       if(image_num < 0)
  793.       {
  794.          image_num = this.question_array.length - 1;
  795.          this.loadQuestion(this.question_array[image_num]);
  796.       }
  797.       else if(image_num >= this.question_array.length)
  798.       {
  799.          if(this.questionMode == "Lab Practical")
  800.          {
  801.             this.summary_alert.setContent("Activity Complete","You have completed this activity.<br/><br/>To submit your answers for grading and see a summary of your answers with feedback, click the \"GRADE\" button.<br/><br/>If you‚Äôre taking this exam online and your instructor is using an electronic gradebook, your score will be recorded.<br/><br/>To continue working on this activity, click the \"CANCEL\" button.","GRADE","CANCEL",this,"buildSummary");
  802.          }
  803.          else
  804.          {
  805.             this.summary_alert.setContent("Activity Complete","You have completed this activity.<br/><br/>To see a summary of your answers with feedback and, if you choose, retake the quiz, click the \"SUBMIT\" button.<br/><br/>To continue working on this activity, click the \"CANCEL\" button.","SUBMIT","CANCEL",this,"buildSummary");
  806.          }
  807.       }
  808.       else
  809.       {
  810.          this.loadQuestion(this.question_array[image_num]);
  811.       }
  812.    }
  813.    function submitScores(selection)
  814.    {
  815.       if(!selection)
  816.       {
  817.          return undefined;
  818.       }
  819.       this.stop_timer();
  820.       com.argosy.PALReporting.setData("PLACEHOLDER",new Date(),this.question_array,this.activity_timer.get_elapsed_time(),this.activity_timer.get_elapsed_time() + this.activity_timer.get_duration_time());
  821.       var results = new LoadVars();
  822.       results.onLoad = mx.utils.Delegate.create(this,function(success)
  823.       {
  824.          if(success && results.response == "SUCCESS")
  825.          {
  826.             this.summary_alert.setContent("Grades Sent","Server Response:" + results.response + " Submitted on:" + results.timestamp + " Click the \"OK\" button to see the results","OK",null,this,"buildSummary");
  827.          }
  828.          else
  829.          {
  830.             this.summary_alert.setContent("Error Sending Grades","Server Response:" + results.response + " Do you want to retry?","YES","NO",this,"retrySubmitScores");
  831.          }
  832.       }
  833.       );
  834.       com.argosy.PALReporting.sendData(results);
  835.    }
  836.    function retrySubmitScores(selection)
  837.    {
  838.       if(!selection)
  839.       {
  840.          this.buildSummary(true);
  841.          return undefined;
  842.       }
  843.       this.stop_timer();
  844.       com.argosy.PALReporting.setData("PLACEHOLDER",new Date(),this.question_array,this.activity_timer.get_elapsed_time(),this.activity_timer.get_elapsed_time() + this.activity_timer.get_duration_time());
  845.       var results = new LoadVars();
  846.       results.onLoad = mx.utils.Delegate.create(this,function(success)
  847.       {
  848.          if(success && results.response == "SUCCESS")
  849.          {
  850.             this.summary_alert.setContent("Grades Sent","Server Response:" + results.response + " Submitted on:" + results.timestamp + " Click the \"OK\" button to see the results","OK",null,this,"buildSummary");
  851.          }
  852.          else
  853.          {
  854.             this.summary_alert.setContent("Error Sending Grades"," Do you want to retry?","YES","NO",this,"retrySubmitScores");
  855.          }
  856.       }
  857.       );
  858.       com.argosy.PALReporting.sendData(results);
  859.    }
  860.    function quiz_time_up(evt)
  861.    {
  862.       this.summary_alert.setContent("Time Up!","You have run out of time for this activity.<br/><br/>To submit your answers for grading and see a summary of your answers with feedback, click the \"GRADE\" button.<br/><br/>If you\'re taking this exam online and your instructor is using an electronic gradebook, your score will be recorded.<br/><br/>To discard your answers, click the \"CANCEL\" button.","GRADE","CANCEL",this,"timerExpiration");
  863.    }
  864.    function timerExpiration(flag)
  865.    {
  866.       if(flag)
  867.       {
  868.          this.buildSummary(true);
  869.       }
  870.       else
  871.       {
  872.          this.buildSummary(true);
  873.       }
  874.    }
  875.    function stop_timer()
  876.    {
  877.       this.activity_timer.stop_timer();
  878.    }
  879.    function buildSummary(flag)
  880.    {
  881.       if(flag == false)
  882.       {
  883.          if(this.questionMode == "Lab Practical" && this.isTimedExam)
  884.          {
  885.          }
  886.          this.loadQuestion(this.question_array[0]);
  887.       }
  888.       else
  889.       {
  890.          this.load_bar._visible = false;
  891.          this.stop_timer();
  892.          this.loadQuestion(null);
  893.          this.check_button.enabled = false;
  894.          this.check_button._alpha = 0;
  895.          this.instructions_tf.htmlText = "";
  896.          this.caption_tf.htmlText = "";
  897.          this.location_tf.htmlText = "";
  898.          this.button_holder._visible = false;
  899.          this.summary_mc.setContent(this.questionMode,this.question_array);
  900.          this.uiPanel._visible = false;
  901.          this.isComplete = true;
  902.       }
  903.    }
  904.    function proccess_blank_tag(str)
  905.    {
  906.       str = str.split("<blank/>").join("____________");
  907.       str = str.split("<blank_small/>").join("________");
  908.       str = str.split("<blank_medium/>").join("____________");
  909.       str = str.split("<blank_large/>").join("________________");
  910.       return str;
  911.    }
  912.    function loadQuestion(question_obj)
  913.    {
  914.       this.button_holder._visible = true;
  915.       this.current_question = question_obj;
  916.       this.question_holder.removeMovieClip();
  917.       this.question_holder = this.uiPanel.createEmptyMovieClip("question_holder",this.uiPanel.getNextHighestDepth());
  918.       if(question_obj.topinstructions != undefined && question_obj.topinstructions != "<p><instruction></instruction></p>" && question_obj.topinstructions != "")
  919.       {
  920.          this.instructions_tf.htmlText = this.proccess_blank_tag(question_obj.topinstructions);
  921.          this.question_holder._y = this.instructions_tf._y + this.instructions_tf._height;
  922.       }
  923.       else
  924.       {
  925.          this.instructions_tf.htmlText = "";
  926.          this.question_holder._y = this.instructions_tf._y;
  927.       }
  928.       this.question_holder.instructions_tf = this._createTextField(this.question_holder,"instructions_tf",1,0,0,this.uiPanelWidth,20,com.argosy.ui.QuestionViewer.label_style,"");
  929.       this.question_holder.instructions_tf.multiline = true;
  930.       this.question_holder.instructions_tf.wordWrap = true;
  931.       this.question_holder.instructions_tf.autoSize = true;
  932.       if(question_obj.instructions != undefined)
  933.       {
  934.          this.question_holder.instructions_tf.htmlText = "<p><question>" + this.proccess_blank_tag(question_obj.instructions) + "</question></p>";
  935.       }
  936.       switch(question_obj.type)
  937.       {
  938.          case "fill_in":
  939.             this.buildFillIn(question_obj);
  940.             break;
  941.          case "multi_choice":
  942.             this.buildMultiChoice(question_obj);
  943.             break;
  944.          case "true_false":
  945.             this.buildTrueFalse(question_obj);
  946.             break;
  947.          case "flag":
  948.          case "pin":
  949.             this.buildFlag(question_obj);
  950.             break;
  951.          case "matching":
  952.             this.buildMatching(question_obj);
  953.       }
  954.       this.image_holder = this.createEmptyMovieClip("image_holder",100);
  955.       this.image_holder._x = this.uiPanelWidth + 5;
  956.       this.image_holder._y = 5;
  957.       this.image_loaded = false;
  958.       if(this.current_question.image_url != undefined)
  959.       {
  960.          this.image_loader.loadClip(this.base_url + this.current_question.image_url,this.image_holder);
  961.       }
  962.       this.image_holder.setMask(this.mask);
  963.       this.image_holder._visible = false;
  964.       this.location_tf.htmlText = "<p><location>Question " + (question_obj.index + 1) + " out of " + this.question_array.length + "</location></p>";
  965.       this.layout();
  966.       if(!question_obj.locked)
  967.       {
  968.       }
  969.       question_obj.memory = true;
  970.    }
  971.    function buildMatching(question_obj)
  972.    {
  973.       this.check_button._visible = true;
  974.       this.check_button.enabled = true;
  975.       this.check_button._alpha = 100;
  976.       this.question_holder.question = question_obj;
  977.       this.question_holder.questions = [];
  978.       var _loc3_ = 0;
  979.       while(_loc3_ < question_obj.questions.length)
  980.       {
  981.          var _loc5_ = this.question_holder.getNextHighestDepth();
  982.          var _loc2_ = this.question_holder.createEmptyMovieClip("question_" + (_loc3_ + 1),_loc5_);
  983.          _loc2_.index = this.question_holder.questions.length;
  984.          _loc2_.feedback_tf = this._createTextField(_loc2_,"feedback_tf",2,0,0,20,20,com.argosy.ui.QuestionViewer.label_style);
  985.          _loc2_.feedback_tf.htmlText = "<p></p>";
  986.          _loc2_.feedback = _loc2_.attachMovie("feedback_icon","feedback",1,{_width:20,_height:20});
  987.          _loc2_.feedback._x = 20;
  988.          _loc2_.input_tf = _loc2_.attachMovie("InputField","feedback",3);
  989.          _loc2_.input_tf.setLimit(1,"0123456789A-Za-z");
  990.          _loc2_.input_tf._x = 42;
  991.          _loc2_.input_tf.width = _loc2_.input_tf.height = 20;
  992.          _loc2_.label_tf = this._createTextField(_loc2_,"label_tf",4,64,0,this.uiPanelWidth - 64,20,com.argosy.ui.QuestionViewer.label_style);
  993.          _loc2_.label_tf.multiline = true;
  994.          _loc2_.label_tf.wordWrap = true;
  995.          _loc2_.label_tf.autoSize = true;
  996.          _loc2_.label_tf.htmlText = "<p><option>" + question_obj.questions[_loc3_].question_text + "</option></p>";
  997.          _loc2_.answer_text = question_obj.questions[_loc3_].answer_text;
  998.          this.question_holder.questions.push(_loc2_);
  999.          _loc3_ = _loc3_ + 1;
  1000.       }
  1001.       _loc3_ = 0;
  1002.       while(_loc3_ < this.question_holder.questions.length)
  1003.       {
  1004.          this.question_holder.questions[_loc3_]._x = 0;
  1005.          this.question_holder.questions[_loc3_]._y = _loc3_ <= 0 ? this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height : this.question_holder.questions[_loc3_ - 1]._y + this.question_holder.questions[_loc3_ - 1]._height + 10;
  1006.          if(question_obj.locked)
  1007.          {
  1008.             this.question_holder.questions[_loc3_].input_tf.input_tf.textEnabled = false;
  1009.          }
  1010.          else
  1011.          {
  1012.             this.question_holder.questions[_loc3_].input_tf.addEventListener("textChanged",this,"recordMatchingData");
  1013.          }
  1014.          if(question_obj.memory && question_obj.user_input[_loc3_].user_input != undefined)
  1015.          {
  1016.             this.question_holder.questions[_loc3_].input_tf.text = question_obj.user_input[_loc3_].user_input;
  1017.          }
  1018.          _loc3_ = _loc3_ + 1;
  1019.       }
  1020.       this.recordMatchingData();
  1021.    }
  1022.    function recordMatchingData(evt)
  1023.    {
  1024.       if(this.current_question.user_input == undefined)
  1025.       {
  1026.          this.current_question.user_input = [];
  1027.       }
  1028.       var _loc2_ = 0;
  1029.       while(_loc2_ < this.question_holder.questions.length)
  1030.       {
  1031.          this.current_question.user_input[_loc2_] = {user_input:this.question_holder.questions[_loc2_].input_tf.text,answer:this.current_question.questions[_loc2_].answer_text};
  1032.          _loc2_ = _loc2_ + 1;
  1033.       }
  1034.       this.recordAnswer();
  1035.    }
  1036.    function buildFlag(question_obj)
  1037.    {
  1038.       this.check_button._visible = true;
  1039.       this.check_button.enabled = true;
  1040.       this.check_button._alpha = 100;
  1041.       this.question_holder.flags = [];
  1042.       var _loc3_ = 0;
  1043.       while(_loc3_ < question_obj.hotspot_array.length)
  1044.       {
  1045.          var _loc5_ = this.question_holder.getNextHighestDepth();
  1046.          var _loc2_ = this.question_holder.createEmptyMovieClip("flag_" + (_loc3_ + 1),_loc5_);
  1047.          _loc2_.index = this.question_holder.flags.length;
  1048.          _loc2_.hotspot = null;
  1049.          _loc2_.feedback = _loc2_.attachMovie("feedback_icon","feedback",1,{_width:20,_height:20});
  1050.          if(question_obj.type == "flag")
  1051.          {
  1052.             _loc2_.flag = _loc2_.attachMovie("flag_mc","flag",2);
  1053.          }
  1054.          else if(question_obj.type == "pin")
  1055.          {
  1056.             _loc2_.flag = _loc2_.attachMovie("Pin_down","flag",2);
  1057.          }
  1058.          _loc2_.flag._x = _loc2_.feedback._x + _loc2_.feedback._width + 10;
  1059.          _loc2_.flag._y = _loc2_.flag._height / 2;
  1060.          _loc2_.flag.tf.embedFonts = true;
  1061.          _loc2_.flag.tf.styleSheet = com.argosy.ui.QuestionViewer.label_style;
  1062.          _loc2_.flag.tf.htmlText = "<p><flag>" + (_loc3_ + 1) + "</flag></p>";
  1063.          _loc2_.label_tf = this._createTextField(_loc2_,"label_tf",3,_loc2_.flag._x + _loc2_.flag._width,0,this.uiPanelWidth - (_loc2_.flag._x + _loc2_.flag._width),20,com.argosy.ui.QuestionViewer.label_style);
  1064.          _loc2_.label_tf.multiline = true;
  1065.          _loc2_.label_tf.wordWrap = true;
  1066.          _loc2_.label_tf.autoSize = true;
  1067.          _loc2_.label_tf.htmlText = "<p><option>" + question_obj.hotspot_array[_loc3_].label + "</option></p>";
  1068.          this.question_holder.flags.push(_loc2_);
  1069.          _loc3_ = _loc3_ + 1;
  1070.       }
  1071.       _loc3_ = 0;
  1072.       while(_loc3_ < this.question_holder.flags.length)
  1073.       {
  1074.          this.question_holder.flags[_loc3_]._x = 0;
  1075.          this.question_holder.flags[_loc3_]._y = _loc3_ <= 0 ? this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height : this.question_holder.flags[_loc3_ - 1]._y + this.question_holder.flags[_loc3_ - 1]._height;
  1076.          if(question_obj.locked)
  1077.          {
  1078.             this.question_holder.flags[_loc3_].enabled = false;
  1079.          }
  1080.          else
  1081.          {
  1082.             this.question_holder.flags[_loc3_].onPress = ascb.util.Proxy.create(this,this.dragFlag,question_obj,this.question_holder.flags[_loc3_]);
  1083.             this.question_holder.flags[_loc3_].onRelease = this.question_holder.flags[_loc3_].onReleaseOutside = ascb.util.Proxy.create(this,this.releaseFlag,question_obj,this.question_holder.flags[_loc3_]);
  1084.          }
  1085.          _loc3_ = _loc3_ + 1;
  1086.       }
  1087.    }
  1088.    function replaceFlags()
  1089.    {
  1090.       trace("‚Ä¢‚Ä¢replaceFlags‚Ä¢‚Ä¢");
  1091.       if(this.current_question.locked)
  1092.       {
  1093.          this.showCorrectFlags();
  1094.       }
  1095.       else
  1096.       {
  1097.          for(var _loc2_ in this.question_holder.flags)
  1098.          {
  1099.             if(this.current_question.user_input[_loc2_].userHS != undefined)
  1100.             {
  1101.                this.createFlag(this.current_question,this.question_holder.flags[_loc2_]);
  1102.                this.question_holder.flags[_loc2_].hotspot = this.current_question.user_input[_loc2_].userHS.graphic;
  1103.                this.question_holder.flags[_loc2_].dragDummy._x = this.image_holder._x + this.question_holder.flags[_loc2_].hotspot._x + this.question_holder.flags[_loc2_].hotspot.snap_point._x - this.question_holder._x;
  1104.                this.question_holder.flags[_loc2_].dragDummy._y = this.image_holder._y + this.question_holder.flags[_loc2_].hotspot._y + this.question_holder.flags[_loc2_].hotspot.snap_point._y - this.question_holder._y;
  1105.             }
  1106.          }
  1107.       }
  1108.    }
  1109.    function showCorrectFlags()
  1110.    {
  1111.       this.current_question.locked = true;
  1112.       var _loc2_ = 0;
  1113.       while(_loc2_ < this.question_holder.flags.length)
  1114.       {
  1115.          var _loc3_ = this.current_question.hotspot_array[_loc2_].graphic;
  1116.          this.createFlag(this.current_question,this.question_holder.flags[_loc2_]);
  1117.          this.question_holder.flags[_loc2_].hotspot = _loc3_;
  1118.          this.question_holder.flags[_loc2_].dragDummy._x = this.image_holder._x + _loc3_._x + _loc3_.snap_point._x - this.question_holder._x;
  1119.          this.question_holder.flags[_loc2_].dragDummy._y = this.image_holder._y + _loc3_._y + _loc3_.snap_point._y - this.question_holder._y;
  1120.          this.question_holder.flags[_loc2_].dragDummy.bg.gotoAndStop("right");
  1121.          this.question_holder.flags[_loc2_].dragDummy.enabled = false;
  1122.          _loc2_ = _loc2_ + 1;
  1123.       }
  1124.    }
  1125.    function testFlags(mc)
  1126.    {
  1127.       this.question_holder.flag_hit_test = null;
  1128.       for(var _loc4_ in this.current_question.hotspot_array)
  1129.       {
  1130.          var _loc2_ = this.current_question.hotspot_array[_loc4_].showHitTestOutline(mc);
  1131.          if(_loc2_ != null && this.question_holder.flag_hit_test == null)
  1132.          {
  1133.             this.question_holder.flag_hit_test = _loc2_;
  1134.          }
  1135.          else
  1136.          {
  1137.             this.current_question.hotspot_array[_loc4_].showHitTestOutline(null);
  1138.          }
  1139.       }
  1140.    }
  1141.    function dragFlag(question_obj, flag)
  1142.    {
  1143.       this.createFlag(question_obj,flag);
  1144.       flag.dragDummy._x = this.question_holder._xmouse;
  1145.       flag.dragDummy._y = this.question_holder._ymouse;
  1146.       flag.dragDummy.startDrag(true);
  1147.       this.onEnterFrame = ascb.util.Proxy.create(this,this.testFlags,flag.dragDummy);
  1148.    }
  1149.    function redragFlag(question_obj, flag)
  1150.    {
  1151.       flag.hotspot = null;
  1152.       flag.dragDummy.startDrag(true);
  1153.       this.onEnterFrame = ascb.util.Proxy.create(this,this.testFlags,flag.dragDummy);
  1154.    }
  1155.    function releaseFlag(question_obj, flag)
  1156.    {
  1157.       flag.dragDummy.stopDrag();
  1158.       this.onEnterFrame = null;
  1159.       var _loc2_ = this.question_holder.flag_hit_test;
  1160.       if(_loc2_ == null)
  1161.       {
  1162.          flag.hotspot = null;
  1163.          flag.dragDummy.removeMovieClip();
  1164.       }
  1165.       else
  1166.       {
  1167.          this.free_hotspot(_loc2_);
  1168.          flag.hotspot = _loc2_;
  1169.          flag.dragDummy._x = this.image_holder._x + _loc2_._x + _loc2_.snap_point._x - this.question_holder._x;
  1170.          flag.dragDummy._y = this.image_holder._y + _loc2_._y + _loc2_.snap_point._y - this.question_holder._y;
  1171.       }
  1172.       this.testFlags(null);
  1173.       this.recordFlagData();
  1174.    }
  1175.    function recordFlagData()
  1176.    {
  1177.       if(this.current_question.user_input == undefined)
  1178.       {
  1179.          this.current_question.user_input = [];
  1180.       }
  1181.       var _loc2_ = 0;
  1182.       while(_loc2_ < this.question_holder.flags.length)
  1183.       {
  1184.          this.current_question.user_input[_loc2_] = {hs:this.current_question.hotspot_array[_loc2_],correct:this.current_question.hotspot_array[_loc2_].id,user:this.question_holder.flags[_loc2_].hotspot.myObject.id,userHS:this.question_holder.flags[_loc2_].hotspot.myObject};
  1185.          _loc2_ = _loc2_ + 1;
  1186.       }
  1187.       this.recordAnswer();
  1188.    }
  1189.    function createFlag(question_obj, flag)
  1190.    {
  1191.       flag.dragDummy.removeMovieClip();
  1192.       flag.hotspot = null;
  1193.       var _loc3_ = 200 + flag.index;
  1194.       if(question_obj.type == "flag")
  1195.       {
  1196.          flag.dragDummy = this.question_holder.attachMovie("flag_down","drag_flag_" + _loc3_,_loc3_);
  1197.       }
  1198.       else if(question_obj.type == "pin")
  1199.       {
  1200.          flag.dragDummy = this.question_holder.attachMovie("Pin_down","drag_flag_" + _loc3_,_loc3_);
  1201.          flag.dragDummy.gotoAndStop("up");
  1202.       }
  1203.       flag.dragDummy.tf.embedFonts = true;
  1204.       flag.dragDummy.tf.styleSheet = com.argosy.ui.QuestionViewer.label_style;
  1205.       flag.dragDummy.tf.htmlText = flag.flag.tf.htmlText;
  1206.       flag.dragDummy.onPress = ascb.util.Proxy.create(this,this.redragFlag,question_obj,flag);
  1207.       flag.dragDummy.onRelease = flag.dragDummy.onReleaseOutside = ascb.util.Proxy.create(this,this.releaseFlag,question_obj,flag);
  1208.    }
  1209.    function free_hotspot(hs)
  1210.    {
  1211.       for(var _loc3_ in this.question_holder.flags)
  1212.       {
  1213.          if(this.question_holder.flags[_loc3_].hotspot == hs)
  1214.          {
  1215.             this.question_holder.flags[_loc3_].dragDummy.removeMovieClip();
  1216.             this.question_holder.flags[_loc3_].hotspot = null;
  1217.          }
  1218.       }
  1219.    }
  1220.    function buildTrueFalse(question_obj)
  1221.    {
  1222.       this.check_button._visible = true;
  1223.       this.check_button.enabled = true;
  1224.       this.check_button._alpha = 100;
  1225.       this.question_holder.true_false_button = this.question_holder.attachMovie("true_false_button","true_false_button",this.question_holder.getNextHighestDepth());
  1226.       this.question_holder.true_button = this.question_holder.true_false_button.true_button;
  1227.       this.question_holder.false_button = this.question_holder.true_false_button.false_button;
  1228.       if(!question_obj.locked)
  1229.       {
  1230.          this.question_holder.true_button.onPress = ascb.util.Proxy.create(this,this.selectTrueFalse,question_obj,"true");
  1231.          this.question_holder.false_button.onPress = ascb.util.Proxy.create(this,this.selectTrueFalse,question_obj,"false");
  1232.       }
  1233.       else
  1234.       {
  1235.          this.question_holder.true_button.enabled = false;
  1236.          this.question_holder.false_button.enabled = false;
  1237.       }
  1238.       this.question_holder.true_button._y = this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height + 10 + this.question_holder.true_button._height / 2;
  1239.       this.question_holder.false_button._y = this.question_holder.true_button._y;
  1240.       this.question_holder.true_button._x = this.question_holder._width / 2 - this.question_holder.true_button._width;
  1241.       this.question_holder.false_button._x = this.question_holder._width / 2 + this.question_holder.false_button._width / 2;
  1242.       if(question_obj.memory)
  1243.       {
  1244.          if(question_obj.user_input == "true")
  1245.          {
  1246.             this.question_holder.true_button._alpha = 100;
  1247.             this.question_holder.false_button._alpha = 50;
  1248.          }
  1249.          else if(question_obj.user_input == "false")
  1250.          {
  1251.             this.question_holder.true_button._alpha = 50;
  1252.             this.question_holder.false_button._alpha = 100;
  1253.          }
  1254.          else
  1255.          {
  1256.             this.question_holder.true_button._alpha = 100;
  1257.             this.question_holder.false_button._alpha = 100;
  1258.          }
  1259.       }
  1260.       else
  1261.       {
  1262.          this.question_holder.true_button._alpha = 100;
  1263.          this.question_holder.false_button._alpha = 100;
  1264.       }
  1265.       this.recordAnswer();
  1266.    }
  1267.    function selectTrueFalse(question_obj, option)
  1268.    {
  1269.       question_obj.user_input = option;
  1270.       if(option == "true")
  1271.       {
  1272.          this.question_holder.true_button._alpha = 100;
  1273.          this.question_holder.false_button._alpha = 50;
  1274.       }
  1275.       else
  1276.       {
  1277.          this.question_holder.true_button._alpha = 50;
  1278.          this.question_holder.false_button._alpha = 100;
  1279.       }
  1280.       this.recordAnswer();
  1281.    }
  1282.    function buildFillIn(question_obj)
  1283.    {
  1284.       this.question_holder.label_tf = this._createTextField(this.question_holder,"label_tf",this.question_holder.getNextHighestDepth(),10,this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height + 10,this.uiPanelWidth - 20,24,com.argosy.ui.QuestionViewer.label_style);
  1285.       this.question_holder.label_tf.htmlText = "<p><misc_text>Answer:</misc_text></p>";
  1286.       this.question_holder.input_tf = this.question_holder.attachMovie("InputField","input_tf",this.question_holder.getNextHighestDepth());
  1287.       this.question_holder.input_tf._x = 10;
  1288.       this.question_holder.input_tf._y = this.question_holder.label_tf._y + this.question_holder.label_tf._height;
  1289.       this.question_holder.input_tf.width = this.uiPanelWidth - 20;
  1290.       this.question_holder.input_tf.height = 24;
  1291.       Selection.setFocus(this.question_holder.input_tf.text_tf);
  1292.       this.question_holder.input_tf.addEventListener("textChanged",this,"fill_in_change");
  1293.       if(question_obj.memory && question_obj.user_input != undefined)
  1294.       {
  1295.          this.question_holder.input_tf.text = question_obj.user_input;
  1296.          if(question_obj.locked)
  1297.          {
  1298.             this.question_holder.input_tf.type = "dynamic";
  1299.          }
  1300.       }
  1301.       this.recordAnswer();
  1302.    }
  1303.    function fill_in_change(evt)
  1304.    {
  1305.       this.current_question.user_input = evt.target.text.toLowerCase();
  1306.       this.recordAnswer();
  1307.    }
  1308.    function buildMultiChoice(question_obj)
  1309.    {
  1310.       this.check_button._visible = true;
  1311.       this.check_button.enabled = true;
  1312.       this.check_button._alpha = 100;
  1313.       var _loc3_ = 0;
  1314.       while(_loc3_ < question_obj.options.length)
  1315.       {
  1316.          var _loc5_ = this.question_holder.getNextHighestDepth();
  1317.          var _loc4_ = this.question_holder.createEmptyMovieClip("option_" + (_loc3_ + 1),_loc5_);
  1318.          _loc4_.option_text = question_obj.options[_loc3_].label;
  1319.          _loc4_.feedback = _loc4_.attachMovie("feedback_icon","feedback",1,{_width:20,_height:20});
  1320.          _loc4_.attachMovie("radio_button","radio_button",2,{_x:20});
  1321.          _loc4_.tf = this._createTextField(_loc4_,"tf",3,40,0,this.uiPanelWidth - 40,20,com.argosy.ui.QuestionViewer.label_style,"");
  1322.          _loc4_.tf.multiline = _loc4_.tf.wordWrap = _loc4_.tf.autoSize = true;
  1323.          _loc4_.tf.htmlText = "<p><option>" + question_obj.options[_loc3_].label + "</option></p>";
  1324.          question_obj.options[_loc3_].mc = _loc4_;
  1325.          if(question_obj.options[_loc3_].correct == "true")
  1326.          {
  1327.             question_obj.answer_text = _loc4_.option_text;
  1328.          }
  1329.          if(_loc3_ == 0)
  1330.          {
  1331.             question_obj.options[_loc3_].mc._y = this.question_holder.instructions_tf._y + this.question_holder.instructions_tf._height + 10;
  1332.          }
  1333.          else
  1334.          {
  1335.             question_obj.options[_loc3_].mc._y = question_obj.options[_loc3_ - 1].mc._y + question_obj.options[_loc3_ - 1].mc._height + 10;
  1336.          }
  1337.          question_obj.options[_loc3_].mc.onPress = ascb.util.Proxy.create(this,this.selectMultiChoice,question_obj,question_obj.options[_loc3_]);
  1338.          if(question_obj.memory && question_obj.user_input != undefined)
  1339.          {
  1340.             if(_loc4_.option_text == question_obj.user_input)
  1341.             {
  1342.                question_obj.selection = question_obj.options[_loc3_];
  1343.                question_obj.options[_loc3_].mc.radio_button.gotoAndStop("on");
  1344.             }
  1345.          }
  1346.          if(question_obj.locked)
  1347.          {
  1348.             question_obj.options[_loc3_].mc.enabled = false;
  1349.          }
  1350.          _loc3_ = _loc3_ + 1;
  1351.       }
  1352.       this.recordAnswer();
  1353.    }
  1354.    function selectMultiChoice(question_obj, option)
  1355.    {
  1356.       question_obj.user_input = option.mc.option_text;
  1357.       question_obj.selection = option;
  1358.       for(var _loc3_ in question_obj.options)
  1359.       {
  1360.          question_obj.options[_loc3_].mc.radio_button.gotoAndStop("off");
  1361.       }
  1362.       question_obj.selection.mc.radio_button.gotoAndStop("on");
  1363.       this.recordAnswer();
  1364.    }
  1365.    function findHotSpots(mc)
  1366.    {
  1367.       trace("findHotSpots");
  1368.       for(var _loc3_ in mc)
  1369.       {
  1370.          mc[_loc3_]._visible = false;
  1371.       }
  1372.       for(_loc3_ in this.current_question.hotspot_array)
  1373.       {
  1374.          this.current_question.hotspot_array[_loc3_].graphic = this.image_holder["hs_" + this.current_question.hotspot_array[_loc3_].id];
  1375.          this.current_question.hotspot_array[_loc3_].graphic._visible = true;
  1376.       }
  1377.       trace(this.current_question.type);
  1378.       if(this.current_question.type == "flag" || this.current_question.type == "pin")
  1379.       {
  1380.          this.replaceFlags();
  1381.       }
  1382.       this.image_holder._visible = true;
  1383.       this.image_loaded = true;
  1384.    }
  1385.    function init()
  1386.    {
  1387.       this.xml_loader = new XML();
  1388.       this.xml_loader.ignoreWhite = true;
  1389.       this.xml_loader.onLoad = ascb.util.Proxy.create(this,this.xml_loaded);
  1390.       this.image_loader = new MovieClipLoader();
  1391.       this.image_loader.addListener(this);
  1392.       if(com.argosy.ui.QuestionViewer.label_style == undefined)
  1393.       {
  1394.          com.argosy.ui.QuestionViewer.label_style = new TextField.StyleSheet();
  1395.          com.argosy.ui.QuestionViewer.label_style.setStyle("p",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"12",color:"#999999",textAlign:"left",textDecoration:"none",kerning:"true",letterSpacing:"0"});
  1396.          com.argosy.ui.QuestionViewer.label_style.setStyle("caption",{display:"inline",fontSize:"14",color:"#999999",textAlign:"right"});
  1397.          com.argosy.ui.QuestionViewer.label_style.setStyle("instruction",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#000000",textAlign:"left",marginLeft:"10",marginRight:"10"});
  1398.          com.argosy.ui.QuestionViewer.label_style.setStyle("option",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#333333",textAlign:"left",marginRight:"2"});
  1399.          com.argosy.ui.QuestionViewer.label_style.setStyle("question",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#000000",textAlign:"left",marginLeft:"10",marginRight:"10"});
  1400.          com.argosy.ui.QuestionViewer.label_style.setStyle("location",{display:"inline",fontSize:"9",color:"#000000",textAlign:"center"});
  1401.          com.argosy.ui.QuestionViewer.label_style.setStyle("right",{display:"inline",fontSize:"12",color:"#009900",textAlign:"center"});
  1402.          com.argosy.ui.QuestionViewer.label_style.setStyle("wrong",{display:"inline",fontSize:"12",color:"#990000",textAlign:"center"});
  1403.          com.argosy.ui.QuestionViewer.label_style.setStyle("misc_text",{display:"inline",fontSize:"12",color:"#000000",textAlign:"left"});
  1404.          com.argosy.ui.QuestionViewer.label_style.setStyle("flag",{display:"inline",fontSize:"12",color:"#FFFFFF",textAlign:"center"});
  1405.          com.argosy.ui.QuestionViewer.label_style.setStyle("summary",{display:"inline",fontFamily:"Frutiger",fontSize:"12",color:"#000000",textAlign:"left",textDecoration:"none",kerning:"true",letterSpacing:"0"});
  1406.          com.argosy.ui.QuestionViewer.label_style.setStyle("summary_right",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"12",color:"#009900",textAlign:"left"});
  1407.          com.argosy.ui.QuestionViewer.label_style.setStyle("summary_wrong",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"12",color:"#990000",textAlign:"left"});
  1408.          com.argosy.ui.QuestionViewer.label_style.setStyle("summary_title",{display:"inline",fontFamily:"Frutiger Bold",fontSize:"18",color:"#1F3A70",textAlign:"left"});
  1409.       }
  1410.       super.init();
  1411.    }
  1412.    function createChildren()
  1413.    {
  1414.       this.bg = this.createEmptyMovieClip("bg",1);
  1415.       this.mask = this.createEmptyMovieClip("mask",2000);
  1416.       this.caption_tf = this._createTextField(this,"caption_tf",200,this.uiPanelWidth,10,this.width - this.uiPanelWidth - 10,20,com.argosy.ui.QuestionViewer.label_style,"");
  1417.       this.uiPanel = this.createEmptyMovieClip("uiPanel",200);
  1418.       this.button_holder = this.uiPanel.createEmptyMovieClip("button_holder",1);
  1419.       this.back_button = this.button_holder.attachMovie("back_button","back_button",1);
  1420.       this.next_button = this.button_holder.attachMovie("next_button","next_button",2);
  1421.       this.location_tf = this._createTextField(this.button_holder,"location_tf",3,0,10,this.uiPanelWidth,20,com.argosy.ui.QuestionViewer.label_style,"");
  1422.       this.instructions_tf = this._createTextField(this.uiPanel,"instructions_tf",3,0,10,this.uiPanelWidth,10,com.argosy.ui.QuestionViewer.label_style,"");
  1423.       this.instructions_tf.multiline = true;
  1424.       this.instructions_tf.wordWrap = true;
  1425.       this.instructions_tf.autoSize = true;
  1426.       this.feedback_tf = this._createTextField(this.uiPanel,"feedback_tf",4,0,10,this.uiPanelWidth,10,com.argosy.ui.QuestionViewer.label_style,"");
  1427.       this.feedback_tf.multiline = true;
  1428.       this.feedback_tf.wordWrap = true;
  1429.       this.feedback_tf.autoSize = true;
  1430.       this.check_button = this.uiPanel.attachMovie("check_button","check_button",5);
  1431.       this.check_button._visible = false;
  1432.       this.feedback_icon = this.uiPanel.attachMovie("feedback_icon","feedback_icon",6);
  1433.       this.next_button.onRelease = ascb.util.Proxy.create(this,this.loadNextNumber);
  1434.       this.back_button.onRelease = ascb.util.Proxy.create(this,this.loadLastNumber);
  1435.       this.check_button.onRelease = ascb.util.Proxy.create(this,this.checkAnswer);
  1436.       this.load_bar = this.attachMovie("LoadBar","load_bar",400);
  1437.       this.activity_timer = this.attachMovie("ActivityTimer","activity_timer",this.getNextHighestDepth());
  1438.       this.activity_timer.addEventListener("time_up",this,"quiz_time_up");
  1439.       this.summary_mc = this.attachMovie("SummaryViewer","summary_mc",this.getNextHighestDepth());
  1440.       this.summary_mc.addEventListener("reset_activity",this,"reset");
  1441.       this.summary_alert = this.attachMovie("AlertBox","summary_alert",this.getNextHighestDepth());
  1442.       this.layout();
  1443.    }
  1444.    function layout()
  1445.    {
  1446.       this.bg.clear();
  1447.       this.bg.beginFill(16777215,100);
  1448.       this.bg.lineTo(this.width,0);
  1449.       this.bg.lineTo(this.width,this.height);
  1450.       this.bg.lineTo(0,this.height);
  1451.       this.bg.lineTo(0,0);
  1452.       this.bg.endFill();
  1453.       this.mask.clear();
  1454.       this.mask.beginFill(16711680,0);
  1455.       this.mask.moveTo(this.uiPanelWidth,0);
  1456.       this.mask.lineTo(this.width,0);
  1457.       this.mask.lineTo(this.width,this.height);
  1458.       this.mask.lineTo(this.uiPanelWidth,this.height);
  1459.       this.mask.lineTo(this.uiPanelWidth,0);
  1460.       this.mask.endFill();
  1461.       this.uiPanel.clear();
  1462.       var _loc2_ = new flash.geom.Matrix();
  1463.       _loc2_.createGradientBox(this.uiPanelWidth,this.height,1.5707963267948966,0,0);
  1464.       this.uiPanel.beginGradientFill("linear",[14409183,10856103],[100,100],[0,255],_loc2_,"pad");
  1465.       com.drawing.drawUtil.drawRect(this.uiPanel,0,0,this.uiPanelWidth,this.height,0);
  1466.       this.uiPanel.endFill();
  1467.       this.uiPanel.lineStyle(2,16777215,0,false,"normal","square","miter",8);
  1468.       this.uiPanel.moveTo(this.uiPanelWidth - 1,0);
  1469.       this.uiPanel.lineTo(this.uiPanelWidth - 1,this.height);
  1470.       this.uiPanel.lineStyle(0,6710886,100);
  1471.       com.drawing.drawUtil.drawRect(this.uiPanel,0,0,this.uiPanelWidth,this.height,0);
  1472.       this.summary_mc._x = 0;
  1473.       this.summary_mc._y = 0;
  1474.       this.summary_mc.width = this.width;
  1475.       this.summary_mc.height = this.height;
  1476.       this.back_button._x = this.back_button._width;
  1477.       this.next_button._x = this.back_button._x + this.back_button._width + 20;
  1478.       this.location_tf._y = this.next_button._y + this.next_button._height;
  1479.       this.location_tf._width = this.next_button._x + this.next_button._width;
  1480.       this.button_holder._y = this.height - this.button_holder._height + 10;
  1481.       this.button_holder._x = this.uiPanelWidth / 2 - this.button_holder._width / 2;
  1482.       if(this.questionMode == "Lab Practical")
  1483.       {
  1484.          this.check_button._visible = false;
  1485.          this.feedback_icon._visible = false;
  1486.          this.feedback_tf._visible = false;
  1487.       }
  1488.       else if(this.questionMode == "Self Study")
  1489.       {
  1490.          this.check_button._visible = true;
  1491.          this.feedback_icon._visible = true;
  1492.          this.feedback_tf._visible = true;
  1493.       }
  1494.       this.check_button._x = this.uiPanelWidth / 2;
  1495.       this.check_button._y = this.question_holder._y + this.question_holder._height + this.check_button._height / 2 + 10;
  1496.       this.feedback_icon.gotoAndStop("blank");
  1497.       if(this.current_question.type == "flag" || this.current_question.type == "pin" || this.current_question.type == "multi_choice" || this.current_question.type == "matching")
  1498.       {
  1499.          this.feedback_tf._y = this.check_button._y + this.check_button._height + 10;
  1500.          this.feedback_tf.htmlText = "";
  1501.       }
  1502.       else
  1503.       {
  1504.          this.feedback_icon._x = this.uiPanelWidth / 2 - this.feedback_icon._width / 2;
  1505.          this.feedback_icon._y = this.check_button._y + this.check_button._height + 10;
  1506.          this.feedback_tf._y = this.feedback_icon._y + this.feedback_icon._height + 10;
  1507.          this.feedback_tf.htmlText = "";
  1508.       }
  1509.       this.load_bar._x = this.uiPanelWidth + (this.width - this.uiPanelWidth) / 2 - this.load_bar.width / 2;
  1510.       this.load_bar._y = this.height / 2 - this.load_bar.height / 2;
  1511.       this.activity_timer._x = this.uiPanel._x;
  1512.       this.activity_timer._y = this.uiPanel._y + this.uiPanel._height;
  1513.    }
  1514.    function onLoadInit(target_mc)
  1515.    {
  1516.       this.image_holder.setMask(this.mask);
  1517.       this.findHotSpots(target_mc);
  1518.       if(this.current_question.locked)
  1519.       {
  1520.          this.revealAnswer();
  1521.       }
  1522.    }
  1523.    function onLoadStart(target_mc)
  1524.    {
  1525.    }
  1526.    function onLoadError(target_mc, errorCode)
  1527.    {
  1528.       trace("onLoadError: " + errorCode);
  1529.    }
  1530.    function onLoadProgress(target_mc, loadedBytes, totalBytes)
  1531.    {
  1532.       this.load_bar.text = "Loading Image";
  1533.       this.load_bar.percent = loadedBytes / totalBytes;
  1534.    }
  1535.    function onLoadComplete(target_mc)
  1536.    {
  1537.    }
  1538. }
  1539.