home *** CD-ROM | disk | FTP | other *** search
/ FCE Gold Plus / GOLD.iso / pc / fscommand / linux / main.swf / scripts / __Packages / com / screen / Test.as < prev    next >
Encoding:
Text File  |  2007-09-06  |  80.9 KB  |  1,966 lines

  1. class com.screen.Test
  2. {
  3.    var c_objScreenData;
  4.    var c_objNavigator;
  5.    var c_iStartQuestion;
  6.    var c_strMode;
  7.    var c_arrToNavigator;
  8.    var c_arrAttepmtedToNav;
  9.    var objRef;
  10.    var c_strSkill;
  11.    var c_hQuestionState;
  12.    var c_objSourceRef;
  13.    var c_iPartNo;
  14.    var _parent;
  15.    var useHandCursor;
  16.    var gotoAndStop;
  17.    var objTimer;
  18.    var c_strEnvironment;
  19.    var c_iTotalTestQuestions;
  20.    var c_objOptName;
  21.    function Test()
  22.    {
  23.    }
  24.    function init(_objScreenData, _objSourceRef)
  25.    {
  26.       var _loc1_ = this;
  27.       _loc1_.c_strMode = com.controller.UICoordinator.getInstance().currentMode;
  28.       _loc1_.c_arrToNavigator = new Array();
  29.       _loc1_.c_arrAttepmtedToNav = new Array();
  30.       _loc1_.c_objOptName = new Array();
  31.       _loc1_.c_objScreenData = _objScreenData["get"]("Test");
  32.       _loc1_.c_objSourceRef = _objSourceRef;
  33.       _loc1_.c_blnOnce = true;
  34.       _loc1_.c_iLastQustion = 0;
  35.       _loc1_.c_blnOnceMCQ2 = true;
  36.       _loc1_.c_blnOnceMCQ3 = true;
  37.       _loc1_.c_blnOnceMCQ4 = true;
  38.       _loc1_.c_blnOnceMCQ5 = true;
  39.       _loc1_.c_blnOnceMCQ7 = true;
  40.       _loc1_.c_blnAttachNext = true;
  41.       _loc1_.c_blnSoundController = false;
  42.       _loc1_.c_blnFIB2_2 = false;
  43.       _loc1_.c_blnUOEFIB3 = false;
  44.       _loc1_.c_blnPairedMCQExtract = false;
  45.       _loc1_.c_blnPairedDropDown = false;
  46.       _loc1_.c_blnDDCollection = false;
  47.       _loc1_.c_blnOnceMCQ8 = true;
  48.       _loc1_.c_blnAutoFillFib = true;
  49.       _loc1_.c_iStartQuestion = 1;
  50.       _loc1_.c_blnInitL1 = false;
  51.       _loc1_.c_blnInitL2 = false;
  52.       _loc1_.c_blnInitL4 = false;
  53.       _loc1_.c_blnPairedScrolling = true;
  54.       _loc1_.c_strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
  55.       _loc1_.c_objMCQContainer = new Object();
  56.       _loc1_.countTotalQuestions(_loc1_.c_objScreenData);
  57.       _loc1_.countTotalTestMark();
  58.       _loc1_.c_hQuestionState = new com.util.HashMap();
  59.       if(_loc1_.c_strMode == "Continue" || _loc1_.c_strMode == "Review")
  60.       {
  61.          if(_objScreenData["get"]("Result") != undefined && _objScreenData["get"]("Result") != null)
  62.          {
  63.             var _loc3_ = new Object();
  64.             _loc3_ = _objScreenData["get"]("Result").result;
  65.             var objTemp = new Object();
  66.             var arrAttemptedQNos = new Array();
  67.             var strQuestionExists = _loc3_.question.attributes.number.split("_")[1];
  68.             if((_loc3_.question.length == null || _loc3_.question.length == undefined) && (strQuestionExists != null || strQuestionExists != undefined))
  69.             {
  70.                var strQuestionNumber = _loc3_.question.attributes.number;
  71.                var objTemp = new Object();
  72.                objTemp.attempted = _loc3_.question.attemptedoption.data;
  73.                objTemp.correct = _loc3_.question.correct.data;
  74.                objTemp.answeroption = _loc3_.question.answeroption.data;
  75.                _loc1_.arrForNavigator(objTemp,strQuestionNumber,arrAttemptedQNos);
  76.             }
  77.             var _loc2_ = 0;
  78.             while(_loc2_ < _loc3_.question.length)
  79.             {
  80.                var objTemp = new Object();
  81.                objTemp.attempted = _loc3_.question[_loc2_].attemptedoption.data;
  82.                objTemp.correct = _loc3_.question[_loc2_].correct.data;
  83.                objTemp.answeroption = _loc3_.question[_loc2_].answeroption.data;
  84.                var strQuestionNumber = _loc3_.question[_loc2_].attributes.number;
  85.                _loc1_.arrForNavigator(objTemp,strQuestionNumber,arrAttemptedQNos);
  86.                _loc2_ = _loc2_ + 1;
  87.             }
  88.             if(_loc1_.c_strMode == "Continue")
  89.             {
  90.                _loc1_.c_iStartQuestion = _loc1_.getFirstUnattempted(arrAttemptedQNos);
  91.             }
  92.          }
  93.       }
  94.       _loc1_.c_arrQuestionTypes = new Array();
  95.       _loc1_.c_iScore = 0;
  96.       _loc1_.loadScreen();
  97.    }
  98.    function countTotalQuestions(_objScreenData)
  99.    {
  100.       var _loc2_ = undefined;
  101.       var iTotalSections = _objScreenData.DOC.section.length;
  102.       var iTotalQuestions = 0;
  103.       if(iTotalSections == undefined || iTotalSections == null || iTotalSections == "")
  104.       {
  105.          iTotalSections = 1;
  106.       }
  107.       var _loc3_ = 0;
  108.       while(_loc3_ < iTotalSections)
  109.       {
  110.          _loc2_ = _objScreenData.DOC.section[_loc3_];
  111.          if(_loc2_ == undefined || _loc2_ == null)
  112.          {
  113.             _loc2_ = _objScreenData.DOC.section;
  114.          }
  115.          var _loc1_ = _loc2_.question.length;
  116.          !(_loc1_ == undefined || _loc1_ == null || _loc1_ == "") ? (iTotalQuestions += _loc1_) : iTotalQuestions++;
  117.          _loc3_ = _loc3_ + 1;
  118.       }
  119.       this.setTotalTestQuestions(iTotalQuestions);
  120.    }
  121.    function countTotalTestMark()
  122.    {
  123.       var iTotalSections = this.c_objScreenData.DOC.section.length;
  124.       var iTotalMark = 0;
  125.       var _loc1_ = undefined;
  126.       if(iTotalSections == undefined || iTotalSections == null || iTotalSections == "")
  127.       {
  128.          iTotalSections = 1;
  129.       }
  130.       var _loc3_ = 0;
  131.       while(_loc3_ < iTotalSections)
  132.       {
  133.          _loc1_ = this.c_objScreenData.DOC.section[_loc3_];
  134.          if(_loc1_ == null || _loc1_ == undefined)
  135.          {
  136.             _loc1_ = this.c_objScreenData.DOC.section;
  137.          }
  138.          if(_loc1_.attributes.assessed == "true")
  139.          {
  140.             var _loc2_ = _loc1_.question.length;
  141.             if(_loc2_ == undefined || _loc2_ == null || _loc2_ == "")
  142.             {
  143.                iTotalMark += _loc1_.attributes.maxMark * 1;
  144.             }
  145.             else
  146.             {
  147.                iTotalMark += _loc1_.attributes.maxMark * _loc2_;
  148.             }
  149.          }
  150.          _loc3_ = _loc3_ + 1;
  151.       }
  152.       com.controller.UICoordinator.getInstance().setTotalTestMark(iTotalMark);
  153.    }
  154.    function arrForNavigator(objTemp, strQuestionNumber, arrAttemptedQNos)
  155.    {
  156.       var _loc1_ = strQuestionNumber;
  157.       var _loc2_ = this;
  158.       var _loc3_ = objTemp;
  159.       _loc2_.c_hQuestionState.put(_loc1_,_loc3_);
  160.       _loc2_.c_arrToNavigator[Number(_loc1_.split("_")[1]) - 1] = _loc3_.correct;
  161.       _loc2_.c_arrAttepmtedToNav[Number(_loc1_.split("_")[1]) - 1] = _loc3_.attempted;
  162.       arrAttemptedQNos.push(Number(_loc1_.split("_")[1]));
  163.    }
  164.    function getFirstUnattempted(_arrAttemptedQNos)
  165.    {
  166.       var _loc2_ = _arrAttemptedQNos;
  167.       var _loc3_ = 0;
  168.       var iStartNo = 1;
  169.       if(_loc2_[0] > iStartNo)
  170.       {
  171.          return 1;
  172.       }
  173.       var _loc1_ = 1;
  174.       while(_loc1_ <= _loc2_.length)
  175.       {
  176.          if(_loc2_[_loc1_] != _loc2_[_loc1_ - 1] + 1)
  177.          {
  178.             break;
  179.          }
  180.          _loc3_ = _loc3_ + 1;
  181.          _loc1_ = _loc1_ + 1;
  182.       }
  183.       return _loc2_[_loc3_] + 1;
  184.    }
  185.    function loadScreen()
  186.    {
  187.       var _loc1_ = this;
  188.       _level101.gotoAndStop("TEST");
  189.       _level101.txt_UserName.text = "Name: " + _loc1_.c_objSourceRef.c_objUICoodInstance.userName;
  190.       _level101.btn_submitTest._visible = false;
  191.       _loc1_.attachPopUp();
  192.       _loc1_.setEvents();
  193.       _loc1_.attachAllClips();
  194.       _loc1_.c_iInterval = setInterval(_loc1_.loadScreenInterval,50,_loc1_);
  195.    }
  196.    function loadScreenInterval(objRef)
  197.    {
  198.       var _loc1_ = objRef;
  199.       clearInterval(_loc1_.c_iInterval);
  200.       _loc1_.arrangeNavigation();
  201.       if(_loc1_.c_strMode != "Review")
  202.       {
  203.          _loc1_.displayTimer();
  204.       }
  205.       else
  206.       {
  207.          _level101.mc_Timer._visible = false;
  208.          _level101.btn_quitTest._visible = false;
  209.          _level101.btn_submitTest._visible = false;
  210.          _level101.btn_quit._visible = false;
  211.          _level101.btn_backToMenu._visible = true;
  212.       }
  213.    }
  214.    function arrangeRubric()
  215.    {
  216.       var _loc2_ = this;
  217.       var _loc3_ = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].attributes.rubricClip;
  218.       var _loc1_ = _level101.attachMovie(_loc3_,"rubricBox",_level101.getNextHighestDepth(),{_x:8,_y:34.5});
  219.       _loc1_.txt_rubric.html = true;
  220.       _loc1_.txt_rubric.htmlText = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].rubric.data;
  221.    }
  222.    function displayTimer()
  223.    {
  224.       var _loc1_ = this;
  225.       _level101.mc_Timer._visible = true;
  226.       _level101.btn_quitTest._visible = true;
  227.       _level101.btn_quit._visible = true;
  228.       _level101.btn_backToMenu._visible = false;
  229.       if(_loc1_.c_strMode == "Continue")
  230.       {
  231.          var _loc2_ = com.controller.UICoordinator.getInstance().timeLeft;
  232.          var _iMinLeft = _loc2_.split(".")[0];
  233.          var _loc3_ = _loc2_.split(".")[1];
  234.          _loc1_.objTimer = new com.comp.Timer(_level101,Number(_iMinLeft) + 1,Number(_loc3_),"mc_timer","txt_time",_loc1_);
  235.       }
  236.       else
  237.       {
  238.          var _iTotalTime = com.controller.UICoordinator.getInstance().getTestTime();
  239.          _loc1_.objTimer = new com.comp.Timer(_level101,_iTotalTime,60,"mc_timer","txt_time",_loc1_);
  240.       }
  241.    }
  242.    function attachAllClips()
  243.    {
  244.       var _loc3_ = this;
  245.       var iTotalSections = _loc3_.c_objScreenData.DOC.section.length;
  246.       var _loc1_ = 0;
  247.       while(_loc1_ < iTotalSections)
  248.       {
  249.          var _loc2_ = _loc3_.c_objScreenData.DOC.section[_loc1_].attributes.templateType;
  250.          var iXPos = Number(_loc3_.c_objScreenData.DOC.section[_loc1_].attributes.XPos);
  251.          var iYPos = Number(_loc3_.c_objScreenData.DOC.section[_loc1_].attributes.YPos);
  252.          var mcQuestion = _level101.attachMovie(_loc2_,_loc2_,151 + _loc1_,{_x:iXPos,_y:iYPos});
  253.          mcQuestion._visible = false;
  254.          _loc1_ = _loc1_ + 1;
  255.       }
  256.    }
  257.    function arrangeNavigation()
  258.    {
  259.       var arrNav = new Array();
  260.       var _loc3_ = this.c_objScreenData.DOC.section;
  261.       var _loc1_ = 0;
  262.       while(_loc1_ < _loc3_.length)
  263.       {
  264.          var _loc2_ = "";
  265.          if(_loc3_[_loc1_].question.length != undefined)
  266.          {
  267.             var i = 0;
  268.             while(i < _loc3_[_loc1_].question.length)
  269.             {
  270.                _loc2_ = _loc2_ + _loc3_[_loc1_].question[i].attributes.number + ",";
  271.                i++;
  272.             }
  273.             _loc2_ = _loc2_.substr(0,_loc2_.length - 1);
  274.             arrNav.push({id:_loc2_,type:_loc3_[_loc1_].attributes.navType,skill:_loc3_[_loc1_].attributes.skill});
  275.          }
  276.          else
  277.          {
  278.             _loc2_ = _loc3_[_loc1_].question.attributes.number;
  279.             arrNav.push({id:_loc2_,type:_loc3_[_loc1_].attributes.navType,skill:_loc3_[_loc1_].attributes.skill});
  280.          }
  281.          false;
  282.          _loc1_ = _loc1_ + 1;
  283.       }
  284.       var SkillType;
  285.       SkillType = this.c_objScreenData.DOC.section[0].attributes.skill;
  286.       var iNavYPos = this.c_objScreenData.DOC.attributes.YPos;
  287.       this.c_objNavigator = new com.comp.Navigator(_level101,arrNav,SkillType,490,380,iNavYPos,this,this.c_iStartQuestion);
  288.       this.c_objNavigator.showResult();
  289.       if(this.c_strMode == "Review" || this.c_strMode == "Continue")
  290.       {
  291.          this.c_objNavigator.reviewNav(this.c_arrToNavigator,this.c_strMode,this.c_arrAttepmtedToNav);
  292.       }
  293.    }
  294.    function handleSound11()
  295.    {
  296.       var _loc1_ = this;
  297.       if(!_loc1_.c_objSoundController)
  298.       {
  299.       }
  300.       _loc1_.c_objSoundController = new com.comp.Soundconroller(_level101,604,47,null,1,"soundBtn");
  301.       if(!_loc1_.c_objVolumeController)
  302.       {
  303.       }
  304.       if(!_loc1_.c_blnSoundController)
  305.       {
  306.          var _loc2_ = com.controller.UICoordinator.getInstance().volumeLevel;
  307.          if(_loc2_ == "" or _loc2_ == undefined or _loc2_ == null)
  308.          {
  309.             _loc2_ = 50;
  310.          }
  311.          _loc1_.c_objVolumeController = new com.comp.Volumecontroller(_level101,534,5.5,_loc2_);
  312.          _loc1_.c_blnSoundController = true;
  313.       }
  314.       else
  315.       {
  316.          _loc1_.c_objSoundController.c_icount = 0;
  317.          _loc1_.c_objSoundController.c_ivolume = _loc1_.c_objVolumeController.getLevel();
  318.       }
  319.       _loc1_.c_objSoundController.c_selfRef = _loc1_.c_objVolumeController;
  320.       _loc1_.c_objSoundController.setVolumeValue(_loc1_.c_objVolumeController.getLevel());
  321.    }
  322.    function showScreen(_strTemplateType, _strSelected, _iCurrQuestion, _strSkill)
  323.    {
  324.       var _loc1_ = this;
  325.       var _loc2_ = _strSelected;
  326.       _loc1_.c_iCurrQuestion = _iCurrQuestion;
  327.       _loc1_.c_strSelected = _loc2_;
  328.       _loc1_.c_strSkill = _strSkill;
  329.       switch(_strTemplateType)
  330.       {
  331.          case "MCQType_1":
  332.             _loc1_.initMCQType1();
  333.             break;
  334.          case "MCQType_2":
  335.             _loc1_.initMCQType2();
  336.             break;
  337.          case "MCQType_3":
  338.             _loc1_.initMCQType3(_loc2_);
  339.             break;
  340.          case "MCQType_4":
  341.             _loc1_.initMCQType4(_loc2_);
  342.             break;
  343.          case "PairedMCQScrolling":
  344.             _loc1_.initPairedMCQScrolling();
  345.             break;
  346.          case "MCQType_5":
  347.             _loc1_.initMCQType5();
  348.             break;
  349.          case "FIBType_1":
  350.             _loc1_.initFIB1();
  351.             break;
  352.          case "AutoFillFib":
  353.             _loc1_.initAutoFillFib();
  354.             break;
  355.          case "FIBType_2":
  356.             _loc1_.initWordCount();
  357.             break;
  358.          case "FIBType_3":
  359.             _loc1_.initMCQType7();
  360.             break;
  361.          case "MCQType_6":
  362.             _loc1_.initMCQTypeL1();
  363.             break;
  364.          case "PairedMCQExtract":
  365.             _loc1_.initPairedMCQExtract();
  366.             break;
  367.          case "MCQType_7":
  368.             _loc1_.initMCQTypeL2();
  369.             break;
  370.          case "MCQType_8":
  371.             _loc1_.initMCQType8();
  372.             break;
  373.          case "FIBType_6":
  374.             _loc1_.initFIBType6();
  375.             break;
  376.          case "FIBType_4":
  377.             _loc1_.initMCQTypeL3();
  378.             break;
  379.          case "FIBType_5":
  380.             _loc1_.initFIBType5();
  381.             break;
  382.          case "UOEFIBType_5":
  383.             _loc1_.initUOEFIBType5();
  384.             break;
  385.          case "PairedDropDown":
  386.             _loc1_.initPairedDropDown();
  387.             break;
  388.          case "DropDownCollection":
  389.             _loc1_.initDDCollection();
  390.       }
  391.    }
  392.    function commonToAllMCQs()
  393.    {
  394.       var _loc1_ = this;
  395.       _level101.MCQ_Q1.init();
  396.       _loc1_.c_objMCQ = new com.screen.MCQ(_loc1_);
  397.       _level101.MCQ_Q1.objTimelineRef = _loc1_.c_objMCQ;
  398.    }
  399.    function commonToAllQs()
  400.    {
  401.       var _loc1_ = this;
  402.       _loc1_.c_iPartNo = Number(_loc1_.c_strSelected.split("_")[1]);
  403.       _loc1_.arrangeRubric();
  404.       _loc1_.c_iQuestionNo = Number(_loc1_.c_strSelected.split("_")[2]) + 1;
  405.       var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.templateType;
  406.       _level101[_loc2_]._visible = true;
  407.       return _loc2_;
  408.    }
  409.    function initNext(_strQuesType)
  410.    {
  411.       var _loc1_ = this;
  412.       var _iSectionLength = Number(_loc1_.c_objScreenData.DOC.section.length);
  413.       var _objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question;
  414.       var _loc3_ = Number(_loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question.length);
  415.       var _loc2_ = _level101[_strQuesType];
  416.       if(_loc1_.c_strMode == "Review")
  417.       {
  418.          if(_loc1_.c_objNavigator.c_iSeleID == _loc3_ && _loc1_.c_iPartNo == _iSectionLength - 1)
  419.          {
  420.             _loc2_.btn_next._visible = false;
  421.          }
  422.          else
  423.          {
  424.             _loc2_.btn_next._visible = true;
  425.          }
  426.       }
  427.       else
  428.       {
  429.          _loc2_.btn_next._visible = false;
  430.       }
  431.       _loc2_.btn_next.objRef = _loc1_;
  432.       _loc2_.btn_next.onRelease = function()
  433.       {
  434.          this.objRef.c_objNavigator.nextBtn();
  435.       };
  436.    }
  437.    function selectAndFreeze()
  438.    {
  439.       var _loc1_ = this;
  440.       if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null)
  441.       {
  442.          _level101.MCQ_Q1.setSelect(String(_loc1_.c_objHMObject.attempted));
  443.       }
  444.       if(_loc1_.c_strMode == "Review")
  445.       {
  446.          _level101.MCQ_Q1.freeze(true);
  447.       }
  448.    }
  449.    function initMCQType1()
  450.    {
  451.       var _loc1_ = this;
  452.       var _loc2_ = _loc1_.commonToAllQs();
  453.       _loc1_.commonToAllMCQs();
  454.       _loc1_.initNext(_loc2_);
  455.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  456.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  457.       var iTotalChoices = _loc3_.choice.length;
  458.       var iCorrectAnswer = _loc3_.attributes.correct;
  459.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  460.       _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,_loc3_,_level101[_loc2_],451,"1",null,_loc1_.c_strSkill,true);
  461.       _loc1_.selectAndFreeze();
  462.    }
  463.    function initMCQTypeL1()
  464.    {
  465.       var _loc1_ = this;
  466.       var _loc3_ = _loc1_.commonToAllQs();
  467.       _loc1_.commonToAllMCQs();
  468.       _loc1_.initNext(_loc3_);
  469.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc3_;
  470.       var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  471.       var iTotalChoices = _loc2_.choice.length;
  472.       var iCorrectAnswer = _loc2_.attributes.correct;
  473.       _loc1_.handleSound11();
  474.       var strSoundName = _loc2_.audio.data;
  475.       _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName);
  476.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  477.       _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,_loc2_,_level101[_loc3_],680,"MCQType_6",null,_loc1_.c_strSkill,false);
  478.       _loc1_.selectAndFreeze();
  479.    }
  480.    function initMCQType2()
  481.    {
  482.       var _loc1_ = this;
  483.       var strClipName = _loc1_.commonToAllQs();
  484.       var _loc3_ = _level101[strClipName];
  485.       _loc1_.commonToAllMCQs();
  486.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  487.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  488.       var iTotalChoices = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].paragraph.length;
  489.       var iTotalQuestionChoices = objQuestion.choice.length;
  490.       var strCorrectAnswer = objQuestion.attributes.correct.toLowerCase().charCodeAt(0);
  491.       var iCorrectAnswer = objQuestion.attributes.correct;
  492.       if(_loc1_.c_blnOnceMCQ2)
  493.       {
  494.          _loc3_.mc_ScrollPaneContent.setScrollContent("mc_ScrollContent");
  495.          _loc3_.mc_ScrollContent = _level101[strClipName].mc_ScrollPaneContent.getScrollContent();
  496.          _loc3_.mc_ScrollPaneContent.setSize(_level101[strClipName].mc_ScrollReference._width,_level101[strClipName].mc_ScrollReference._height);
  497.          _loc3_.mc_ScrollPaneContent._x = _level101[strClipName].mc_ScrollReference._x;
  498.          _loc3_.mc_ScrollPaneContent._y = _level101[strClipName].mc_ScrollReference._y;
  499.          _loc3_.mc_ScrollContent.txt_Description.selectable = false;
  500.          _loc1_.c_blnOnceMCQ2 = false;
  501.       }
  502.       if(objSection.paragraphTitle.data.length > 0)
  503.       {
  504.          _loc3_.mc_ScrollContent.txt_Description.htmlText = "<p align=\'center\'><b>" + objSection.paragraphTitle.data + "<br><br></b>";
  505.       }
  506.       else
  507.       {
  508.          _loc3_.mc_ScrollContent.txt_Description.htmlText = "";
  509.       }
  510.       var _loc2_ = 1;
  511.       while(_loc2_ <= iTotalChoices)
  512.       {
  513.          var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].paragraph[_loc2_ - 1].title.data;
  514.          var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].paragraph[_loc2_ - 1].text.data;
  515.          _loc3_.mc_ScrollContent.txt_Description.autoSize = true;
  516.          _loc3_.mc_ScrollContent.txt_Description.htmlText += "<b>" + String.fromCharCode(64 + _loc2_) + " - " + strTitle + "</b>" + "<p></p>" + strText + "<p></p>" + "<p></p>";
  517.          _loc2_ = _loc2_ + 1;
  518.       }
  519.       _loc3_.mc_ScrollPaneContent.refreshPane();
  520.       _loc1_.initNext(strClipName);
  521.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName;
  522.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  523.       _loc1_.c_objMCQ.init(iTotalQuestionChoices,iCorrectAnswer,objQuestion,_level101[strClipName],331.9,"MCQType_2",objSection,_loc1_.c_strSkill,true);
  524.       _loc1_.selectAndFreeze();
  525.    }
  526.    function initMCQTypeL2()
  527.    {
  528.       var _loc1_ = this;
  529.       var strClipName = _loc1_.commonToAllQs();
  530.       var iTotalQuestions = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question.length;
  531.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  532.       var strSoundName = objSection.audio.data;
  533.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName;
  534.       if(!_loc1_.c_blnInitL2)
  535.       {
  536.          var _loc2_ = 0;
  537.          while(_loc2_ < iTotalQuestions)
  538.          {
  539.             var strInstanceName = "MCQ_Q_" + (_loc2_ + 1);
  540.             var _loc3_ = new com.comp.ComponentMCQ();
  541.             _loc3_.init();
  542.             var objMCQ = new com.screen.MCQ(_loc1_);
  543.             _loc3_.objTimelineRef = objMCQ;
  544.             _loc1_.c_objMCQContainer[strInstanceName] = objMCQ;
  545.             _loc2_ = _loc2_ + 1;
  546.          }
  547.          _loc1_.handleSound11();
  548.          _loc1_.c_blnInitL2 = true;
  549.       }
  550.       var strSound = "tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName;
  551.       if(_loc1_.c_objNavigator.c_blnPartChange)
  552.       {
  553.          _loc1_.c_objSoundController.setSoundFile(strSound);
  554.          _loc1_.c_objNavigator.c_blnPartChange = false;
  555.       }
  556.       _loc1_.initNext(strClipName);
  557.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  558.       var iTotalChoices = objQuestion.choice.length;
  559.       var iCorrectAnswer = objQuestion.attributes.correct;
  560.       _loc1_.c_objMCQContainer["MCQ_Q_" + _loc1_.c_iQuestionNo].init(iTotalChoices,iCorrectAnswer,objSection,_level101[strClipName],493,"MCQType_7",objSection,_loc1_.c_strSkill,false);
  561.       _loc1_.showSectionData(objSection);
  562.       var bFreeze = _loc1_.c_strMode == "Review";
  563.       _loc1_.setFreezeMode(objSection,bFreeze);
  564.       if(_loc1_.c_strMode == "Review")
  565.       {
  566.          var bLastPart = _loc1_.c_iPartNo == _loc1_.c_objScreenData.DOC.section.length - 1;
  567.          _level101[strClipName].btn_Next._visible = !bLastPart;
  568.       }
  569.    }
  570.    function showSectionData(objSection)
  571.    {
  572.       var iQuesCount = objSection.question.length;
  573.       var _loc1_ = 0;
  574.       while(_loc1_ < iQuesCount)
  575.       {
  576.          var _loc3_ = objSection.question[_loc1_].attributes.number;
  577.          var _loc2_ = this.c_hQuestionState["get"](String(this.c_strSkill + "_" + _loc3_));
  578.          if(_loc2_ != null || _loc2_ != undefined)
  579.          {
  580.             _level101["ComponentMCQ_" + (_loc1_ + 1)].setSelect(String(_loc2_.attempted));
  581.          }
  582.          _loc1_ = _loc1_ + 1;
  583.       }
  584.    }
  585.    function setFreezeMode(objSection, bFreeze)
  586.    {
  587.       var _loc3_ = bFreeze;
  588.       var _loc2_ = objSection.question.length;
  589.       var _loc1_ = 1;
  590.       while(_loc1_ <= _loc2_)
  591.       {
  592.          _level101["ComponentMCQ_" + _loc1_].freeze(_loc3_);
  593.          _loc1_ = _loc1_ + 1;
  594.       }
  595.    }
  596.    function initMCQType3()
  597.    {
  598.       var _loc1_ = this;
  599.       var strClipName = _loc1_.commonToAllQs();
  600.       _loc1_.commonToAllMCQs();
  601.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  602.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  603.       var iTotalChoices = objQuestion.choice.length;
  604.       var iCorrectAnswer = objQuestion.attributes.correct;
  605.       if(_loc1_.c_blnOnceMCQ3)
  606.       {
  607.          var _loc2_ = 1;
  608.          while(_loc2_ <= iTotalChoices)
  609.          {
  610.             var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].textTitle.data;
  611.             var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].text.data;
  612.             var _loc3_ = new com.comp.WordWrap();
  613.             _loc3_.init(_level101[strClipName],strTitle,strText,575,9,480);
  614.             _loc2_ = _loc2_ + 1;
  615.          }
  616.          _loc1_.c_blnOnceMCQ3 = false;
  617.       }
  618.       _loc1_.initNext(strClipName);
  619.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName;
  620.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  621.       _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],214,"3",objSection,_loc1_.c_strSkill,false);
  622.       _loc1_.selectAndFreeze();
  623.    }
  624.    function initMCQType4()
  625.    {
  626.       var _loc1_ = this;
  627.       var _loc3_ = _loc1_.commonToAllQs();
  628.       _loc1_.commonToAllMCQs();
  629.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  630.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  631.       var iTotalChoices = objQuestion.choice.length;
  632.       var iCorrectAnswer = objQuestion.attributes.correct;
  633.       if(_loc1_.c_blnOnceMCQ4)
  634.       {
  635.          var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].title.data;
  636.          var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].text.data;
  637.          var _iCurrentQuestion = Number(objQuestion.attributes.number);
  638.          var _iTotalQuestions = Number(objSection.question.length);
  639.          _loc1_.c_iLastQustion = Number(_iTotalQuestions + _iCurrentQuestion - 1);
  640.          var mcScrollPane = _level101[_loc3_].attachMovie("FScrollPaneSymbol","mcReadingScroll",_level101[_loc3_].getNextHighestDepth());
  641.          var iScrollPaneW = _level101[_loc3_].mc_ScrollBarRef._width;
  642.          var iScrollPaneH = _level101[_loc3_].mc_ScrollBarRef._height;
  643.          var iScrollPaneX = _level101[_loc3_].mc_ScrollBarRef._x;
  644.          var iScrollPaneY = _level101[_loc3_].mc_ScrollBarRef._y;
  645.          mcScrollPane.setSize(iScrollPaneW - 1,iScrollPaneH - 2);
  646.          mcScrollPane._x = iScrollPaneX;
  647.          mcScrollPane._y = iScrollPaneY + 1;
  648.          var strTextFormat = new TextFormat();
  649.          strTextFormat.leftMargin = 7;
  650.          mcScrollPane.setScrollContent("mc_ScrollContent");
  651.          var _loc2_ = mcScrollPane.getScrollContent();
  652.          _loc2_.txt_Description.autoSize = true;
  653.          _loc2_.titleTxt.autoSize = true;
  654.          _loc2_.txt_Description.htmlText = strText;
  655.          _loc2_.txt_Description.setTextFormat(strTextFormat);
  656.          if(strTitle != null && strTitle != "")
  657.          {
  658.             _loc2_.createTextField("titleTxt",15000,0,0,0,0);
  659.             _loc1_.displayTitleText(_loc2_,strTitle);
  660.             if(_loc1_.c_strEnvironment == "Linux")
  661.             {
  662.                _loc2_.titleTxt.embedFonts = true;
  663.             }
  664.             _loc2_.titleTxt.autoSize = "left";
  665.             _loc2_.txt_Description._y = _loc2_.titleTxt.textHeight + 8;
  666.          }
  667.          mcScrollPane.refreshPane();
  668.          _loc1_.c_blnOnceMCQ4 = false;
  669.       }
  670.       _loc1_.initNext(_loc3_);
  671.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc3_;
  672.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  673.       _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[_loc3_],330,"MCQType_4",objSection,_loc1_.c_strSkill,false);
  674.       _loc1_.selectAndFreeze();
  675.    }
  676.    function displayTitleText(mcScrollContent, strTitle)
  677.    {
  678.       var _loc2_ = mcScrollContent;
  679.       var _loc1_ = new TextFormat();
  680.       _loc1_.font = "Verdana";
  681.       _loc1_.size = 11;
  682.       _loc1_.color = "0x000000";
  683.       _loc1_.align = "center";
  684.       _loc2_.titleTxt.autoSize = true;
  685.       _loc2_.titleTxt.html = true;
  686.       _loc2_.titleTxt.htmlText = strTitle;
  687.       _loc2_.titleTxt.multiline = true;
  688.       _loc2_.titleTxt.selectable = false;
  689.       _loc2_.titleTxt.text.autoSize = true;
  690.       _loc2_.titleTxt.setTextFormat(_loc1_);
  691.       false;
  692.    }
  693.    function initPairedMCQExtract()
  694.    {
  695.       var _loc2_ = this;
  696.       var strClipName = _loc2_.commonToAllQs();
  697.       _loc2_.commonToAllMCQs();
  698.       _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName;
  699.       var objSection = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo];
  700.       var objQuestion = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].question[_loc2_.c_iQuestionNo - 1];
  701.       var _loc3_ = Number(objQuestion.attributes.number);
  702.       var iTotalChoices = objQuestion.choice.length;
  703.       var iCorrectAnswer = objQuestion.attributes.correct;
  704.       _loc2_.initNext(strClipName);
  705.       _loc2_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],680,"PairedMCQExtract",objSection,_loc2_.c_strSkill,false,_loc3_);
  706.       if(_loc3_ % 2 == 0)
  707.       {
  708.          _loc2_.showSectionDataMCQ(_loc3_ - 1,_loc3_);
  709.       }
  710.       if(_loc3_ % 2 == 1)
  711.       {
  712.          _loc2_.showSectionDataMCQ(_loc3_,_loc3_ + 1);
  713.       }
  714.       if(!_loc2_.c_blnPairedMCQExtract)
  715.       {
  716.          _loc2_.c_blnPairedMCQExtract = true;
  717.       }
  718.       if(_loc2_.c_iPairID != null || _loc2_.c_iPairID != undefined)
  719.       {
  720.          if(_loc2_.c_iPairID != _loc2_.c_iPrevPairID || _loc2_.c_objNavigator.c_blnPartChange)
  721.          {
  722.             _loc2_.handleSound11();
  723.             var strSoundName = objSection.extract[_loc2_.c_iPairID].audio.data;
  724.             var strSound = "tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName;
  725.             _loc2_.c_objSoundController.setSoundFile(strSound);
  726.             _loc2_.c_iPrevPairID = _loc2_.c_iPairID;
  727.             _loc2_.c_objNavigator.c_blnPartChange = false;
  728.          }
  729.       }
  730.       if(_loc2_.c_strMode == "Review")
  731.       {
  732.          var queObj = objSection.question;
  733.          var _loc1_ = 0;
  734.          while(_loc1_ < queObj.length)
  735.          {
  736.             _level101.MCQ_Q1["ComponentMCQ_" + _loc1_].freeze(true);
  737.             _loc1_ = _loc1_ + 1;
  738.          }
  739.       }
  740.    }
  741.    function initPairedMCQScrolling()
  742.    {
  743.       var _loc2_ = this;
  744.       var strClipName = _loc2_.commonToAllQs();
  745.       _loc2_.commonToAllMCQs();
  746.       var objQuestion = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].question[_loc2_.c_iQuestionNo - 1];
  747.       var objSection = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo];
  748.       var iTotalChoices = objQuestion.choice.length;
  749.       var iCorrectAnswer = objQuestion.attributes.correct;
  750.       var iPairId = objQuestion.attributes.Pair;
  751.       var _loc3_ = Number(objQuestion.attributes.number);
  752.       _loc2_.initNext(strClipName);
  753.       _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName;
  754.       _loc2_.c_objHMObject = _loc2_.c_hQuestionState["get"](String(_loc2_.c_strSkill + "_" + _loc2_.c_iCurrQuestion));
  755.       _loc2_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],340,"PairedMCQScrolling",objSection,_loc2_.c_strSkill,false,_loc3_);
  756.       if(_loc2_.c_iPairID != null || _loc2_.c_iPairID != undefined)
  757.       {
  758.          if(_loc2_.c_iPairID != _loc2_.c_iPrevPairID)
  759.          {
  760.             _loc2_.c_blnPairedScrolling = true;
  761.             _loc2_.c_iPrevPairID = _loc2_.c_iPairID;
  762.          }
  763.       }
  764.       if(_loc3_ % 2 == 0)
  765.       {
  766.          _loc2_.showSectionDataMCQ(_loc3_ - 1,_loc3_);
  767.       }
  768.       if(_loc3_ % 2 == 1)
  769.       {
  770.          _loc2_.showSectionDataMCQ(_loc3_,_loc3_ + 1);
  771.       }
  772.       if(_loc2_.c_strMode == "Review")
  773.       {
  774.          var _loc1_ = 1;
  775.          while(_loc1_ <= 2)
  776.          {
  777.             _level101.MCQ_Q1["ComponentMCQ_" + _loc1_].freeze(true);
  778.             _loc1_ = _loc1_ + 1;
  779.          }
  780.       }
  781.    }
  782.    function showSectionDataMCQ(iFirstQues, iLastQues)
  783.    {
  784.       var iQuesCount = iLastQues - iFirstQues + 1;
  785.       var _loc3_ = iFirstQues;
  786.       var _loc2_ = 0;
  787.       while(_loc2_ < iQuesCount)
  788.       {
  789.          var _loc1_ = this.c_hQuestionState["get"](String(this.c_strSkill + "_" + _loc3_));
  790.          if(_loc1_.attempted != null || _loc1_.attempted != undefined)
  791.          {
  792.             _level101.MCQ_Q1["ComponentMCQ_" + (_loc2_ + 1)].setSelect(String(_loc1_.attempted));
  793.          }
  794.          _loc3_ = _loc3_ + 1;
  795.          _loc2_ = _loc2_ + 1;
  796.       }
  797.    }
  798.    function initMCQTypeL4()
  799.    {
  800.       var _loc1_ = this;
  801.       var _loc2_ = _loc1_.commonToAllQs();
  802.       var iTotalQuestions = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question.length;
  803.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  804.       var strSoundName = objSection.audio.data;
  805.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  806.       if(!_loc1_.c_blnInitL4)
  807.       {
  808.          _loc1_.commonToAllMCQs();
  809.          _loc1_.handleSound11();
  810.          _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName);
  811.          _loc1_.c_blnInitL4 = true;
  812.       }
  813.       _loc1_.initNext(_loc2_);
  814.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  815.       var iTotalChoices = _loc3_.choice.length;
  816.       var iCorrectAnswer = _loc3_.attributes.correct;
  817.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  818.       _loc1_["c_objMCQ_1" + _loc1_.c_iQuestionNo].init(iTotalChoices,iCorrectAnswer,_loc3_,_level101[_loc2_],300,"4",objSection,_loc1_.c_strSkill,false);
  819.       if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null)
  820.       {
  821.          _level101["MCQ_Q_1" + _loc1_.c_iQuestionNo].setSelect(String(_loc1_.c_objHMObject.attempted));
  822.       }
  823.       if(_loc1_.c_strMode == "Review")
  824.       {
  825.          _level101["MCQ_Q_1" + _loc1_.c_iQuestionNo].freeze(true);
  826.       }
  827.    }
  828.    function initMCQType5()
  829.    {
  830.       var _loc1_ = this;
  831.       var _loc2_ = _loc1_.commonToAllQs();
  832.       _loc1_.commonToAllMCQs();
  833.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  834.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  835.       var iTotalChoices = _loc3_.choice.length;
  836.       var iCorrectAnswer = _loc3_.attributes.correct;
  837.       if(_loc1_.c_blnOnceMCQ5)
  838.       {
  839.          var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].title;
  840.          var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].text.data;
  841.          _loc1_.c_objFIB2 = new com.screen.FIB2();
  842.          _loc1_.c_objFIB2.init(_level101[_loc2_],strTitle,strText,500,294.6,10,"fibbox","Button",1,_loc1_.c_objNavigator);
  843.          _loc1_.c_blnOnceMCQ5 = false;
  844.       }
  845.       _loc1_.c_objFIB2.navBtnClicked(_loc1_.c_iQuestionNo - 1);
  846.       _loc1_.initNext(_loc2_);
  847.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  848.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  849.       _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,_loc3_,_level101[_loc2_],195.9,"MCQType_5",objSection,_loc1_.c_strSkill,false);
  850.       _loc1_.selectAndFreeze();
  851.       if(_loc1_.c_strMode == "Review")
  852.       {
  853.          _loc1_.c_objFIB2.freeze(true);
  854.       }
  855.    }
  856.    function initMCQType7()
  857.    {
  858.       var _loc1_ = this;
  859.       var strClipName = _loc1_.commonToAllQs();
  860.       _loc1_.commonToAllMCQs();
  861.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question;
  862.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  863.       var iTotalChoices = objQuestion.text.length;
  864.       var iCorrectAnswer = objQuestion.attributes.correct;
  865.       if(_loc1_.c_blnOnceMCQ7)
  866.       {
  867.          _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.type = "dynamic";
  868.          _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.selectable = false;
  869.          _loc1_.c_blnOnceMCQ7 = false;
  870.       }
  871.       _loc1_.initNext(strClipName);
  872.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName;
  873.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  874.       _level101.FIBType_3.mc_ScrollContent.txt_wordLimit.text = objSection.attributes.rubricLimit;
  875.       _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],214,"FIBType_3",objSection,_loc1_.c_strSkill,false);
  876.       _loc1_.c_objMCQ.resetMcq7();
  877.       if(_loc1_.c_strMode != "Review")
  878.       {
  879.          _loc1_.c_objMCQ.displayPreviousSelection();
  880.       }
  881.       if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null && _loc1_.c_objHMObject != "")
  882.       {
  883.          if(_loc1_.c_objHMObject.answeroption != null && _loc1_.c_objHMObject.answeroption != undefined && _loc1_.c_objHMObject.answeroption != "")
  884.          {
  885.             _level101.MCQ_Q1.setSelect(String(_loc1_.c_objHMObject.answeroption - 1));
  886.             var mcScrollContent = _level101.MCQ_Q1.mc_ScrollPane.getScrollContent();
  887.             _level101.txt_Tracer.text += mcScrollContent["mc_MCQ7Choice" + (_loc1_.c_objHMObject.answeroption - 1)].mc_textcont;
  888.             var _loc3_ = 1;
  889.             while(_loc3_ <= iTotalChoices)
  890.             {
  891.                mcScrollContent["mc_MCQ7Choice" + _loc3_].mc_textcont.gotoAndStop("_desel");
  892.                _loc3_ = _loc3_ + 1;
  893.             }
  894.             mcScrollContent["mc_MCQ7Choice" + (_loc1_.c_objHMObject.answeroption - 1)].mc_textcont.gotoAndStop("_sel");
  895.          }
  896.          if(_loc1_.c_objHMObject.attempted != null && _loc1_.c_objHMObject.attempted != undefined && _loc1_.c_objHMObject.attempted != "")
  897.          {
  898.             if(_level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.maxscroll > 1)
  899.             {
  900.                _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar._visible = true;
  901.                _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar1._visible = true;
  902.             }
  903.             _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.type = "input";
  904.          }
  905.       }
  906.       if(_loc1_.c_strMode == "Review")
  907.       {
  908.          _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.text = "";
  909.          _level101.FIBType_3.mc_ScrollContent.dyntxt_WC._visible = false;
  910.          _level101.FIBType_3.mc_ScrollContent.txt_Statement._visible = false;
  911.          _level101.FIBType_3.mc_ScrollContent.txt_wordLimit._visible = false;
  912.          _level101.FIBType_3.mc_ScrollContent.txt_WCHeading._visible = false;
  913.          var _iCurrentOptionID = Number(_loc1_.c_objHMObject.answeroption);
  914.          var _strSaparator = "";
  915.          _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar1._visible = true;
  916.          if(_level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.maxscroll > 2 || _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.scroll > 1)
  917.          {
  918.             _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar._visible = true;
  919.          }
  920.          _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.html = true;
  921.          _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.selectable = false;
  922.          var tempBoolean = false;
  923.          var _loc2_ = 0;
  924.          while(_loc2_ <= iTotalChoices - 1)
  925.          {
  926.             if(_loc1_.c_objHMObject.attempted != null || _loc1_.c_objHMObject.attempted != undefined)
  927.             {
  928.                if(!tempBoolean)
  929.                {
  930.                   _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText = _loc1_.c_objHMObject.attempted;
  931.                   tempBoolean = true;
  932.                }
  933.                _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText += "<br/><b>Sample Answer -- " + (_loc2_ + 2) + "</b>" + "<br/><br/>" + unescape(objQuestion.sampleAnswer[_loc2_].data) + "<br/>";
  934.                var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" ");
  935.             }
  936.             else
  937.             {
  938.                _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText += "<b>Sample Answer --" + (_loc2_ + 2) + "</b><br/><br/>" + objQuestion.sampleAnswer[_loc2_].data + "<br/><br/>";
  939.             }
  940.             _loc2_ = _loc2_ + 1;
  941.          }
  942.          _level101.MCQ_Q1.freeze(true);
  943.          _loc1_.c_objWordCountText.freeze();
  944.       }
  945.       if(_loc1_.c_strMode == "Continue")
  946.       {
  947.          _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText = _loc1_.c_objHMObject.attempted;
  948.          var txtBox = _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.text;
  949.          if(_level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.maxscroll > 2 || _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.scroll > 1)
  950.          {
  951.             _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar._visible = true;
  952.          }
  953.          if(_loc1_.c_objHMObject.attempted != null || _loc1_.c_objHMObject.attempted != undefined)
  954.          {
  955.             var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" ");
  956.             var ctr = 0;
  957.             _loc3_ = 0;
  958.             while(_loc3_ < _arrSplitedspace.length)
  959.             {
  960.                if(_arrSplitedspace[_loc3_] != "")
  961.                {
  962.                   ctr += 1;
  963.                }
  964.                _loc3_ = _loc3_ + 1;
  965.             }
  966.             _level101.FIBType_3.mc_ScrollContent.dyntxt_WC.text = ctr.toString();
  967.             _level101.FIBType_3.mc_ScrollContent.dyntxt_WC.selectable = false;
  968.          }
  969.          else
  970.          {
  971.             _level101.FIBType_3.mc_ScrollContent.dyntxt_WC.text = 0;
  972.          }
  973.          var strLen = String(_loc1_.c_objHMObject.attempted).length;
  974.          Selection.setFocus();
  975.          Selection.setSelection(0,strLen);
  976.       }
  977.    }
  978.    function initMCQType8()
  979.    {
  980.       var _loc1_ = this;
  981.       var _loc2_ = _loc1_.commonToAllQs();
  982.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  983.       _loc1_.commonToAllMCQs();
  984.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  985.       var objQuestions = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question;
  986.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  987.       var iTotalChoices = _loc3_.choices.length;
  988.       var iCorrectAnswer = _loc3_.attributes.correct;
  989.       if(_loc1_.c_blnOnceMCQ8)
  990.       {
  991.          _loc1_.c_objDropDown = new com.screen.DropDown();
  992.          _loc1_.c_objDropDown.init(_level101[_loc2_],objSection,400,294.6,10,"FComboBoxSymbol","Button",_loc1_.c_iPartNo,_loc1_.c_objNavigator);
  993.          _loc1_.c_blnOnceMCQ8 = false;
  994.       }
  995.       _level101[_loc2_].txt_QuestionNo.text = _loc3_.attributes.number;
  996.       _loc1_.initNext(_loc2_);
  997.       _loc1_.c_objDropDown.navBtnClicked(_loc1_.c_iQuestionNo - 1);
  998.       if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo)
  999.       {
  1000.          _level101[_loc2_].btn_Next._visible = false;
  1001.       }
  1002.    }
  1003.    function initFIB1(_strFibType, _strQuesSelected)
  1004.    {
  1005.       var _loc1_ = this;
  1006.       var _loc2_ = _loc1_.commonToAllQs();
  1007.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  1008.       var strTitle = objQuestion.text.data;
  1009.       var strText = objQuestion.text2.data;
  1010.       var objText = objQuestion.text2;
  1011.       var iQuesNumber;
  1012.       iQuesNumber = Number(_loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1].attributes.number);
  1013.       var _iX = 180;
  1014.       var _iY = 250;
  1015.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  1016.       _loc1_.c_objFIB2_1 = new com.screen.FIB2();
  1017.       _loc1_.c_objFIB2_1.init(_level101[_loc2_],"",strText,400,0,0,"mc_FIBquestion","textField",_loc1_.c_iPartNo);
  1018.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  1019.       var _loc3_ = new com.screen.FIB1();
  1020.       var firstBoxRefY = _loc1_.c_objFIB2_1.getFibRefY();
  1021.       _loc3_.init(_level101,iQuesNumber,_loc2_,_loc1_.c_objFIB2_1.getHeight(),_loc1_.c_objFIB2_1.getFibRefY(),objText,_loc1_.c_iPartNo,_loc1_);
  1022.       _loc1_.initNext(_loc2_);
  1023.       if(_loc1_.c_strMode == "Review")
  1024.       {
  1025.          _loc3_.c_objFIB.freeze();
  1026.       }
  1027.       if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null)
  1028.       {
  1029.          _loc3_.c_objFIB.c_txtInpRef.text = _loc1_.c_objHMObject.attempted;
  1030.          if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo)
  1031.          {
  1032.             _level101[_loc2_].btn_Next._visible = true;
  1033.          }
  1034.          else
  1035.          {
  1036.             _level101[_loc2_].btn_Next._visible = false;
  1037.          }
  1038.       }
  1039.       if(_loc1_.c_strMode == "Review")
  1040.       {
  1041.          if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo)
  1042.          {
  1043.             _level101[_loc2_].btn_Next._visible = true;
  1044.          }
  1045.          else
  1046.          {
  1047.             _level101[_loc2_].btn_Next._visible = false;
  1048.          }
  1049.       }
  1050.    }
  1051.    function initAutoFillFib()
  1052.    {
  1053.       var _loc1_ = this;
  1054.       var _loc2_ = _loc1_.commonToAllQs();
  1055.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  1056.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1];
  1057.       var strText = objQuestion.text.data;
  1058.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  1059.       _loc1_.c_objFIB2_1 = new com.screen.FIB2();
  1060.       _loc1_.c_objFIB2_1.init(_level101[_loc2_],"",strText,500,0,0,"mc_FIB_Answer","textField",_loc1_.c_iPartNo);
  1061.       var arrFib = _loc1_.c_objFIB2_1.getNumberOfBox();
  1062.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  1063.       var _loc3_ = new com.screen.AutoFillFib();
  1064.       _loc3_.init(_level101[_loc2_],objSection,objQuestion,_loc1_.c_objFIB2_1.getHeight(),arrFib,_loc1_);
  1065.       _loc1_.initNext(_loc2_);
  1066.       if(_loc1_.c_strMode == "Review")
  1067.       {
  1068.          _loc3_.freeze();
  1069.       }
  1070.       if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null)
  1071.       {
  1072.          _level101.txt_Tracer7.text += "TTTTTTTTTT APEND OBJECT";
  1073.          _loc3_.c_txtInpRef.text = _loc1_.c_objHMObject.attempted;
  1074.          _loc3_.c_txtInpRef_1.text = _loc1_.c_objHMObject.attempted;
  1075.          _loc3_.c_txtInpRef_2.text = _loc1_.c_objHMObject.attempted;
  1076.          if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo)
  1077.          {
  1078.             _level101[_loc2_].btn_Next._visible = true;
  1079.          }
  1080.          else
  1081.          {
  1082.             _level101[_loc2_].btn_Next._visible = false;
  1083.          }
  1084.       }
  1085.       if(_loc1_.c_strMode == "Review")
  1086.       {
  1087.          if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo)
  1088.          {
  1089.             _level101[_loc2_].btn_Next._visible = true;
  1090.          }
  1091.          else
  1092.          {
  1093.             _level101[_loc2_].btn_Next._visible = false;
  1094.          }
  1095.       }
  1096.    }
  1097.    function initWordCount()
  1098.    {
  1099.       var _loc1_ = this;
  1100.       var strClipName = _loc1_.commonToAllQs();
  1101.       var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question;
  1102.       _loc1_.c_objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  1103.       var maxWordLimit = Number(_loc1_.c_objSection.attributes.maxWords);
  1104.       _level101[strClipName].txt_wordLimit.text = _loc1_.c_objSection.attributes.rubricLimit;
  1105.       var strQuestionNo = _loc1_.c_iCurrQuestion;
  1106.       var strText = objQuestion.text.data;
  1107.       var headerText = objQuestion.headerText.data;
  1108.       var imageData = objQuestion.image.data;
  1109.       _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion));
  1110.       _loc1_.c_objWordCountText = new com.screen.WordCountText();
  1111.       _loc1_.c_objWordCountText.init(_level101[strClipName],strQuestionNo,strText,_loc1_,headerText,imageData,maxWordLimit);
  1112.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName;
  1113.       _loc1_.initNext(strClipName);
  1114.       if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null)
  1115.       {
  1116.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.text = _loc1_.c_objHMObject.attempted;
  1117.          var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" ");
  1118.          _level101[strClipName].btn_Next._visible = true;
  1119.          var _loc3_ = 0;
  1120.          var _loc2_ = 0;
  1121.          while(_loc2_ < _arrSplitedspace.length)
  1122.          {
  1123.             if(_arrSplitedspace[_loc2_] != "")
  1124.             {
  1125.                _loc3_ += 1;
  1126.             }
  1127.             _loc2_ = _loc2_ + 1;
  1128.          }
  1129.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.dyntxt_WC.text = _loc3_.toString();
  1130.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.dyntxt_WC.selectable = false;
  1131.          var strLen = _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.text;
  1132.          Selection.setFocus();
  1133.          Selection.setSelection(0,strLen.length);
  1134.       }
  1135.       if(_loc1_.c_strMode == "Review")
  1136.       {
  1137.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.dyntxt_WC._visible = false;
  1138.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.txt_wordLimit._visible = false;
  1139.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.txtFooter._visible = false;
  1140.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.headerWord._visible = false;
  1141.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.mc_bottomText._visible = false;
  1142.          var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" ");
  1143.          _loc1_.c_objWordCountText.freeze();
  1144.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.html = true;
  1145.          _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.htmlText = _loc1_.c_objHMObject.attempted + "\n\n<b>Sample Answer -- </b><br/><br/>" + objQuestion.sampleAnswer.data;
  1146.          if(_loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.textHeight > _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.height)
  1147.          {
  1148.             _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = true;
  1149.          }
  1150.          else
  1151.          {
  1152.             _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = false;
  1153.          }
  1154.       }
  1155.       if(_loc1_.c_strMode == "Continue")
  1156.       {
  1157.          if(_loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.textHeight > _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.height)
  1158.          {
  1159.             _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = true;
  1160.          }
  1161.          else
  1162.          {
  1163.             _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = false;
  1164.          }
  1165.       }
  1166.    }
  1167.    function initFIBType6()
  1168.    {
  1169.       var _loc2_ = this;
  1170.       var strClipName = _loc2_.commonToAllQs();
  1171.       var _loc3_ = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo];
  1172.       var strTitle = _loc3_.textTitle.data;
  1173.       var strText = _loc3_.text.data;
  1174.       var strSoundName = _loc3_.audio.data;
  1175.       _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName;
  1176.       if(!_loc2_.c_blnFIB4)
  1177.       {
  1178.          _loc2_.c_objFIB4 = new com.screen.FIB4();
  1179.          _loc2_.c_objFIB4.c_iExtID = _loc3_.question[0].attributes.number;
  1180.          var totalQuestion = _loc3_.question[0].attributes.totalQuestion;
  1181.          var _loc1_ = 0;
  1182.          while(_loc1_ < totalQuestion)
  1183.          {
  1184.             _loc2_.c_objFIB4.c_hintArray[_loc1_] = _loc3_.question[_loc1_].ansHint.data;
  1185.             _loc1_ = _loc1_ + 1;
  1186.          }
  1187.          _loc2_.c_objFIB4.init(_level101[strClipName],_loc3_," ",strText,470,14,10,"FComboBoxSymbol","MovieClip",_loc2_.c_iPartNo,_loc2_.c_objNavigator);
  1188.          _loc2_.handleSound11();
  1189.          _loc2_.c_blnFIB4 = true;
  1190.       }
  1191.       if(_loc2_.c_objNavigator.c_blnPartChange)
  1192.       {
  1193.          _loc2_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName);
  1194.          _loc2_.c_objNavigator.c_blnPartChange = false;
  1195.       }
  1196.       _loc2_.initNext(strClipName);
  1197.       _loc2_.c_objFIB4.navBtnClicked(_loc2_.c_iQuestionNo - 1);
  1198.    }
  1199.    function initMCQTypeL3()
  1200.    {
  1201.       var _loc1_ = this;
  1202.       var _loc3_ = _loc1_.commonToAllQs();
  1203.       var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  1204.       var strTitle = _loc2_.textTitle;
  1205.       var strText = _loc2_.text.data;
  1206.       var strSoundName = _loc2_.audio.data;
  1207.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc3_;
  1208.       if(!_loc1_.c_blnFIB3)
  1209.       {
  1210.          _loc1_.c_objFIB2_2 = new com.screen.FIB2();
  1211.          _loc1_.c_objFIB2_2.c_iExtID = _loc2_.question[0].attributes.number;
  1212.          _loc1_.c_objFIB2_2.init(_level101[_loc3_],strTitle,strText,470,14,10,"mc_FIBL","MovieClip",_loc1_.c_iPartNo,_loc1_.c_objNavigator);
  1213.          _loc1_.handleSound11();
  1214.          _loc1_.c_blnFIB3 = true;
  1215.       }
  1216.       if(_loc1_.c_objNavigator.c_blnPartChange)
  1217.       {
  1218.          _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName);
  1219.          _loc1_.c_objNavigator.c_blnPartChange = false;
  1220.       }
  1221.       _loc1_.initNext(_loc3_);
  1222.       _loc1_.c_objFIB2_2.navBtnClicked(_loc1_.c_iQuestionNo - 1);
  1223.    }
  1224.    function initUOEFIBType5()
  1225.    {
  1226.       var _loc1_ = this;
  1227.       var _loc2_ = _loc1_.commonToAllQs();
  1228.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  1229.       var strTitle = _loc3_.textTitle;
  1230.       var strText = _loc3_.text.data;
  1231.       var strSoundName = _loc3_.audio.data;
  1232.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  1233.       if(!_loc1_.c_blnUOEFIB3)
  1234.       {
  1235.          _loc1_.c_objUOEFIB3 = new com.screen.FIB2();
  1236.          _loc1_.c_objUOEFIB3.c_iExtID = _loc3_.question[0].attributes.number;
  1237.          _loc1_.c_objUOEFIB3.init(_level101[_loc2_],strTitle,strText,425,14,10,"mc_FIBL","MovieClip",_loc1_.c_iPartNo,_loc1_.c_objNavigator);
  1238.          _loc1_.c_blnUOEFIB3 = true;
  1239.       }
  1240.       _loc1_.initNext(_loc2_);
  1241.       _loc1_.c_objUOEFIB3.navBtnClicked(_loc1_.c_iQuestionNo - 1);
  1242.       if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo)
  1243.       {
  1244.          _level101[_loc2_].btn_Next._visible = false;
  1245.       }
  1246.    }
  1247.    function initPairedDropDown()
  1248.    {
  1249.       var _loc1_ = this;
  1250.       var _loc2_ = _loc1_.commonToAllQs();
  1251.       var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  1252.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  1253.       var strTitle = _loc3_.textTitle.data;
  1254.       var strText = _loc3_.text.data;
  1255.       var strSoundName = _loc3_.audio.data;
  1256.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  1257.       if(!_loc1_.c_blnPairedDropDown)
  1258.       {
  1259.          _loc1_.c_objPairedDropDown = new com.screen.PairedDropDown();
  1260.          _loc1_.c_objPairedDropDown.init(_level101[_loc2_],objSection,strTitle,strText,520,14,10,"FComboBoxSymbol","Button",_loc1_.c_iPartNo,_loc1_.c_objNavigator);
  1261.          _loc1_.c_blnPairedDropDown = true;
  1262.       }
  1263.       _loc1_.initNext(_loc2_);
  1264.       _loc1_.c_objPairedDropDown.navBtnClicked(_loc1_.c_iQuestionNo - 1);
  1265.       if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo)
  1266.       {
  1267.          _level101[_loc2_].btn_Next._visible = false;
  1268.       }
  1269.    }
  1270.    function initDDCollection()
  1271.    {
  1272.       var _loc1_ = this;
  1273.       var _loc2_ = _loc1_.commonToAllQs();
  1274.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo];
  1275.       var strSoundName = _loc3_.audio.data;
  1276.       _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_;
  1277.       if(!_loc1_.c_blnDDCollection)
  1278.       {
  1279.          _loc1_.c_objDDCollection = new com.screen.DropDownCollection();
  1280.          var totalQuestion = _loc3_.question[0].attributes.totalQuestion;
  1281.          _loc1_.c_objDDCollection.init(_level101[_loc2_],_loc3_,425,14,10,"FComboBoxSymbol",_loc1_.c_iPartNo,_loc1_.c_objNavigator);
  1282.          _loc1_.handleSound11();
  1283.          _loc1_.c_blnDDCollection = true;
  1284.       }
  1285.       var strSound = "tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName;
  1286.       if(_loc1_.c_objNavigator.c_blnPartChange)
  1287.       {
  1288.          _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName);
  1289.          _loc1_.c_objNavigator.c_blnPartChange = false;
  1290.       }
  1291.       _loc1_.initNext(_loc2_);
  1292.       _loc1_.c_objDDCollection.navBtnClicked(_loc1_.c_iQuestionNo - 1);
  1293.       if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo)
  1294.       {
  1295.          _level101[_loc2_].btn_Next._visible = false;
  1296.       }
  1297.    }
  1298.    function initFIBType5()
  1299.    {
  1300.       var _loc2_ = this;
  1301.       var strClipName = _loc2_.commonToAllQs();
  1302.       var _loc3_ = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo];
  1303.       var strTitle = _loc3_.textTitle;
  1304.       var strText = _loc3_.text.data;
  1305.       var strSoundName = _loc3_.audio.data;
  1306.       _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName;
  1307.       if(!_loc2_.c_blnFIB2_2)
  1308.       {
  1309.          _loc2_.c_objFIB3_1 = new com.screen.FIB3();
  1310.          _loc2_.c_objFIB3_1.c_iExtID = _loc3_.question[0].attributes.number;
  1311.          var totalQuestion = _loc3_.question[0].attributes.totalQuestion;
  1312.          _loc2_.c_objFIB3_1.exampleText = _loc3_.question[0].attributes.dummyText;
  1313.          var _loc1_ = 0;
  1314.          while(_loc1_ < totalQuestion)
  1315.          {
  1316.             _loc2_.c_objFIB3_1.c_hintArray[_loc1_] = _loc3_.question[_loc1_].ansHint.data;
  1317.             _loc1_ = _loc1_ + 1;
  1318.          }
  1319.          _loc2_.c_objFIB3_1.init(_level101[strClipName],strTitle,strText,425,14,10,"mc_FIBLarge","MovieClip",_loc2_.c_iPartNo,_loc2_.c_objNavigator);
  1320.          _loc2_.c_blnFIB2_2 = true;
  1321.       }
  1322.       _loc2_.initNext(strClipName);
  1323.       _loc2_.c_objFIB3_1.navBtnClicked(_loc2_.c_iQuestionNo - 1);
  1324.       if(_loc2_.c_objScreenData.DOC.section.length - 1 == _loc2_.c_iPartNo)
  1325.       {
  1326.          _level101[strClipName].btn_Next._visible = false;
  1327.       }
  1328.    }
  1329.    function arrangeButtons()
  1330.    {
  1331.       if(this.c_objSourceRef.c_blnXMLLoaded)
  1332.       {
  1333.       }
  1334.    }
  1335.    function appendQuesObject(_objQuesData)
  1336.    {
  1337.       var _loc1_ = this;
  1338.       _loc1_.c_hQuestionState.put(String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion),_objQuesData);
  1339.       if(_loc1_.c_hQuestionState.getlength() == _loc1_.getTotalTestQuestions())
  1340.       {
  1341.          if(_loc1_.c_strMode != "Review")
  1342.          {
  1343.             _level101.btn_quitTest._visible = false;
  1344.             _level101.btn_submitTest._visible = true;
  1345.          }
  1346.       }
  1347.    }
  1348.    function removeQuesObject()
  1349.    {
  1350.       var _loc1_ = this;
  1351.       var _loc2_ = String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion);
  1352.       _loc1_.c_hQuestionState.deleteKey(_loc2_);
  1353.       _level101.btn_quitTest._visible = true;
  1354.       _level101.btn_submitTest._visible = false;
  1355.    }
  1356.    function onPartChange(_iPrePart, _iCurrPart)
  1357.    {
  1358.       var _loc1_ = this;
  1359.       _loc1_.c_objNavigator.setTopNavPosition();
  1360.       var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.templateType;
  1361.       if(_loc2_ == "PairedDropDown" || _loc2_ == "MCQType_4")
  1362.       {
  1363.          _level101.PairedDropDown.mc_textOnlyScrollBar.setScrollPosition(0,0);
  1364.          _loc1_.c_blnOnceMCQ4 = true;
  1365.          _loc1_.c_blnPairedScrolling = true;
  1366.       }
  1367.       _level101.mc_Nav._y = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.navYPos;
  1368.       var strPreviousTemplate = _loc1_.c_objScreenData.DOC.section[_iPrePart].attributes.templateType;
  1369.       switch(strPreviousTemplate)
  1370.       {
  1371.          case "UOEFIBType_5":
  1372.             _loc1_.c_objUOEFIB3.removedMovieObject();
  1373.             break;
  1374.          case "FIBType_5":
  1375.             _loc1_.c_objFIB3_1.removedMovieObject();
  1376.             break;
  1377.          case "FIBType_1":
  1378.             _loc1_.c_objFIB2_1.removedMovieObject();
  1379.             break;
  1380.          case "AutoFillFib":
  1381.             _loc1_.c_objFIB2_1.removedMovieObject();
  1382.             break;
  1383.          case "FIBType_4":
  1384.             _loc1_.c_objFIB2_2.removedMovieObject();
  1385.             break;
  1386.          case "FIBType_6":
  1387.             _loc1_.c_objFIB4.removedMovieObject();
  1388.       }
  1389.       var strClip = _loc1_.c_arrQuestionTypes[_iPrePart];
  1390.       _level101[strClip]._visible = false;
  1391.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.navType;
  1392.       if(_loc1_.c_strSkillName.toLowerCase() == "listening" && _loc3_ == "2")
  1393.       {
  1394.          var strSoundName = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].audio.data;
  1395.          _loc1_.handleSound11();
  1396.          _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName);
  1397.       }
  1398.       else
  1399.       {
  1400.          _level101[_loc1_.c_arrQuestionTypes[_iCurrPart]]._visible = true;
  1401.       }
  1402.    }
  1403.    function setFirstUnattemptedL(_objNavData)
  1404.    {
  1405.       var _loc1_ = this;
  1406.       if(!_loc1_.c_blnContinueL)
  1407.       {
  1408.          var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question;
  1409.          var _iQPartTwo = objQuestion[0].attributes.number;
  1410.          if(_loc1_.c_iStartQuestion >= _iQPartTwo)
  1411.          {
  1412.             var _loc2_ = 0;
  1413.             while(_loc2_ < objQuestion.length)
  1414.             {
  1415.                var _loc3_ = Number(objQuestion[_loc2_].attributes.number);
  1416.                if(_loc3_ == _loc1_.c_iStartQuestion)
  1417.                {
  1418.                   _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd;
  1419.                   _loc1_.c_objNavigator.c_strSelecetd = "_" + _loc1_.c_iPartNo + "_" + _loc2_;
  1420.                   _loc1_.c_objNavigator.c_iSeleID = _loc1_.c_iStartQuestion;
  1421.                   _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------     ";
  1422.                   _loc1_.c_objNavigator.navClickedfunction();
  1423.                   break;
  1424.                }
  1425.                _loc2_ = _loc2_ + 1;
  1426.             }
  1427.          }
  1428.          else
  1429.          {
  1430.             _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd;
  1431.             _loc1_.c_objNavigator.c_strSelecetd = _objNavData.navCurrSel;
  1432.             _loc1_.c_objNavigator.c_iSeleID = _objNavData.navSelID;
  1433.             _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------     ";
  1434.             _loc1_.c_objNavigator.navClickedfunction();
  1435.          }
  1436.          _loc1_.c_blnContinueL = true;
  1437.       }
  1438.       else
  1439.       {
  1440.          _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd;
  1441.          _loc1_.c_objNavigator.c_strSelecetd = _objNavData.navCurrSel;
  1442.          _loc1_.c_objNavigator.c_iSeleID = _objNavData.navSelID;
  1443.          _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------     ";
  1444.          _loc1_.c_objNavigator.navClickedfunction();
  1445.       }
  1446.    }
  1447.    function setMCQSelection(_mcChoice)
  1448.    {
  1449.       var _loc1_ = this;
  1450.       var _loc2_ = Number(_mcChoice._name.split("_")[2]);
  1451.       var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question;
  1452.       _loc1_.resetPanelState();
  1453.       _mcChoice.gotoAndStop("_SELECTED");
  1454.       _loc1_.c_iQuestionNo = _loc2_;
  1455.       if(_loc1_.c_strMode == "Take" || _loc1_.c_strMode == "Retake" || _loc1_.c_strMode == "Continue")
  1456.       {
  1457.          _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd;
  1458.          _loc1_.c_objNavigator.c_strSelecetd = "_" + _loc1_.c_iPartNo + "_" + (_loc2_ - 1);
  1459.          _loc1_.c_objNavigator.c_iSeleID = _loc3_[_loc1_.c_iQuestionNo - 1].attributes.number;
  1460.          _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------     ";
  1461.          _loc1_.c_objNavigator.navClickedfunction();
  1462.       }
  1463.    }
  1464.    function updateHeader(_str)
  1465.    {
  1466.       var _loc1_ = new TextFormat();
  1467.       _loc1_.bold = true;
  1468.       var _loc2_ = String(this.c_objScreenData.DOC.section[this.c_iPartNo].attributes.header + " Test" + ": " + _str);
  1469.       _level101.txt_Screenheader.html = true;
  1470.       _level101.txt_Screenheader.htmlText = _loc2_;
  1471.       _level101.txt_Screenheader.setTextFormat(_loc1_);
  1472.    }
  1473.    function setEvents()
  1474.    {
  1475.       var _loc1_ = this;
  1476.       if(_loc1_.c_strMode == "Review")
  1477.       {
  1478.          _level101.btn_Instruction._visible = false;
  1479.       }
  1480.       else
  1481.       {
  1482.          _level101.btn_Instruction._visible = true;
  1483.       }
  1484.       _level101.btn_quitTest.objRef = _loc1_;
  1485.       _level101.btn_quitTest.onRelease = function()
  1486.       {
  1487.          var _loc1_ = this;
  1488.          if(_loc1_.objRef.c_strEnvironment == "Windows" || _loc1_.objRef.c_strEnvironment == "Macintosh")
  1489.          {
  1490.             _loc1_.objRef.btn_quitTest();
  1491.          }
  1492.          else if(_loc1_.objRef.c_strEnvironment == "Linux")
  1493.          {
  1494.             _loc1_.objRef.popupNo();
  1495.          }
  1496.       };
  1497.       _level101.btn_submitTest.objRef = _loc1_;
  1498.       _level101.btn_submitTest.onRelease = function()
  1499.       {
  1500.          this.objRef.btn_submitTest();
  1501.       };
  1502.       _level101.btn_backToMenu.objRef = _loc1_;
  1503.       _level101.btn_backToMenu.enabled = true;
  1504.       _level101.btn_backToMenu.onRelease = function()
  1505.       {
  1506.          this.objRef.backToTestMenu();
  1507.       };
  1508.       _level101.btn_quit.objRef = _loc1_;
  1509.       _level101.btn_quit.onRelease = function()
  1510.       {
  1511.          this.objRef.btn_quit();
  1512.       };
  1513.       _level101.btn_Instruction.objRef = _loc1_;
  1514.       _level101.btn_Instruction.onRelease = function()
  1515.       {
  1516.          this.objRef.showInstruction();
  1517.       };
  1518.    }
  1519.    function btn_quit()
  1520.    {
  1521.       var _loc1_ = this;
  1522.       var strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
  1523.       _loc1_.removeElements();
  1524.       var _loc2_ = function(success)
  1525.       {
  1526.          if(strEnvironment == "Windows" || strEnvironment == "Macintosh")
  1527.          {
  1528.             getUrl("lingo:closeApplication", "");
  1529.          }
  1530.          else if(strEnvironment == "Linux")
  1531.          {
  1532.             fscommand("quit");
  1533.          }
  1534.       };
  1535.       if(_loc1_.c_strEnvironment == "Windows" || _loc1_.c_strEnvironment == "Macintosh")
  1536.       {
  1537.          _loc1_.connectXMLSocket("true",_loc1_.objTimer.getMinsTime(),_loc2_);
  1538.       }
  1539.       else if(_loc1_.c_strEnvironment == "Linux")
  1540.       {
  1541.          _loc2_();
  1542.       }
  1543.    }
  1544.    function showInstruction()
  1545.    {
  1546.       var _loc3_ = this;
  1547.       _level101.attachMovie("mc_PopupInstruction","mc_PopupInstruction",650);
  1548.       var _loc1_ = _level101.mc_PopupInstruction;
  1549.       var _txtInstruction = _loc1_.mc_text.txt_inst;
  1550.       var _loc2_ = undefined;
  1551.       _loc1_._x = 175;
  1552.       _loc1_._y = 160;
  1553.       _loc1_.btn_CloseInstruction.onRelease = function()
  1554.       {
  1555.          this._parent._visible = false;
  1556.       };
  1557.       _loc1_.btn_Disable.onRelease = function()
  1558.       {
  1559.          trace("");
  1560.       };
  1561.       _loc1_.btn_Disable.onRollOver = function()
  1562.       {
  1563.          this.useHandCursor = false;
  1564.       };
  1565.       var _objInstructionXML = com.controller.UICoordinator.getInstance().c_objInstructionXML;
  1566.       if(_loc3_.c_strSkill.toLowerCase() == "listening")
  1567.       {
  1568.          _loc2_ = _objInstructionXML.instructions.instructionslistening.data;
  1569.       }
  1570.       else if(_loc3_.c_strSkill.toLowerCase() == "reading")
  1571.       {
  1572.          _loc2_ = _objInstructionXML.instructions.instructionsreading.data;
  1573.       }
  1574.       else if(_loc3_.c_strSkill.toLowerCase() == "writing")
  1575.       {
  1576.          _loc2_ = _objInstructionXML.instructions.instructionswriting.data;
  1577.       }
  1578.       else if(_loc3_.c_strSkill.toLowerCase() == "use of english")
  1579.       {
  1580.          _loc2_ = _objInstructionXML.instructions.instructionsuseofenglish.data;
  1581.       }
  1582.       _txtInstruction.html = true;
  1583.       _txtInstruction.htmlText = _loc2_;
  1584.       _loc1_._visible = true;
  1585.    }
  1586.    function removeElements()
  1587.    {
  1588.       var _loc2_ = this;
  1589.       _level101.rubricBox._visible = false;
  1590.       var _loc1_ = 0;
  1591.       while(_loc1_ < _loc2_.c_arrQuestionTypes.length)
  1592.       {
  1593.          _level101[_loc2_.c_arrQuestionTypes[_loc1_]].removeMovieClip();
  1594.          _level101.soundBtn._visible = false;
  1595.          _level101.volumeBox._visible = false;
  1596.          _level101.soundLevel._visible = false;
  1597.          _loc1_ = _loc1_ + 1;
  1598.       }
  1599.    }
  1600.    function btn_quitTest()
  1601.    {
  1602.       var _loc2_ = this;
  1603.       var _loc1_ = _level101.mc_PopUp;
  1604.       _loc1_.gotoAndStop("quittest");
  1605.       _loc1_._x = 173.5;
  1606.       _loc1_._y = 155.5;
  1607.       var iTotalAttemptedQues = _loc2_.c_hQuestionState.getlength();
  1608.       var iRemainingQues = _loc2_.c_iTotalTestQuestions - iTotalAttemptedQues;
  1609.       _loc1_.txt_leftQues.text = iRemainingQues;
  1610.       _loc1_.txt_QuitTest.autoSize = true;
  1611.       if(_loc2_.c_strSkill == "writing")
  1612.       {
  1613.          _loc1_.txt_QuitTest.text = "You have not answered          questions\nand have          minute(s) remaining.\nIn this section your answers are not scored.\nDo you want to complete this test later?";
  1614.       }
  1615.       else
  1616.       {
  1617.          _loc1_.txt_QuitTest.text = "You have not answered          questions\nand have          minute(s) remaining.\nDo you want to complete this test later?";
  1618.       }
  1619.       _loc1_.txt_QuitTest.autoSize = true;
  1620.       var _loc3_ = 0;
  1621.       _loc3_ = _loc2_.objTimer.getSecTime();
  1622.       _loc1_.txt_timeRemain.text = Math.floor(_loc3_);
  1623.       _loc1_.popupYes.objRef = _loc2_;
  1624.       _loc1_.popupYes.onRelease = function()
  1625.       {
  1626.          this.objRef.popupYes();
  1627.       };
  1628.       _loc1_.popupYes.onRollOver = function()
  1629.       {
  1630.          this.gotoAndStop("OVER");
  1631.       };
  1632.       _loc1_.popupYes.onRollOut = _loc1_.popupYes.onReleaseOutside = function()
  1633.       {
  1634.          this.gotoAndStop("UP");
  1635.       };
  1636.       _loc1_.popupNo.objRef = _loc2_;
  1637.       _loc1_.popupNo.onRelease = function()
  1638.       {
  1639.          this.objRef.popupNo();
  1640.       };
  1641.       _loc1_.popupNo.onRollOver = function()
  1642.       {
  1643.          this.gotoAndStop("OVER");
  1644.       };
  1645.       _loc1_.popupNo.onRollOut = _loc1_.popupNo.onReleaseOutside = function()
  1646.       {
  1647.          this.gotoAndStop("UP");
  1648.       };
  1649.       _loc1_.btn_CloseQuitTestDialog.objRef = _loc2_;
  1650.       _loc1_.btn_CloseQuitTestDialog.onRelease = function()
  1651.       {
  1652.          this._parent.gotoAndStop("blank");
  1653.       };
  1654.    }
  1655.    function getScore()
  1656.    {
  1657.       var iscore = 0;
  1658.       var _iTotalQuestion = this.getTotalTestQuestions();
  1659.       var _loc1_ = 0;
  1660.       while(_loc1_ < _iTotalQuestion)
  1661.       {
  1662.          var _loc3_ = String(this.c_strSkill.toLowerCase() + "_" + (_loc1_ + 1));
  1663.          var _loc2_ = this.c_hQuestionState["get"](_loc3_);
  1664.          if(_loc2_ != null && _loc2_ != undefined)
  1665.          {
  1666.             var blnCorrect = _loc2_.correct;
  1667.             iscore += Number(blnCorrect);
  1668.          }
  1669.          _loc1_ = _loc1_ + 1;
  1670.       }
  1671.       return iscore;
  1672.    }
  1673.    function initResultScreen()
  1674.    {
  1675.       var c_objUICoodInstance = com.controller.UICoordinator.getInstance();
  1676.       var iTotalSections = this.c_objScreenData.DOC.section.length;
  1677.       var _loc3_ = new Object();
  1678.       _loc3_.iscore = this.getScore();
  1679.       if(iTotalSections == undefined || iTotalSections == null || iTotalSections == "")
  1680.       {
  1681.          var _loc2_ = this.c_objScreenData.DOC.section.question.length;
  1682.          if(_loc2_ == undefined || _loc2_ == null || _loc2_ == "")
  1683.          {
  1684.             _loc3_.iTotalNumberQuestions = this.c_objScreenData.DOC.section.attributes.maxMark;
  1685.          }
  1686.          else
  1687.          {
  1688.             _loc3_.iTotalNumberQuestions = this.c_objScreenData.DOC.section.attributes.maxMark * _loc2_;
  1689.          }
  1690.       }
  1691.       else
  1692.       {
  1693.          var _loc1_ = 0;
  1694.          while(_loc1_ < iTotalSections)
  1695.          {
  1696.             _loc2_ = this.c_objScreenData.DOC.section[_loc1_].question.length;
  1697.             if(_loc2_ == undefined || _loc2_ == null || _loc2_ == "")
  1698.             {
  1699.                _loc3_.iTotalNumberQuestions += this.c_objScreenData.DOC.section[_loc1_].attributes.maxMark * 1;
  1700.             }
  1701.             else
  1702.             {
  1703.                _loc3_.iTotalNumberQuestions += this.c_objScreenData.DOC.section[_loc1_].attributes.maxMark * _loc2_;
  1704.             }
  1705.             _loc1_ = _loc1_ + 1;
  1706.          }
  1707.       }
  1708.       _loc3_.iTimeTaken = this.objTimer.getMinsTime() + " min(s)";
  1709.       _loc3_.strTestNum = this.c_objScreenData.DOC.section[this.c_iPartNo].attributes.test;
  1710.       com.controller.UICoordinator.getInstance().c_objScreenFactory.resultInstance.populateResult(_loc3_,this.c_strSkill);
  1711.       _level101.result.testMenu.objRef = this;
  1712.       _level101.result.testMenu.onRelease = function()
  1713.       {
  1714.          this.objRef.backToTestMenu();
  1715.       };
  1716.       _level101.btn_quitTest._visible = false;
  1717.       _level101.btn_quitTest._visible = false;
  1718.       _level101.btn_quitTest._visible = false;
  1719.    }
  1720.    function btn_submitTest()
  1721.    {
  1722.       var _objRef = this;
  1723.       this.removeElements();
  1724.       var _loc3_ = _objRef.objTimer.getMinsTime();
  1725.       var _loc2_ = function(success)
  1726.       {
  1727.          var _loc1_ = com.controller.UICoordinator.getInstance();
  1728.          _loc1_.doAction("SHOWRESULT","");
  1729.          _objRef.initResultScreen();
  1730.          _objRef.c_objNavigator.destroyNav();
  1731.          _objRef.c_objSoundController.killSoundController();
  1732.          _objRef.c_objVolumeController.killVolumeController();
  1733.          _objRef.objTimer.destroyTimer();
  1734.          _level101.btn_submitTest._visible = false;
  1735.          _objRef.onPartChange(Number(_objRef.c_strSelected.split("_")[1]));
  1736.       };
  1737.       this.connectXMLSocket("true",_loc3_,_loc2_);
  1738.    }
  1739.    function backToTestMenu()
  1740.    {
  1741.       var _loc1_ = this;
  1742.       _level101.btn_backToMenu.enabled = false;
  1743.       _loc1_.removeElements();
  1744.       _level101.result.removeMovieClip();
  1745.       com.controller.UICoordinator.getInstance().volumeLevel = String(_loc1_.c_objVolumeController.getLevel());
  1746.       _loc1_.c_objNavigator.destroyNav();
  1747.       _loc1_.c_objSoundController.killSoundController();
  1748.       _loc1_.c_objVolumeController.killVolumeController();
  1749.       _loc1_.objTimer.destroyTimer();
  1750.       var _loc2_ = com.controller.UICoordinator.getInstance();
  1751.       _loc2_.doAction("TestXML","_objData");
  1752.    }
  1753.    function popupYes()
  1754.    {
  1755.       var _loc1_ = this;
  1756.       _loc1_.removeElements();
  1757.       _level101.mc_PopUp.gotoAndStop("blank");
  1758.       var _loc2_ = 0;
  1759.       _loc2_ = _loc1_.objTimer.getSecTime();
  1760.       _loc2_ = Math.round(_loc2_);
  1761.       com.controller.UICoordinator.getInstance().volumeLevel = String(_loc1_.c_objVolumeController.getLevel());
  1762.       _loc1_.c_objNavigator.destroyNav();
  1763.       _loc1_.c_objSoundController.killSoundController();
  1764.       _loc1_.c_objVolumeController.killVolumeController();
  1765.       _loc1_.onPartChange(Number(_loc1_.c_strSelected.split("_")[1]));
  1766.       _loc1_.objTimer.destroyTimer();
  1767.       var _loc3_ = function(success)
  1768.       {
  1769.          var _loc1_ = com.controller.UICoordinator.getInstance();
  1770.          _loc1_.doAction("TestXML","");
  1771.       };
  1772.       if(_loc1_.c_strEnvironment == "Windows" || _loc1_.c_strEnvironment == "Macintosh")
  1773.       {
  1774.          _loc1_.connectXMLSocket("false",_loc2_,_loc3_);
  1775.       }
  1776.       else if(_loc1_.c_strEnvironment == "Linux")
  1777.       {
  1778.          _loc3_();
  1779.       }
  1780.    }
  1781.    function popupNo()
  1782.    {
  1783.       var _loc1_ = this;
  1784.       _loc1_.removeElements();
  1785.       _level101.mc_PopUp.gotoAndStop("blank");
  1786.       _level101.btn_submitTest._visible = false;
  1787.       com.controller.UICoordinator.getInstance().volumeLevel = String(_loc1_.c_objVolumeController.getLevel());
  1788.       _loc1_.c_objNavigator.destroyNav();
  1789.       _loc1_.c_objSoundController.killSoundController();
  1790.       _loc1_.c_objVolumeController.killVolumeController();
  1791.       _loc1_.onPartChange(Number(_loc1_.c_strSelected.split("_")[1]));
  1792.       _loc1_.objTimer.destroyTimer();
  1793.       var objRef = _loc1_;
  1794.       var _loc3_ = function(success)
  1795.       {
  1796.          var _loc1_ = com.controller.UICoordinator.getInstance();
  1797.          _loc1_.doAction("SHOWRESULT","");
  1798.          objRef.initResultScreen();
  1799.       };
  1800.       _loc1_.connectXMLSocket("true",_loc1_.objTimer.getMinsTime(),_loc3_);
  1801.    }
  1802.    function connectXMLSocket(_status, _time, fnCallback)
  1803.    {
  1804.       var _loc1_ = this;
  1805.       var objXML = new com.data.OTOXML();
  1806.       var strSocketdata = objXML.getXMLString(_loc1_.c_hQuestionState,_loc1_.c_strSkill,_loc1_.c_iTotalTestQuestions);
  1807.       var strFileName = com.controller.UICoordinator.getInstance().currentTestName;
  1808.       var strUserName = com.controller.UICoordinator.getInstance().userASCIIName;
  1809.       var objThis = _loc1_;
  1810.       var fnWriteScoreFile = function(success)
  1811.       {
  1812.          if(success)
  1813.          {
  1814.             var strResult = objXML.getResultXmlString(_status,_time,objThis.c_iTotalTestQuestions);
  1815.             var _loc3_ = com.controller.UICoordinator.getInstance().convertToASCII("_s".toString());
  1816.             var strFileName = com.controller.UICoordinator.getInstance().currentTestName;
  1817.             var _loc2_ = strFileName + _loc3_;
  1818.             var fnWriteUserFile = function(blnsuccess)
  1819.             {
  1820.                if(blnsuccess)
  1821.                {
  1822.                   var _loc1_ = objThis.createRecordXML(strFileName);
  1823.                   if(this.c_strEnvironment == "Linux")
  1824.                   {
  1825.                      objThis.storeRecord(_loc1_,fnCallback);
  1826.                   }
  1827.                }
  1828.                else
  1829.                {
  1830.                   fnCallback.call(objThis,false);
  1831.                }
  1832.             };
  1833.             var _loc1_ = undefined;
  1834.             if(objThis.c_strMode == "Take")
  1835.             {
  1836.                _loc1_ = fnWriteUserFile;
  1837.             }
  1838.             else
  1839.             {
  1840.                _loc1_ = fnCallback;
  1841.             }
  1842.             if(this.c_strEnvironment == "Linux")
  1843.             {
  1844.                objThis.writeTestData(_loc2_,strResult,_loc1_);
  1845.             }
  1846.          }
  1847.          else
  1848.          {
  1849.             fnCallback.call(objThis,false);
  1850.          }
  1851.       };
  1852.       if(_loc1_.c_strEnvironment == "Windows" || _loc1_.c_strEnvironment == "Macintosh" || _loc1_.c_strEnvironment == "Linux")
  1853.       {
  1854.          objThis.writeTestData(strFileName,strSocketdata,fnWriteScoreFile);
  1855.       }
  1856.    }
  1857.    function createRecordXML(_strFileName)
  1858.    {
  1859.       var _loc1_ = this.c_objSourceRef.c_objUICoodInstance.c_objRecordXML;
  1860.       var _loc3_ = _loc1_.parentNode;
  1861.       var _loc2_ = _loc3_.createElement("testname");
  1862.       var objTextNode = _loc3_.createTextNode(_strFileName + "_W.xml");
  1863.       _loc1_.appendChild(_loc2_);
  1864.       _loc2_.appendChild(objTextNode);
  1865.       return _loc1_.toString();
  1866.    }
  1867.    function attachPopUp()
  1868.    {
  1869.       _level101.attachMovie("mc_popup","mc_PopUp",700);
  1870.    }
  1871.    function resetPanelState()
  1872.    {
  1873.       var _loc3_ = this;
  1874.       var objQuestion = _loc3_.c_objScreenData.DOC.section[_loc3_.c_iPartNo].question;
  1875.       var _loc1_ = 0;
  1876.       while(_loc1_ < objQuestion.length)
  1877.       {
  1878.          var _loc2_ = _level101["mc_QuesType" + (_loc3_.c_iPartNo + 1)]["mc_textcont_" + (_loc1_ + 1)];
  1879.          _loc2_.gotoAndStop("_DESELECTED");
  1880.          _loc1_ = _loc1_ + 1;
  1881.       }
  1882.    }
  1883.    function showFeedbackL(_QuesID)
  1884.    {
  1885.       var _loc1_ = _QuesID;
  1886.       var _loc2_ = _level101["mc_QuesType" + (this.c_iPartNo + 1)];
  1887.       var _objQuestion = this.c_objScreenData.DOC.section[this.c_iPartNo].question;
  1888.       var _iFirstQNum = Number(_objQuestion[Number(_loc1_) - 1].attributes.number);
  1889.       var _iCorrectOption = Number(_objQuestion[Number(_loc1_) - 1].attributes.correct);
  1890.       var _loc3_ = this.c_hQuestionState["get"](String("listening_" + _iFirstQNum));
  1891.       var _objChoice = _objQuestion[_loc1_ - 1].choice;
  1892.       if(_loc3_.attempted != undefined || _loc3_.attempted != null)
  1893.       {
  1894.          var _iAttempted = Number(_loc3_.attempted);
  1895.          if(_loc3_.correct == 0)
  1896.          {
  1897.             _loc2_["mc_TickCross_" + _loc1_ + "_" + _iAttempted].gotoAndStop("INCORRECT");
  1898.             _loc2_["mc_TickCross_" + _loc1_ + "_" + _iCorrectOption].gotoAndStop("CORRECT");
  1899.          }
  1900.          else
  1901.          {
  1902.             _loc2_["mc_TickCross_" + _loc1_ + "_" + _iAttempted].gotoAndStop("CORRECT");
  1903.          }
  1904.       }
  1905.       else
  1906.       {
  1907.          _loc2_["mc_TickCross_" + _loc1_ + "_" + _iCorrectOption].gotoAndStop("CORRECT");
  1908.       }
  1909.    }
  1910.    function showQuesSelection(strTemplateType, iQueNo)
  1911.    {
  1912.       var _loc1_ = iQueNo;
  1913.       var _loc3_ = this;
  1914.       var _loc2_ = undefined;
  1915.       var iQuesCount = 2;
  1916.       _loc3_.c_strCurrSelected = String(_loc1_);
  1917.       if(strTemplateType == "MCQType_7")
  1918.       {
  1919.          _loc2_ = _level101.MCQType_7.mc_SPType_7.getScrollContent();
  1920.          iQuesCount = _loc3_.c_objSection.question.length;
  1921.       }
  1922.       else if(strTemplateType == "PairedMCQScrolling")
  1923.       {
  1924.          _loc2_ = _level101.PairedMCQScrolling.mc_ScrollPaneQue.getScrollContent();
  1925.          _loc1_ = (_loc1_ - 1) % 2 + 1;
  1926.       }
  1927.       else if(strTemplateType == "PairedMCQExtract")
  1928.       {
  1929.          _loc2_ = _level101.PairedMCQExtract;
  1930.          _loc1_ = (_loc1_ - 1) % 2 + 1;
  1931.       }
  1932.       _loc3_.c_objMCQ.deselectionAll(_loc2_,iQuesCount);
  1933.       _loc3_.c_objMCQ.showCurrentSelection(_loc2_,_loc1_);
  1934.       _loc3_.c_objMCQ.showNavigationSelection();
  1935.    }
  1936.    function setTotalTestQuestions(_iTotalTestQuestions)
  1937.    {
  1938.       this.c_iTotalTestQuestions = _iTotalTestQuestions;
  1939.    }
  1940.    function getTotalTestQuestions()
  1941.    {
  1942.       return this.c_iTotalTestQuestions;
  1943.    }
  1944.    function StoreOptioncliked(in_OptName, in_objCompRef, in_bValue)
  1945.    {
  1946.       var _loc1_ = this;
  1947.       _loc1_.c_objOptName.mcSelected = in_OptName;
  1948.       _loc1_.c_objOptName.objCompRef = in_objCompRef;
  1949.       _loc1_.c_objOptName.bValue = in_bValue;
  1950.    }
  1951.    function GetOptioncliked()
  1952.    {
  1953.       return this.c_objOptName;
  1954.    }
  1955.    function storeRecord(_strFileData, fnCallback)
  1956.    {
  1957.       com.controller.UICoordinator.getInstance().c_strRecordSet = _strFileData;
  1958.       fnCallback.call(this,true);
  1959.    }
  1960.    function writeTestData(_strFileName, _strFileData, fnCallback)
  1961.    {
  1962.       com.controller.UICoordinator.getInstance().c_objTestXML[_strFileName] = _strFileData;
  1963.       fnCallback.call(this,true);
  1964.    }
  1965. }
  1966.