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

  1. class com.screen.MCQ
  2. {
  3.    var c_objTestRef;
  4.    var c_iTest;
  5.    var onEnterFrame;
  6.    var c_iQuestionID;
  7.    var c_objRef;
  8.    var c_iTotalOptions;
  9.    var c_strSkill;
  10.    var c_iWidth;
  11.    var c_objQuestionData;
  12.    var c_objSection;
  13.    var c_iQuesSB = 0;
  14.    function MCQ(_objTestRef)
  15.    {
  16.       this.c_objTestRef = _objTestRef;
  17.       this.c_iTest = 20;
  18.    }
  19.    function init(_iTotalOptions, _iCorrect, _objData, _objRef, _iWidth, _strMCQType, _objSection, _strSkill, _blnLoadImage, _iQID)
  20.    {
  21.       var _loc1_ = this;
  22.       _loc1_.c_iWidth = _iWidth;
  23.       _loc1_.c_strMCQType = _strMCQType;
  24.       _loc1_.c_iTotalOptions = _iTotalOptions;
  25.       _loc1_.c_objRef = _objRef;
  26.       _loc1_.c_objQuestionData = _objData;
  27.       _loc1_.c_objSection = _objSection;
  28.       _loc1_.c_objData = new Object();
  29.       _loc1_.c_objData.iTotalOptions = _iTotalOptions;
  30.       _loc1_.c_objData.iCorrect = _iCorrect;
  31.       _loc1_.c_iQuestionID = _iQID;
  32.       _loc1_.c_struserName = com.controller.UICoordinator.getInstance().userName;
  33.       _loc1_.c_strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
  34.       if(_loc1_.c_strMCQType == "MCQType_7")
  35.       {
  36.          _loc1_.c_objRef["MCQ_Q_" + _loc1_.c_iQuestionID].objTimelineRef = _loc1_.c_objRef;
  37.       }
  38.       else
  39.       {
  40.          _loc1_.c_objRef.MCQ_Q1.objTimelineRef = _loc1_.c_objRef;
  41.       }
  42.       _loc1_.c_strSkill = _strSkill;
  43.       _loc1_.showMCQLayout(_blnLoadImage);
  44.    }
  45.    function showMCQLayout(_blnLoadImage)
  46.    {
  47.       var _loc1_ = this;
  48.       switch(_loc1_.c_strMCQType)
  49.       {
  50.          case "MCQType_2":
  51.          case "MCQType_4":
  52.          case "MCQType_5":
  53.             !_blnLoadImage ? _loc1_.arrange() : _loc1_.loadImage();
  54.             break;
  55.          case "MCQType_7":
  56.             _loc1_.arrangeListening2();
  57.             break;
  58.          case "FIBType_3":
  59.             _loc1_.arrangeFIBType3();
  60.             break;
  61.          case "MCQType_6":
  62.             _loc1_.arrangeListening();
  63.             break;
  64.          case "PairedMCQScrolling":
  65.             _loc1_.showPairedMCQScrolling();
  66.             break;
  67.          case "PairedMCQExtract":
  68.             _loc1_.showPairedMCQExtract();
  69.       }
  70.    }
  71.    function loadImage()
  72.    {
  73.       var _loc1_ = this;
  74.       var mcSelf = _loc1_.c_objRef.mc_ImageHolder;
  75.       var iScaleWidth = _loc1_.c_objRef.mc_Imagescaler._width;
  76.       var iScaleHeight = _loc1_.c_objRef.mc_Imagescaler._height;
  77.       var iHeight = mcSelf._height;
  78.       var iWidth = mcSelf._width;
  79.       if(_loc1_.c_objQuestionData.image != undefined && _loc1_.c_objQuestionData.image.data != undefined)
  80.       {
  81.          mcSelf.loadMovie("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/jpegs/" + _loc1_.c_objQuestionData.image.data);
  82.          _loc1_.c_numFieldWidth = _loc1_.c_objRef.txt_Question._width - mcSelf._width;
  83.          _loc1_.c_numFieldXpos = mcSelf._x + mcSelf._width + 6;
  84.       }
  85.       else
  86.       {
  87.          _loc1_.c_numFieldWidth = 317.25;
  88.          _loc1_.c_numFieldXpos = mcSelf._x;
  89.       }
  90.       if(_loc1_.c_strMCQType == "MCQType_2")
  91.       {
  92.          _loc1_.c_objRef.onEnterFrame = function()
  93.          {
  94.             if(mcSelf._width != iWidth && mcSelf._width > 0)
  95.             {
  96.                mcSelf._width = iScaleWidth;
  97.                mcSelf._height = iScaleHeight;
  98.                delete this.onEnterFrame;
  99.             }
  100.          };
  101.       }
  102.       _loc1_.showMCQType2Data(mcSelf._height);
  103.    }
  104.    function showMCQType2Data(_iImageHeight)
  105.    {
  106.       var _loc1_ = this;
  107.       _loc1_.c_objRef.txt_QuestionNo.text = _loc1_.c_objQuestionData.attributes.number;
  108.       _loc1_.c_objRef.txt_Question._width = _loc1_.c_numFieldWidth;
  109.       _loc1_.c_objRef.txt_Question._x = _loc1_.c_numFieldXpos + 10;
  110.       _loc1_.c_objRef.txt_Question.autoSize = true;
  111.       _loc1_.c_objRef.txt_Question.multiline = true;
  112.       _loc1_.c_objRef.txt_Question.html = true;
  113.       _loc1_.c_objRef.txt_Question.htmlText = _loc1_.c_objQuestionData.text.data;
  114.       var objRB = new com.comp.ResizableBox();
  115.       var iHeaderHeight = objRB.getHeaderHeight(_loc1_.c_objRef.mc_textcont);
  116.       var iRB_ypos = _loc1_.c_objRef.mc_textcont._y;
  117.       var iRB_xpos = _loc1_.c_objRef.mc_textcont._x;
  118.       var iY;
  119.       if(_loc1_.c_objQuestionData.text.data != undefined)
  120.       {
  121.          if(_loc1_.c_objRef.txt_Question.height > _iImageHeight)
  122.          {
  123.             iY = _loc1_.c_objRef.txt_Question.height + _loc1_.c_objRef.txt_Question._y + 10;
  124.          }
  125.          else if(_loc1_.c_objQuestionData.image != undefined && _loc1_.c_objQuestionData.image.data != undefined)
  126.          {
  127.             iY = _iImageHeight + _loc1_.c_objRef.txt_Question._y + 7;
  128.          }
  129.          else
  130.          {
  131.             iY = _loc1_.c_objRef.txt_Question._y + _loc1_.c_objRef.txt_Question.textHeight + 10;
  132.          }
  133.       }
  134.       else
  135.       {
  136.          iY = iRB_ypos + iHeaderHeight + 10;
  137.       }
  138.       var iX = iRB_xpos + 10;
  139.       var iHeight = 20;
  140.       var iMargin = iY - (iRB_ypos + iHeaderHeight);
  141.       var _loc3_ = undefined;
  142.       _loc1_.c_objRef.mc_ScrollPane.setScrollContent("SP_Content");
  143.       _loc1_.c_MCQContainer = _loc1_.c_objRef.mc_ScrollPane.getScrollContent();
  144.       _loc1_.c_objRef.mc_ScrollPane._y = iY;
  145.       var choicesYPos = _loc1_.c_MCQContainer._y;
  146.       var mcFeedbackHolder = _loc1_.c_MCQContainer.createEmptyMovieClip("mcFeedbackHolder",21);
  147.       var iResizeBoxHeight = iHeaderHeight + _loc1_.c_objRef.txt_Question._height + _loc1_.c_objRef.mc_ScrollPane._height + 10;
  148.       var _loc2_ = 1;
  149.       while(_loc2_ <= _loc1_.c_iTotalOptions)
  150.       {
  151.          _loc1_.c_MCQContainer.attachMovie("mc_MCQChoice2","mc_MCQChoice" + _loc2_,11 + _loc2_,{_x:_loc1_.c_MCQContainer._x,_y:choicesYPos});
  152.          _loc3_ = _loc1_.c_MCQContainer["mc_MCQChoice" + _loc2_];
  153.          _loc3_.txt_ChoiceText.text = _loc1_.c_objQuestionData.choice[_loc2_ - 1].attributes.id + " - " + _loc1_.c_objQuestionData.choice[_loc2_ - 1].data;
  154.          var mcTick = mcFeedbackHolder.attachMovie("mc_TickCrossL","mc_TickCrossL_" + _loc2_,9000 + _loc2_,{_x:_loc3_._x + _loc3_._width - 25,_y:_loc3_._y});
  155.          mcTick.gotoAndStop("BLANK");
  156.          iHeight += _loc3_._height + 7;
  157.          iY += _loc3_._height + 7;
  158.          choicesYPos += _loc3_._height + 7;
  159.          _loc1_.c_objData.iCorrect == _loc2_ ? _loc1_.c_objRef._parent.MCQ_Q1.addChild(_loc3_,String(_loc2_),true) : _loc1_.c_objRef._parent.MCQ_Q1.addChild(_loc3_,String(_loc2_),false);
  160.          _loc2_ = _loc2_ + 1;
  161.       }
  162.       _loc1_.c_objRef.mc_ScrollPane.refreshPane();
  163.       if(_loc1_.c_objTestRef.c_strMode == "Review")
  164.       {
  165.          var strAttempted = _loc1_.c_objTestRef.c_objHMObject.attempted;
  166.          var strCorrectID = _loc1_.c_objQuestionData.attributes.correct;
  167.          if(strAttempted != strCorrectID)
  168.          {
  169.             mcFeedbackHolder["mc_TickCrossL_" + strAttempted].gotoAndStop("INCORRECT");
  170.             mcFeedbackHolder["mc_TickCrossL_" + strCorrectID].gotoAndStop("CORRECT");
  171.          }
  172.          else
  173.          {
  174.             mcFeedbackHolder["mc_TickCrossL_" + strCorrectID].gotoAndStop("CORRECT");
  175.          }
  176.       }
  177.       else
  178.       {
  179.          mcFeedbackHolder["mc_TickCrossL_" + strAttempted].gotoAndStop("BLANK");
  180.       }
  181.       objRB.resizeBox(_loc1_.c_iWidth,iResizeBoxHeight,_loc1_.c_objRef.mc_textcont);
  182.       _loc1_.c_objRef.btn_next._x = iX + _loc1_.c_iWidth - (_loc1_.c_objRef.btn_next._width + 11);
  183.       _loc1_.c_objRef.btn_next._y = _loc1_.c_objRef.mc_textcont._y + _loc1_.c_objRef.mc_textcont._height + 9;
  184.    }
  185.    function showPairedMCQScrolling()
  186.    {
  187.       var _loc1_ = this;
  188.       var sectionTestRef = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo];
  189.       var queDataTestRef = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question[_loc1_.c_objTestRef.c_iQuestionNo - 1];
  190.       var queNoTestRef = _loc1_.c_objTestRef.c_iQuestionNo;
  191.       var iPairCount = 2;
  192.       var iPairID = _loc1_.c_objTestRef.c_iPairID;
  193.       var blnIsPairChanged = _loc1_.c_objTestRef.c_iPairID != _loc1_.c_objTestRef.c_iPrevPairID;
  194.       var blnIsPartChanged = _loc1_.c_objTestRef.c_objNavigator.c_blnPartChange;
  195.       var _loc2_ = undefined;
  196.       if(_loc1_.c_objTestRef.c_blnPairedScrolling && (blnIsPairChanged || blnIsPartChanged))
  197.       {
  198.          _loc2_ = _loc1_.c_objRef.attachMovie("FScrollPaneSymbol","mcReadingScroll",_loc1_.c_objRef.getNextHighestDepth());
  199.          _loc2_.setScrollContent("mc_ScrollContent_Pair");
  200.          _loc2_.setSize(_loc1_.c_objRef.mc_ScrollBarRef._width - 1,_loc1_.c_objRef.mc_ScrollBarRef._height - 1);
  201.          _loc2_._x = _loc1_.c_objRef.mc_ScrollBarRef._x;
  202.          _loc2_._y = _loc1_.c_objRef.mc_ScrollBarRef._y;
  203.          _loc1_.c_objTestRef.c_blnPairedScrolling = false;
  204.       }
  205.       var mcScrollPaneCont = _loc2_.getScrollContent();
  206.       var objParagraphData = _loc1_.c_objSection.text[iPairID];
  207.       var objTitleData = _loc1_.c_objSection.title[iPairID];
  208.       _loc1_.setParagraphData(objParagraphData,objTitleData,mcScrollPaneCont);
  209.       _loc2_.refreshPane();
  210.       var _loc3_ = _loc1_.c_objRef.attachMovie("FScrollPaneSymbol","mc_ScrollPaneQue",200);
  211.       _loc3_.setScrollContent("SP_Content");
  212.       _loc3_.setSize(_loc1_.c_objRef.mc_ScrollRightRef._width - 1,_loc1_.c_objRef.mc_ScrollRightRef._height - 2);
  213.       _loc3_._x = _loc1_.c_objRef.mc_ScrollRightRef._x;
  214.       _loc3_._y = _loc1_.c_objRef.mc_ScrollRightRef._y + 0.8;
  215.       var MCQContainer = _loc3_.getScrollContent();
  216.       _loc1_.showQuestion(MCQContainer,sectionTestRef,queNoTestRef,iPairID,2);
  217.       _loc3_.refreshPane();
  218.       _loc1_.setScrollBarPosition(_loc1_.c_objRef.mc_ScrollPaneQue);
  219.       var iCompID = (queNoTestRef - 1) % 2 + 1;
  220.       _loc1_.deselectionAll(MCQContainer,iPairCount);
  221.       _loc1_.showCurrentSelection(MCQContainer,iCompID);
  222.    }
  223.    function setScrollBarPosition(mcSPane)
  224.    {
  225.       var _loc1_ = undefined;
  226.       if(this.c_iQuestionID % 2 == 0)
  227.       {
  228.          _loc1_ = 210;
  229.       }
  230.       else
  231.       {
  232.          _loc1_ = 0;
  233.       }
  234.       mcSPane.setScrollPosition(0,_loc1_);
  235.    }
  236.    function setParagraphData(objParagraphData, objTitleData, mcTemplate)
  237.    {
  238.       var _loc1_ = mcTemplate;
  239.       var _loc3_ = this;
  240.       var strTitle = objTitleData.data;
  241.       var strText = objParagraphData.data;
  242.       var iScrollPaneW = _loc3_.c_objRef.mc_ScrollBarRef._width;
  243.       var iScrollPaneH = _loc3_.c_objRef.mc_ScrollBarRef._height;
  244.       var iScrollPaneX = _loc3_.c_objRef.mc_ScrollBarRef._x;
  245.       var iScrollPaneY = _loc3_.c_objRef.mc_ScrollBarRef._y;
  246.       _loc1_.createTextField("titleTxt",100,0,0,0,0);
  247.       var _loc2_ = new TextFormat();
  248.       _loc2_.font = "Verdana";
  249.       _loc2_.size = 11;
  250.       _loc1_.titleTxt.autoSize = true;
  251.       _loc1_.titleTxt.selectable = false;
  252.       _loc1_.titleTxt.html = true;
  253.       if(_loc3_.c_strEnvironment == "Linux")
  254.       {
  255.          _loc1_.titleTxt.embedFonts = true;
  256.       }
  257.       _loc1_.titleTxt.htmlText = strTitle;
  258.       _loc1_.titleTxt.setTextFormat(_loc2_);
  259.       var strTextFormat = new TextFormat();
  260.       strTextFormat.leftMargin = 5;
  261.       _loc1_.txt_Description.autoSize = true;
  262.       _loc1_.txt_Description.html = true;
  263.       _loc1_.txt_Description.htmlText = strText;
  264.       _loc1_.txt_Description.setTextFormat(strTextFormat);
  265.       _loc1_.titleTxt._x = iScrollPaneX + 3;
  266.       _loc1_.titleTxt._y = iScrollPaneY + 5;
  267.       _loc1_.txt_Description._y = _loc1_.titleTxt.textHeight + 10;
  268.    }
  269.    function showQuestion(MCQContainer, sectionTestRef, queNoTestRef, iPairID, showQue)
  270.    {
  271.       var mcBox_xpos = 3;
  272.       var mcBox_ypos = 3;
  273.       var iPairCount = showQue;
  274.       var objRB = new com.comp.ResizableBox();
  275.       objRB.addListener(this);
  276.       var j = 1;
  277.       while(j <= showQue)
  278.       {
  279.          var iQuesID = iPairID * iPairCount + (j - 1);
  280.          var _loc3_ = MCQContainer.attachMovie("mc_txtContContainer","mc_QuestionPanel_" + j,150 + j,{_x:mcBox_xpos,_y:mcBox_ypos});
  281.          _loc3_.txt_Question.autoSize = true;
  282.          _loc3_.txt_Question.html = true;
  283.          _loc3_.txt_QuestionNo.html = true;
  284.          _loc3_.txt_QuestionNo.htmlText = "<b>" + sectionTestRef.question[iQuesID].attributes.number + "</b>";
  285.          _loc3_.txt_Question.htmlText = sectionTestRef.question[iQuesID].text.data;
  286.          var iChoice_ypos;
  287.          var mcNewMCQController = this.c_objRef._parent.MCQ_Q1.attachMovie("ComponentMCQ","ComponentMCQ_" + j,10000 + j);
  288.          mcNewMCQController.init();
  289.          mcNewMCQController.objTimelineRef = this;
  290.          mcNewMCQController.c_bIsToggle = true;
  291.          mcNewMCQController._visible = false;
  292.          var _loc1_ = 1;
  293.          while(_loc1_ <= this.c_iTotalOptions)
  294.          {
  295.             var _loc2_ = _loc3_.attachMovie("mc_PairedMCQChoice","mc_MCQChoice_" + _loc1_,200 + _loc1_);
  296.             _loc2_.txt_ChoiceID.html = true;
  297.             _loc2_.txt_ChoiceText.html = true;
  298.             _loc2_.txt_ChoiceText.autoSize = true;
  299.             _loc2_.txt_ChoiceID.htmlText = "<b>" + sectionTestRef.question[iQuesID].choice[_loc1_ - 1].attributes.id + "</b>";
  300.             _loc2_.txt_ChoiceText.htmlText = sectionTestRef.question[iQuesID].choice[_loc1_ - 1].data;
  301.             _loc2_._x = _loc3_.txt_Question._x;
  302.             if(_loc1_ == 1)
  303.             {
  304.                iChoice_ypos = _loc3_.txt_Question._y + _loc3_.txt_Question.textHeight + 20;
  305.             }
  306.             else
  307.             {
  308.                iChoice_ypos = _loc3_["mc_MCQChoice_" + (_loc1_ - 1)]._y + _loc3_["mc_MCQChoice_" + (_loc1_ - 1)]._height + 10;
  309.             }
  310.             _loc2_._y = iChoice_ypos;
  311.             var iCorrectAns = sectionTestRef.question[iQuesID].attributes.correct;
  312.             iCorrectAns == _loc1_ ? mcNewMCQController.addChild(_loc2_,String(_loc1_),true) : mcNewMCQController.addChild(_loc2_,String(_loc1_),false);
  313.             _loc1_ = _loc1_ + 1;
  314.          }
  315.          if(this.c_objTestRef.c_strMode == "Review")
  316.          {
  317.             var iCorrectAns = sectionTestRef.question[iQuesID].attributes.correct;
  318.             var iQueNo = sectionTestRef.question[iQuesID].attributes.number;
  319.             this.showCorrectIncorrect(iQueNo,iCorrectAns,_loc3_);
  320.             var objHMObject = this.c_objTestRef.c_hQuestionState["get"](String(this.c_strSkill + "_" + iQueNo));
  321.             var strAttemptedID = Number(objHMObject.attempted);
  322.             if(objHMObject != undefined && objHMObject != null)
  323.             {
  324.                mcNewMCQController.setSelect(String(objHMObject.attempted));
  325.             }
  326.             mcNewMCQController.freeze(true);
  327.          }
  328.          var iRB_Height = iChoice_ypos + 48;
  329.          objRB.resizeBox(this.c_iWidth,iRB_Height,_loc3_.mc_textcont);
  330.          mcBox_ypos = iChoice_ypos + 63;
  331.          j++;
  332.       }
  333.    }
  334.    function arrange(_iImageHeight)
  335.    {
  336.       var _loc1_ = this;
  337.       _loc1_.showQuesText();
  338.       var objRB = new com.comp.ResizableBox();
  339.       var iHeaderHeight = objRB.getHeaderHeight(_loc1_.c_objRef.mc_textcont);
  340.       var iRB_ypos = _loc1_.c_objRef.mc_textcont._y;
  341.       var iRB_xpos = _loc1_.c_objRef.mc_textcont._x;
  342.       var iY;
  343.       if(_loc1_.c_objQuestionData.text.data != undefined)
  344.       {
  345.          if(_loc1_.c_objRef.txt_Question.height > _iImageHeight)
  346.          {
  347.             iY = _loc1_.c_objRef.txt_Question.height + _loc1_.c_objRef.txt_Question._y + 10;
  348.          }
  349.          else
  350.          {
  351.             iY = _iImageHeight + _loc1_.c_objRef.txt_Question._y + 7;
  352.          }
  353.       }
  354.       else
  355.       {
  356.          iY = iRB_ypos + iHeaderHeight + 10;
  357.       }
  358.       var iX = iRB_xpos + 10;
  359.       var iHeight = 0;
  360.       var iMargin = iY - (iRB_ypos + iHeaderHeight);
  361.       var _loc3_ = undefined;
  362.       if(_loc1_.c_strMCQType == "MCQType_2")
  363.       {
  364.          var mcScrollPane = _loc1_.c_objRef.attachMovie("FScrollPaneSymbol","mc_ScrollPane",600);
  365.          mcScrollPane.setScrollContent("SP_Content");
  366.          mcScrollPane.setSize(_loc1_.c_objRef.mcBg._width,_loc1_.c_objRef.mcBg._height);
  367.          mcScrollPane._x = _loc1_.c_objRef.mcBg._x;
  368.          mcScrollPane._y = _loc1_.c_objRef.mcBg._y;
  369.          _loc1_.c_MCQContainer = mcScrollPane.getScrollContent();
  370.       }
  371.       var strChoidID = _loc1_.c_strMCQType.split("_")[1];
  372.       var _loc2_ = 1;
  373.       while(_loc2_ <= _loc1_.c_iTotalOptions)
  374.       {
  375.          if(_loc1_.c_strMCQType == "MCQType_5" || _loc1_.c_strMCQType == "MCQType_4")
  376.          {
  377.             _loc1_.c_objRef.createEmptyMovieClip("MCQContainer",600 + _loc2_);
  378.             _loc3_ = _loc1_.c_objRef.MCQContainer.attachMovie("mc_MCQChoice" + strChoidID,"mc_MCQChoice" + _loc2_,11 + _loc2_,{_x:iX,_y:iY});
  379.          }
  380.          else if(_loc1_.c_strMCQType == "MCQType_2")
  381.          {
  382.             _loc3_ = _loc1_.c_MCQContainer.attachMovie("mc_MCQChoice" + strChoidID,"mc_MCQChoice" + _loc2_,600 + _loc2_,{_x:iX,_y:iY});
  383.          }
  384.          else
  385.          {
  386.             _loc3_ = _loc1_.c_objRef.attachMovie("mc_MCQChoice" + strChoidID,"mc_MCQChoice" + _loc2_,11 + _loc2_,{_x:iX,_y:iY});
  387.          }
  388.          if(_loc1_.c_strMCQType == "1" || _loc1_.c_strMCQType == "3" || _loc1_.c_strMCQType == "MCQType_4" || _loc1_.c_strMCQType == "MCQType_5")
  389.          {
  390.             _loc3_.txt_Choice.text = String.fromCharCode(64 + _loc2_);
  391.             _loc3_.txt_ChoiceText.autoSize = true;
  392.             _loc3_.txt_ChoiceText.html = true;
  393.             _loc3_.txt_ChoiceText.htmlText = _loc1_.c_objQuestionData.choice[_loc2_ - 1].data;
  394.          }
  395.          else if(_loc1_.c_strMCQType == "MCQType_2")
  396.          {
  397.             _loc3_.txt_ChoiceText.text = String.fromCharCode(64 + _loc2_) + " - " + _loc1_.c_objSection.paragraph[_loc2_ - 1].title.data;
  398.          }
  399.          if(_loc1_.c_strMCQType == "MCQType_4" && _loc2_ == _loc1_.c_iTotalOptions)
  400.          {
  401.             _loc3_.txt_ChoiceText.htmlText = _loc1_.c_objQuestionData.choice[_loc2_ - 1].data + "\n\n";
  402.          }
  403.          else if(_loc1_.c_strMCQType == "MCQType_5" && _loc2_ == _loc1_.c_iTotalOptions)
  404.          {
  405.             _loc3_.txt_ChoiceText.htmlText = _loc1_.c_objQuestionData.choice[_loc2_ - 1].data + "\n\n";
  406.          }
  407.          if(_loc1_.c_objTestRef.c_strMode == "Review")
  408.          {
  409.             _loc1_.c_objRef["mc_TickCross" + _loc2_].removeMovieClip();
  410.             _loc1_.c_objRef.MCQContainer["mc_TickCross" + _loc2_].removeMovieClip();
  411.             if(_loc2_ == _loc1_.c_objTestRef.c_objHMObject.attempted || _loc2_ == _loc1_.c_objData.iCorrect)
  412.             {
  413.                if(_loc1_.c_strMCQType != "MCQType_4" || _loc1_.c_strMCQType != "MCQType_5")
  414.                {
  415.                   _loc1_.c_objRef.attachMovie("mc_TickCrossL","mc_TickCross" + _loc2_,21 + _loc2_,{_x:_loc1_.c_objRef.mc_textcont._x + _loc1_.c_iWidth - 30,_y:_loc3_._y});
  416.                }
  417.                else
  418.                {
  419.                   _loc1_.c_objRef.MCQContainer.attachMovie("mc_TickCrossL","mc_TickCross" + _loc2_,21 + _loc2_,{_x:_loc1_.c_objRef.mc_textcont._x + _loc1_.c_iWidth - 30,_y:_loc3_._y});
  420.                }
  421.             }
  422.          }
  423.          if(_loc1_.c_strMCQType != "MCQType_2")
  424.          {
  425.             iHeight += _loc3_._height + 10;
  426.             iY += _loc3_._height + 10;
  427.          }
  428.          else
  429.          {
  430.             iHeight += _loc3_._height + 7;
  431.             iY += _loc3_._height + 7;
  432.          }
  433.          _loc1_.c_objData.iCorrect == _loc2_ ? _loc1_.c_objRef._parent.MCQ_Q1.addChild(_loc3_,String(_loc2_),true) : _loc1_.c_objRef._parent.MCQ_Q1.addChild(_loc3_,String(_loc2_),false);
  434.          _loc2_ = _loc2_ + 1;
  435.       }
  436.       if(_loc1_.c_strMCQType == "MCQType_2")
  437.       {
  438.          _loc1_.c_objRef.mc_ScrollPane.refreshPane();
  439.       }
  440.       var mcMovieRef;
  441.       if(_loc1_.c_strMCQType != "MCQType_4" || _loc1_.c_strMCQType != "MCQType_5")
  442.       {
  443.          mcMovieRef = _loc1_.c_objRef["mc_TickCross" + _loc1_.c_objTestRef.c_objHMObject.attempted];
  444.       }
  445.       else
  446.       {
  447.          mcMovieRef = _loc1_.c_objRef.MCQContainer["mc_TickCross" + _loc1_.c_objTestRef.c_objHMObject.attempted];
  448.       }
  449.       if(_loc1_.c_objTestRef.c_strMode == "Review")
  450.       {
  451.          mcMovieRef.gotoAndStop("BLANK");
  452.          if(_loc1_.c_objTestRef.c_objHMObject.attempted == _loc1_.c_objData.iCorrect && _loc1_.c_strMCQType == "MCQType_4" || _loc1_.c_objTestRef.c_objHMObject.attempted == _loc1_.c_objData.iCorrect && _loc1_.c_strMCQType == "MCQType_5")
  453.          {
  454.             mcMovieRef.gotoAndStop("CORRECT");
  455.          }
  456.          else if(_loc1_.c_objTestRef.c_objHMObject.attempted != _loc1_.c_objData.iCorrect && _loc1_.c_strMCQType == "MCQType_4" || _loc1_.c_objTestRef.c_objHMObject.attempted != _loc1_.c_objData.iCorrect && _loc1_.c_strMCQType == "MCQType_5")
  457.          {
  458.             mcMovieRef.gotoAndStop("INCORRECT");
  459.          }
  460.          else
  461.          {
  462.             mcMovieRef.gotoAndStop("BLANK");
  463.          }
  464.          if(_loc1_.c_objTestRef.c_objHMObject.attempted != _loc1_.c_objData.iCorrect && _loc1_.c_strMCQType == "MCQType_5" || _loc1_.c_objTestRef.c_objHMObject.attempted != _loc1_.c_objData.iCorrect && _loc1_.c_strMCQType == "MCQType_4")
  465.          {
  466.             _loc1_.c_objRef["mc_TickCross" + _loc1_.c_objData.iCorrect].gotoAndStop("CORRECT");
  467.          }
  468.       }
  469.       if(_loc1_.c_strMCQType == "MCQType_4" && _loc1_.c_objRef.MCQContainer._height >= 250 || _loc1_.c_strMCQType == "MCQType_5" && _loc1_.c_objRef.MCQContainer._height >= 250)
  470.       {
  471.          objRB.enableBox(_loc1_.c_objRef.mc_textcont);
  472.          objRB.resizeBox(_loc1_.c_iWidth + 10,320,_loc1_.c_objRef.mc_textcont);
  473.       }
  474.       else
  475.       {
  476.          objRB.enableBox(_loc1_.c_objRef.mc_textcont);
  477.          objRB.resizeBox(_loc1_.c_iWidth,iHeight + (iHeaderHeight + iMargin),_loc1_.c_objRef.mc_textcont);
  478.       }
  479.       if(_loc1_.c_strMCQType == 4 && _loc1_.c_objRef.MCQContainer._height >= 250)
  480.       {
  481.          _loc1_.c_objRef.btn_next._x = iX + _loc1_.c_iWidth - _loc1_.c_objRef.btn_next._width;
  482.          _loc1_.c_objRef.btn_next._y = 335;
  483.       }
  484.       else
  485.       {
  486.          _loc1_.c_objRef.btn_next._x = iX + _loc1_.c_iWidth - (_loc1_.c_objRef.btn_next._width + 10);
  487.          _loc1_.c_objRef.btn_next._y = iY + 7;
  488.       }
  489.    }
  490.    function showQuesText()
  491.    {
  492.       var _loc1_ = this;
  493.       var _loc2_ = new TextFormat();
  494.       _loc2_.font = "Verdana";
  495.       _loc2_.size = 11;
  496.       _loc1_.c_objRef.txt_QuestionNo.text = _loc1_.c_objQuestionData.attributes.number;
  497.       _loc1_.c_objRef.txt_Question.autoSize = true;
  498.       _loc1_.c_objRef.txt_Question.multiline = true;
  499.       if(_loc1_.c_strEnvironment == "Linux")
  500.       {
  501.          _loc1_.c_objRef.txt_Question.embedFonts = true;
  502.       }
  503.       _loc1_.c_objRef.txt_Question.html = true;
  504.       _loc1_.c_objRef.txt_Question.htmlText = _loc1_.c_objQuestionData.text.data;
  505.       _loc1_.c_objRef.txt_Question.setTextFormat(_loc2_);
  506.    }
  507.    function arrangeFIBType3()
  508.    {
  509.       var _loc2_ = this;
  510.       _loc2_.c_objRef.btn_PrintFib3.enabled = false;
  511.       var objRB = new com.comp.ResizableBox();
  512.       var iX = 315;
  513.       var iHeaderHeight = objRB.getHeaderHeight(_loc2_.c_objRef.mc_MCQ7Choice1.mc_textcont);
  514.       _loc2_.c_objRef.mc_ScrollPane.setScrollContent("SP_Content");
  515.       var mcScrollContent = _loc2_.c_objRef.mc_ScrollPane.getScrollContent();
  516.       var iBoxY = 0;
  517.       var iDepth = 100;
  518.       var _loc1_ = 1;
  519.       while(_loc1_ <= _loc2_.c_iTotalOptions)
  520.       {
  521.          var strHasChild = _loc2_.c_objQuestionData.text[_loc1_ - 1].attributes.hasChild;
  522.          mcScrollContent.attachMovie("ID_MCQBox7","mcBox_" + _loc1_,iDepth++);
  523.          _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_] = mcScrollContent["mcBox_" + _loc1_];
  524.          _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._y = iBoxY;
  525.          var objRBox = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mc_textcont;
  526.          _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mcq._name = "BOX_" + _loc1_;
  527.          _loc2_.c_objRef["mc_MCQChoice" + _loc1_] = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]["BOX_" + _loc1_];
  528.          var mcChoice = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_];
  529.          var objQuesField = mcChoice.txt_Question;
  530.          var objTooTipField = mcChoice.txt_toolTip;
  531.          var objFootField = mcChoice.txt_Footer;
  532.          var strQuesText = String(_loc2_.c_objQuestionData.text[_loc1_ - 1].questionText.data);
  533.          mcChoice.txt_Question.autoSize = true;
  534.          mcChoice.txt_Question.multiline = true;
  535.          mcChoice.txt_Question.html = true;
  536.          if(_loc2_.c_strEnvironment == "Linux")
  537.          {
  538.             trace(">>>>%%% - mcChoice.txt_Question.embedFonts = true");
  539.             mcChoice.txt_Question.embedFonts = true;
  540.          }
  541.          mcChoice.txt_Question.htmlText = _loc2_.c_objQuestionData.text[_loc1_ - 1].questionText.data;
  542.          var iY = mcChoice.txt_Question._y + mcChoice.txt_Question._height;
  543.          if(_loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip != undefined || _loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip != null)
  544.          {
  545.             var strBorderClipName = _loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip.attributes.BorderLinkage;
  546.             var toolTipTxt = String(_loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip.data);
  547.             objTooTipField.autoSize = true;
  548.             objTooTipField.html = true;
  549.             if(_loc2_.c_strEnvironment == "Linux")
  550.             {
  551.                trace(">>>>%%% - 2 - objTooTipField");
  552.                objTooTipField.embedFonts = true;
  553.             }
  554.             objTooTipField.htmlText = toolTipTxt;
  555.             objTooTipField._y = iY;
  556.             var mcBorder = mcChoice.attachMovie(strBorderClipName,"mcBorder",1);
  557.             mcBorder._x = objTooTipField._x - 2;
  558.             mcBorder._y = objTooTipField._y + 12;
  559.             iY = objTooTipField._y + objTooTipField._height;
  560.          }
  561.          if(_loc2_.c_objQuestionData.text[_loc1_ - 1].footerText != undefined || _loc2_.c_objQuestionData.text[_loc1_ - 1].footerText != null)
  562.          {
  563.             var footerText = String(_loc2_.c_objQuestionData.text[_loc1_ - 1].footerText.data);
  564.             objFootField.autoSize = true;
  565.             objFootField.html = true;
  566.             if(_loc2_.c_strEnvironment == "Linux")
  567.             {
  568.                trace(">>>>%%% - 3 - objFootField");
  569.                objFootField.embedFonts = true;
  570.             }
  571.             objFootField.htmlText = footerText;
  572.             objFootField._y = iY + 5;
  573.          }
  574.          mcChoice["BOX_" + _loc1_].txt_ChoiceText.html = true;
  575.          mcChoice["BOX_" + _loc1_].txt_ChoiceText.htmlText = "<b>Answer Question " + _loc2_.c_objQuestionData.text[_loc1_ - 1].attributes.ref + "</b>";
  576.          if(strHasChild == "true")
  577.          {
  578.             _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].hasChild = true;
  579.             _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight = 0;
  580.             var arrChilds = _loc2_.c_objQuestionData.text[_loc1_ - 1].Q;
  581.             var mcNewMCQController = _loc2_.c_objRef._parent.MCQ_Q1.attachMovie("ComponentMCQ","ComponentMCQ_" + _loc1_ + "_child",10000 + _loc1_);
  582.             _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].objChildMCQ = mcNewMCQController;
  583.             mcNewMCQController.init();
  584.             mcNewMCQController.objTimelineRef = _loc2_;
  585.             mcNewMCQController._visible = false;
  586.             var j = 0;
  587.             while(j < arrChilds.length)
  588.             {
  589.                var _loc3_ = _loc2_.c_objRef["mc_MCQChoice" + _loc1_].duplicateMovieClip("mc_MCQChoice_" + arrChilds[j].attributes.ref,iDepth++);
  590.                _loc3_._x = 20;
  591.                _loc3_._y = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._height + 10;
  592.                _loc3_.txt_ChoiceText.autoSize = true;
  593.                _loc3_.txt_ChoiceText.multiline = true;
  594.                _loc3_.txt_ChoiceText.html = true;
  595.                if(_loc2_.c_strEnvironment == "Linux")
  596.                {
  597.                   trace(">>>>%%% - 4 - mcNewClip.txt_ChoiceText");
  598.                   _loc3_.txt_ChoiceText.embedFonts = true;
  599.                }
  600.                _loc3_.txt_ChoiceText.htmlText = arrChilds[j].data;
  601.                mcNewMCQController.addChild(_loc3_,arrChilds[j].attributes.ref,false);
  602.                _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight += _loc3_._height;
  603.                j++;
  604.             }
  605.             mcNewMCQController.freeze(true);
  606.          }
  607.          _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight += _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_or._height;
  608.          _loc2_.c_objRef._parent.MCQ_Q1.addChild(mcChoice["BOX_" + _loc1_],String(_loc1_),false);
  609.          iBoxY += _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._height + _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight;
  610.          if(_loc1_ < _loc2_.c_iTotalOptions || _loc2_.c_iTotalOptions == 1)
  611.          {
  612.             _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_or._y = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._height;
  613.          }
  614.          else
  615.          {
  616.             _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_or._visible = false;
  617.          }
  618.          _loc1_ = _loc1_ + 1;
  619.       }
  620.       _loc2_.c_objRef.mc_ScrollPane.refreshPane();
  621.       if(_loc2_.c_objTestRef.c_strMode == "Review")
  622.       {
  623.          _loc2_.setEvents();
  624.          _loc2_.c_objRef.mc_ScrollContent.inptxt_WCtxt.type = "dynamic";
  625.       }
  626.       else
  627.       {
  628.          _loc2_.c_objRef.mc_ScrollContent.inptxt_WCtxt.selectable = false;
  629.          _loc2_.c_objRef.mc_ScrollContent.txt_Statement._visible = true;
  630.          _loc2_.c_objRef.mc_ScrollContent.txt_WCHeading._visible = true;
  631.          _loc2_.c_objRef.mc_ScrollContent.dyntxt_WC._visible = true;
  632.       }
  633.    }
  634.    function displayPreviousSelection()
  635.    {
  636.       trace("MMMMMMMMMMMMMMMMMMMMMMMMMMMM11111111111111111111");
  637.       var _objOptnName = this.c_objTestRef.GetOptioncliked();
  638.       if(_objOptnName.objCompRef != undefined || _objOptnName.objCompRef != "")
  639.       {
  640.          trace("MMMMMMMMMMMMMMMMMMMMMM@222222222222222222222222");
  641.          var _objCompRef = _objOptnName.objCompRef;
  642.          this.c_objRef._parent.MCQ_Q1.c_mCurrentSelection = eval(_objOptnName.mcSelected);
  643.          var _tempAttempt = Number(eval(_objOptnName.mcSelected)._name.split("_")[1]);
  644.          this.c_objRef["mc_MCQ7Choice" + _tempAttempt]["BOX_" + _tempAttempt].gotoAndStop("down");
  645.          Selection.setFocus(this.c_objRef.mc_ScrollContent.inptxt_WCtxt);
  646.          this.getAttempted(_objCompRef);
  647.       }
  648.       if(_objOptnName.mcSelected != "" && this.c_objTestRef.c_strMode != "Review")
  649.       {
  650.          this.c_objRef.mc_ScrollContent.inptxt_WCtxt.selectable = true;
  651.       }
  652.       else if(this.c_objTestRef.c_strMode != "Review")
  653.       {
  654.          this.c_objRef.mc_ScrollContent.gotoAndStop(1);
  655.          this.c_objRef.mc_ScrollContent.inptxt_WCtxt.selectable = false;
  656.       }
  657.       else if(this.c_objTestRef.c_strMode == "Review")
  658.       {
  659.          Selection.setFocus(null);
  660.       }
  661.    }
  662.    function arrangeListening()
  663.    {
  664.       var _loc2_ = this;
  665.       var objRB = new com.comp.ResizableBox();
  666.       var _iMargin = 10;
  667.       var iHeaderHeight = objRB.getHeaderHeight(_loc2_.c_objRef.mc_textcont);
  668.       var iRB_xpos = _loc2_.c_objRef.mc_textcont._x;
  669.       var iRB_width = _loc2_.c_objRef.mc_textcont._width;
  670.       var _iBoxHeight;
  671.       var _iGapOffset = 0;
  672.       _loc2_.c_objRef.txt_QuestionNo.text = _loc2_.c_objQuestionData.attributes.number;
  673.       _loc2_.c_objRef.txt_Question.autoSize = true;
  674.       _loc2_.c_objRef.txt_Question.multiline = true;
  675.       _loc2_.c_objRef.txt_Question.html = true;
  676.       _loc2_.c_objRef.txt_Question.htmlText = _loc2_.c_objQuestionData.text.data;
  677.       _iBoxHeight = _loc2_.c_objRef.txt_Question._height + iHeaderHeight + _iMargin;
  678.       objRB.resizeBox(_loc2_.c_iWidth,_iBoxHeight,_loc2_.c_objRef.mc_textcont);
  679.       _loc2_.c_objRef.attachMovie("FScrollPaneSymbol","mc_SPmcqType6",1000);
  680.       _loc2_.c_objRef.mc_SPmcqType6.setScrollContent("SP_Content");
  681.       _loc2_.c_objRef.mc_SPmcqType6._y = _loc2_.c_objRef.txt_Question._y + _loc2_.c_objRef.txt_Question._height + 10;
  682.       _loc2_.c_objRef.mc_SPmcqType6._x = 10;
  683.       _loc2_.c_objRef.mc_SPmcqType6.setSize(460,95);
  684.       var mcContent = _loc2_.c_objRef.mc_SPmcqType6.getScrollContent();
  685.       var _loc1_ = 0;
  686.       while(_loc1_ < _loc2_.c_iTotalOptions)
  687.       {
  688.          mcContent.attachMovie("mc_ImageL1","mc_ImageL" + (_loc1_ + 1),11 + _loc1_);
  689.          mcContent.attachMovie("mc_LMCQChoice1","mc_MCQChoiceL" + (_loc1_ + 1),25 + _loc1_);
  690.          var mcImage = mcContent["mc_ImageL" + (_loc1_ + 1)];
  691.          var _loc3_ = mcContent["mc_MCQChoiceL" + (_loc1_ + 1)];
  692.          _loc3_.txt_ChoiceOption.autoSize = true;
  693.          _loc3_.txt_ChoiceOption.html = true;
  694.          _loc3_.txt_ChoiceOption.htmlText = _loc2_.c_objQuestionData.choice[_loc1_].data;
  695.          mcImage._y = (mcImage._height + 10) * _loc1_;
  696.          _loc3_._x = mcImage._x;
  697.          _loc3_._y = mcImage._y;
  698.          _loc3_.txt_Choice.text = String.fromCharCode(64 + (_loc1_ + 1));
  699.          _loc2_.c_objData.iCorrect == _loc1_ + 1 ? _loc2_.c_objRef._parent.MCQ_Q1.addChild(_loc3_,String(_loc1_ + 1),true) : _loc2_.c_objRef._parent.MCQ_Q1.addChild(_loc3_,String(_loc1_ + 1),false);
  700.          if(_loc2_.c_objTestRef.c_strMode == "Review")
  701.          {
  702.             mcContent["mc_TickCross" + (_loc1_ + 1)].removeMovieClip();
  703.             if(_loc1_ + 1 == _loc2_.c_objTestRef.c_objHMObject.attempted || _loc1_ + 1 == _loc2_.c_objData.iCorrect)
  704.             {
  705.                mcContent.attachMovie("mc_TickCross","mc_TickCross" + (_loc1_ + 1),31 + _loc1_,{_x:_loc3_._x + _loc3_._width,_y:_loc3_._y});
  706.             }
  707.          }
  708.          _loc1_ = _loc1_ + 1;
  709.       }
  710.       _loc2_.c_objRef.mc_SPmcqType6.refreshPane();
  711.       if(_loc2_.c_objTestRef.c_strMode == "Review")
  712.       {
  713.          if(_loc2_.c_objTestRef.c_objHMObject.attempted != _loc2_.c_objData.iCorrect)
  714.          {
  715.             if(_loc2_.c_objTestRef.c_objHMObject.attempted == 2 || _loc2_.c_objTestRef.c_objHMObject.attempted == 3)
  716.             {
  717.                mcContent["mc_TickCross" + _loc2_.c_objTestRef.c_objHMObject.attempted].gotoAndStop("INCORRECT");
  718.                mcContent["mc_TickCross" + _loc2_.c_objData.iCorrect].gotoAndStop("CORRECT");
  719.             }
  720.             else
  721.             {
  722.                mcContent["mc_TickCross" + _loc2_.c_objData.iCorrect].gotoAndStop("CORRECT");
  723.             }
  724.          }
  725.          else
  726.          {
  727.             mcContent["mc_TickCross" + _loc2_.c_objTestRef.c_objHMObject.attempted].gotoAndStop("CORRECT");
  728.          }
  729.       }
  730.    }
  731.    function showPairedMCQExtract()
  732.    {
  733.       var _loc3_ = this;
  734.       var iPairCount = 2;
  735.       var iPairID = _loc3_.c_objTestRef.c_iPairID;
  736.       var iChoiceYPos;
  737.       var objRB = new com.comp.ResizableBox();
  738.       objRB.addListener(_loc3_);
  739.       var objExtractData = _loc3_.c_objSection.extract[iPairID];
  740.       _loc3_.setExtractData(objExtractData,_loc3_.c_objRef);
  741.       objRB.resizeBox(_loc3_.c_objRef.mc_RefExtract._width,_loc3_.c_objRef.mc_RefExtract._height,_loc3_.c_objRef.mc_TextCount_Extract);
  742.       var i = 1;
  743.       while(i <= iPairCount)
  744.       {
  745.          var mcNewMCQController = _loc3_.c_objRef._parent.MCQ_Q1.attachMovie("ComponentMCQ","ComponentMCQ_" + i,10000 + i);
  746.          mcNewMCQController.init();
  747.          mcNewMCQController.objTimelineRef = _loc3_;
  748.          mcNewMCQController._x = -100;
  749.          mcNewMCQController._y = -100;
  750.          mcNewMCQController.c_bIsToggle = true;
  751.          mcNewMCQController._visible = false;
  752.          var iQuesID = iPairID * iPairCount + i;
  753.          var objQuestion = _loc3_.c_objSection.question[iQuesID - 1];
  754.          var iQuesNo = objQuestion.attributes.number;
  755.          var objChoices = objQuestion.choice;
  756.          var _loc2_ = _loc3_.c_objRef.attachMovie("pairedMCQ_Question","mc_QuestionPanel_" + i,i);
  757.          _loc2_._x = _loc3_.c_objRef["mc_PosQues_" + i]._x;
  758.          _loc2_._y = _loc3_.c_objRef["mc_PosQues_" + i]._y;
  759.          objRB.resizeBox(_loc2_.mc_textcontReference._width,_loc2_.mc_textcontReference._height,_loc2_.mc_textcont);
  760.          _loc3_.setQuestionData(objQuestion,_loc2_);
  761.          var mcScrollPane = _loc2_.attachMovie("FScrollPaneSymbol","mc_ScrollPaneQue",i);
  762.          mcScrollPane.setScrollContent("SP_Content");
  763.          mcScrollPane._x = _loc2_.mc_RefScrollPane._x;
  764.          mcScrollPane._y = _loc2_.txt_QuestionText._y + _loc2_.txt_QuestionText._height + 10;
  765.          mcScrollPane.setSize(_loc2_.mc_RefScrollPane._width,_loc2_.mc_RefScrollPane._height);
  766.          var mcScrollHolder = mcScrollPane.getScrollContent();
  767.          var iCorrectAns = objQuestion.attributes.correct;
  768.          var _loc1_ = 1;
  769.          while(_loc1_ <= objChoices.length)
  770.          {
  771.             var mcChoice = mcScrollHolder.attachMovie("mc_MCQChoice","mc_MCQChoice_" + _loc1_,_loc1_);
  772.             _loc3_.setChoiceData(objChoices[_loc1_ - 1],_loc1_,mcChoice,mcScrollHolder);
  773.             iCorrectAns == _loc1_ ? mcNewMCQController.addChild(mcChoice,String(_loc1_),true) : mcNewMCQController.addChild(mcChoice,String(_loc1_),false);
  774.             _loc2_.mc_ScrollPane.refreshPane();
  775.             _loc1_ = _loc1_ + 1;
  776.          }
  777.          if(_loc3_.c_objTestRef.c_strMode == "Review")
  778.          {
  779.             _loc3_.showCorrectIncorrect(iQuesNo,iCorrectAns,mcScrollHolder);
  780.             var objHMObject = _loc3_.c_objTestRef.c_hQuestionState["get"](String(_loc3_.c_strSkill + "_" + iQuesNo));
  781.             if(objHMObject != undefined && objHMObject != null)
  782.             {
  783.                mcNewMCQController.setSelect(String(objHMObject.attempted));
  784.             }
  785.             mcNewMCQController.freeze(true);
  786.          }
  787.          i++;
  788.       }
  789.       var iQuesNum = Number(_loc3_.c_objSection.question[_loc3_.c_objTestRef.c_iQuestionNo - 1].attributes.number);
  790.       var iCompID = (iQuesNum - 1) % 2 + 1;
  791.       _loc3_.deselectionAll(_loc3_.c_objRef,iPairCount);
  792.       _loc3_.showCurrentSelection(_loc3_.c_objRef,iCompID);
  793.    }
  794.    function showCorrectIncorrect(_QuesID, _CorrectAnswer, _ChoiceContainer)
  795.    {
  796.       var _loc1_ = this.c_objTestRef.c_hQuestionState["get"](String(this.c_strSkill + "_" + _QuesID));
  797.       var _loc2_ = Number(_loc1_.attempted);
  798.       if(_loc1_.correct == 0)
  799.       {
  800.          _ChoiceContainer["mc_MCQChoice_" + _loc2_].mc_TickCross.gotoAndStop("INCORRECT");
  801.       }
  802.       _ChoiceContainer["mc_MCQChoice_" + _CorrectAnswer].mc_TickCross.gotoAndStop("CORRECT");
  803.    }
  804.    function setExtractData(objExtractData, mcTemplate)
  805.    {
  806.       var _loc1_ = mcTemplate;
  807.       var _loc2_ = objExtractData.title.data;
  808.       var _loc3_ = objExtractData.text.data;
  809.       _loc1_.txt_ExtractTitle.autoSize = true;
  810.       _loc1_.txt_ExtractTitle.html = true;
  811.       _loc1_.txt_ExtractTitle.htmlText = true;
  812.       _loc1_.txt_ExtractText.html = true;
  813.       _loc1_.txt_ExtractText.autoSize = true;
  814.       _loc1_.txt_ExtractText.multiline = true;
  815.       _loc1_.txt_ExtractTitle.htmlText = _loc2_;
  816.       _loc1_.txt_ExtractText.htmlText = _loc3_;
  817.    }
  818.    function setQuestionData(objQuestionData, mcQuestionPanel)
  819.    {
  820.       var _loc1_ = mcQuestionPanel;
  821.       _loc1_.txt_QuestionNo.html = true;
  822.       _loc1_.txt_QuestionNo.htmlText = "<b>" + objQuestionData.attributes.number + "</b>";
  823.       _loc1_.txt_QuestionText.autoSize = true;
  824.       _loc1_.txt_QuestionText.multiline = true;
  825.       _loc1_.txt_QuestionText.html = true;
  826.       _loc1_.txt_QuestionText.htmlText = objQuestionData.text.data;
  827.    }
  828.    function setChoiceData(objChoiceData, iChoiceID, mcChoiceClip, mcScrollHolder)
  829.    {
  830.       var _loc1_ = mcChoiceClip;
  831.       _loc1_.txt_ChoiceID.html = true;
  832.       _loc1_.txt_ChoiceID.htmlText = "<b>" + String.fromCharCode(64 + iChoiceID) + "</b>";
  833.       _loc1_.txt_ChoiceText.autoSize = true;
  834.       _loc1_.txt_ChoiceText.multiline = true;
  835.       _loc1_.txt_ChoiceText.html = true;
  836.       _loc1_.txt_ChoiceText.htmlText = objChoiceData.data;
  837.       _loc1_._x = 5;
  838.       var _loc2_ = iChoiceID - 1;
  839.       _loc1_._y = mcScrollHolder["mc_MCQChoice_" + _loc2_]._y + mcScrollHolder["mc_MCQChoice_" + _loc2_]._height + 7;
  840.    }
  841.    function arrangeListening2()
  842.    {
  843.       var _objSection = this.c_objQuestionData;
  844.       var _iTotalQuestions = _objSection.question.length;
  845.       var _iFirstQuestionNum = Number(_objSection.question[0].attributes.number);
  846.       var _iLastQuestionNum = Number(_iTotalQuestions - 1) + _iFirstQuestionNum;
  847.       var currQue = this.c_objTestRef.c_iQuestionNo;
  848.       var scrollSetX = 0;
  849.       var scrollSetY;
  850.       var _iQuestionY = 0;
  851.       var strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
  852.       var objRB = new com.comp.ResizableBox();
  853.       this.c_objRef.mc_SPType_7.setScrollContent("mcEmpty");
  854.       var mcScrollContent = this.c_objRef.mc_SPType_7.getScrollContent("mcEmpty");
  855.       this.c_objRef.mc_SPType_7.setSize(this.c_iWidth,this.c_objRef.mc_scrollRefrence._height - 2);
  856.       this.c_objRef.mc_SPType_7._x = 130;
  857.       this.c_objRef.mc_scrollRefrence._x = 95;
  858.       var i = 1;
  859.       while(i <= _iTotalQuestions)
  860.       {
  861.          var objComponentMCQ = this.c_objRef._parent.attachMovie("ComponentMCQ","ComponentMCQ_" + i,10000 + i);
  862.          objComponentMCQ._x = -100;
  863.          objComponentMCQ._y = -100;
  864.          objComponentMCQ.objTimelineRef = this;
  865.          objComponentMCQ.init();
  866.          objComponentMCQ.c_bIsToggle = true;
  867.          objComponentMCQ._visible = false;
  868.          var _iCorrectAnswer = _objSection.question[i - 1].attributes.correct;
  869.          var _loc3_ = mcScrollContent.attachMovie("mc_QType7","mc_QuestionPanel_" + i,210 + i);
  870.          _loc3_._x = 10;
  871.          _loc3_._y = _iQuestionY;
  872.          objRB.disableBox(_loc3_.mc_textcont);
  873.          _loc3_.txt_QuestionNo.text = _objSection.question[i - 1].attributes.number;
  874.          _loc3_.txt_Question.html = true;
  875.          _loc3_.txt_Question.htmlText = _objSection.question[i - 1].text.data;
  876.          _loc3_.txt_Question.autoSize = true;
  877.          _loc3_.txt_Question._y += 5;
  878.          var _iTotalChoices = Number(_objSection.question[i - 1].choice.length);
  879.          var _loc1_ = undefined;
  880.          var _iChoiceY = _loc3_.txt_Question._y + _loc3_.txt_Question._height + 10;
  881.          var _loc2_ = 1;
  882.          while(_loc2_ <= _iTotalChoices)
  883.          {
  884.             _loc1_ = _loc3_.attachMovie("mc_MCQChoiceL_7","mc_MCQChoice_" + i + "_" + _loc2_,210 + i * _loc2_);
  885.             _loc1_._x = 10;
  886.             _loc1_._y = _iChoiceY;
  887.             _loc1_.txt_ChoiceText.html = true;
  888.             _loc1_.txt_ChoiceText.autoSize = true;
  889.             _loc1_.txt_ChoiceText.htmlText = _objSection.question[i - 1].choice[_loc2_ - 1].data;
  890.             _iChoiceY += _loc1_.txt_ChoiceText._height;
  891.             _loc1_.txt_ChoiceID.html = true;
  892.             _loc1_.txt_ChoiceID.htmlText = "<b>" + String.fromCharCode(64 + _loc2_) + "</b>";
  893.             _loc1_.mc_TickCross.gotoAndStop("BLANK");
  894.             Number(_iCorrectAnswer) == Number(_loc2_) ? objComponentMCQ.addChild(_loc1_,String(_loc2_),true) : objComponentMCQ.addChild(_loc1_,String(_loc2_),false);
  895.             _loc2_ = _loc2_ + 1;
  896.          }
  897.          if(strEnvironment == "Linux")
  898.          {
  899.             var totHeight = _loc1_._y + _loc1_.txt_ChoiceText._height + 10;
  900.          }
  901.          else
  902.          {
  903.             var totHeight = _loc1_._y + _loc1_.txt_ChoiceText._height;
  904.          }
  905.          objRB.resizeBox(this.c_iWidth - 20,totHeight,_loc3_.mc_textcont);
  906.          objRB.addListener(this);
  907.          _iQuestionY = _loc3_._y + _loc3_._height + 5;
  908.          this.showType7Feedback(_loc3_);
  909.          i++;
  910.       }
  911.       this.c_objRef.mc_SPType_7.refreshPane();
  912.       this.c_objRef.btn_next._x = this.c_objRef.mc_scrollRefrence._x + this.c_objRef.mc_scrollRefrence._width + 40;
  913.       this.c_objRef.btn_next._y = this.c_objRef.mc_scrollRefrence._y + this.c_objRef.mc_scrollRefrence._height - this.c_objRef.btn_next._height - 2;
  914.       if(currQue == 1)
  915.       {
  916.          scrollSetY = 0;
  917.       }
  918.       else
  919.       {
  920.          scrollSetY = mcScrollContent["mc_QuestionPanel_" + currQue]._y - 90;
  921.       }
  922.       this.c_objRef.mc_SPType_7.setScrollPosition(scrollSetX,scrollSetY);
  923.    }
  924.    function showListeningQSelection()
  925.    {
  926.       var _loc1_ = this;
  927.       var _loc2_ = _loc1_.c_objRef.mc_SPType_7.getScrollContent();
  928.       var _loc3_ = _loc1_.c_objTestRef.c_strCurrSelected;
  929.       _loc1_.deselectionAll(_loc2_);
  930.       _loc1_.showCurrentSelection(_loc2_,_loc3_);
  931.    }
  932.    function showType7Feedback(mcQuestionHolder)
  933.    {
  934.       var _loc3_ = mcQuestionHolder;
  935.       var _loc2_ = Number(_loc3_._name.split("_")[2]);
  936.       var objQuesData = this.c_objSection.question[_loc2_ - 1];
  937.       var iChoiceCount = objQuesData.choice.length;
  938.       var _loc1_ = 1;
  939.       while(_loc1_ <= iChoiceCount)
  940.       {
  941.          _loc3_["mc_MCQChoice_" + _loc2_ + "_" + _loc1_].mc_TickCross.gotoAndStop("BLANK");
  942.          _loc1_ = _loc1_ + 1;
  943.       }
  944.       if(this.c_objTestRef.c_strMode == "Review")
  945.       {
  946.          var strQuesNum = objQuesData.attributes.number;
  947.          var objHMData = this.c_objTestRef.c_hQuestionState["get"](String(this.c_strSkill + "_" + strQuesNum));
  948.          var strAttempted = objHMData.attempted;
  949.          var strCorrectID = objQuesData.attributes.correct;
  950.          if(strAttempted != strCorrectID)
  951.          {
  952.             _loc3_["mc_MCQChoice_" + _loc2_ + "_" + strAttempted].mc_TickCross.gotoAndStop("INCORRECT");
  953.          }
  954.          _loc3_["mc_MCQChoice_" + _loc2_ + "_" + strCorrectID].mc_TickCross.gotoAndStop("CORRECT");
  955.       }
  956.    }
  957.    function arrangeListening4()
  958.    {
  959.       var _loc3_ = this;
  960.       var _objSection = _loc3_.c_objTestRef.c_objScreenData.DOC.section[Number(_loc3_.c_strMCQType - 1)];
  961.       var _iTotalQuestions = _objSection.question.length;
  962.       var _iFirstQuestionNum = Number(_objSection.question[0].attributes.number);
  963.       var _iLastQuestionNum = Number(_iTotalQuestions - 1) + _iFirstQuestionNum;
  964.       var _loc2_ = 1;
  965.       while(_loc2_ <= _iTotalQuestions)
  966.       {
  967.          var _TFQuestionTitle = _loc3_.c_objRef["txt_QuestionNo_" + _loc2_];
  968.          var _TFQuestionText = _loc3_.c_objRef["txt_Question_" + _loc2_];
  969.          var _objQuestionData = _objSection.question[_loc2_ - 1];
  970.          var _iCorrectAnswer = _objQuestionData.attributes.correct;
  971.          _TFQuestionTitle.autoSize = true;
  972.          _TFQuestionTitle.multiline = true;
  973.          _TFQuestionTitle.html = true;
  974.          _TFQuestionTitle.htmlText = "<b>" + _objQuestionData.attributes.number + "</b>";
  975.          _TFQuestionText.text = _objQuestionData.text.data;
  976.          var _loc1_ = 1;
  977.          while(_loc1_ <= _loc3_.c_iTotalOptions)
  978.          {
  979.             var mcChoice = _loc3_.c_objRef["mc_Choice_" + _loc2_ + "_" + _loc1_];
  980.             var txtChoice = _objQuestionData.choice[_loc1_ - 1].data;
  981.             mcChoice.txt_ChoiceText.text = txtChoice.toUpperCase();
  982.             Number(_iCorrectAnswer) == Number(_loc1_) ? _loc3_.c_objRef._parent["MCQ_Q_1" + _loc2_].addChild(mcChoice,String(_loc1_),true) : _loc3_.c_objRef._parent["MCQ_Q_1" + _loc2_].addChild(mcChoice,String(_loc1_),false);
  983.             _loc1_ = _loc1_ + 1;
  984.          }
  985.          _loc2_ = _loc2_ + 1;
  986.       }
  987.       _loc3_.c_objRef.btn_next._x = 620;
  988.       _loc3_.c_objRef.btn_next._y = 340;
  989.    }
  990.    function setOptions()
  991.    {
  992.       var _loc2_ = this;
  993.       var _loc1_ = 1;
  994.       while(_loc1_ <= _loc2_.c_objData.iTotalOptions)
  995.       {
  996.          _loc2_.c_objData.iCorrect == _loc1_ ? _loc2_.c_objRef.MCQ_Q1.addChild(_loc2_.c_objRef["MCQ_Q" + _loc1_],String(_loc1_),true) : _loc2_.c_objRef.MCQ_Q1.addChild(_loc2_.c_objRef["MCQ_Q" + _loc1_],String(_loc1_),false);
  997.          _loc1_ = _loc1_ + 1;
  998.       }
  999.    }
  1000.    function getAttempted(_objCompRef)
  1001.    {
  1002.       var _loc1_ = this;
  1003.       var _loc2_ = new Object();
  1004.       var _loc3_ = undefined;
  1005.       _loc1_.c_strSkill = _loc1_.c_objTestRef.c_strSkill;
  1006.       _loc1_.c_objRef = _level101[_loc1_.c_strMCQType];
  1007.       if(_loc1_.c_strMCQType == "MCQType_7")
  1008.       {
  1009.          var mcScrollContent = _loc1_.c_objRef.mc_SPType_7.getScrollContent();
  1010.          var _objSection = _loc1_.c_objQuestionData;
  1011.          _loc1_.c_objTestRef.c_strCurrSelected = _objCompRef._name.charAt(_objCompRef._name.length - 1);
  1012.          _loc1_.c_objTestRef.c_iCurrQuestion = _objSection.question[_loc1_.c_objTestRef.c_strCurrSelected - 1].attributes.number;
  1013.          if(_loc1_.c_objTestRef.c_strPreSelected != _loc1_.c_objTestRef.c_strCurrSelected)
  1014.          {
  1015.             _loc1_.c_objTestRef.setMCQSelection(_loc1_.c_objRef["mc_textcont_" + _loc1_.c_objTestRef.c_strCurrSelected]);
  1016.          }
  1017.          _loc3_ = _loc1_.c_objRef._parent["ComponentMCQ_" + _loc1_.c_objTestRef.c_strCurrSelected].c_mCurrentSelection;
  1018.          var _iTotalQuestions = _objSection.question.length;
  1019.          _loc1_.deselectionAll(mcScrollContent,_iTotalQuestions);
  1020.          var iQuesPanelID = _loc1_.c_objTestRef.c_strCurrSelected;
  1021.          _loc1_.showCurrentSelection(mcScrollContent,iQuesPanelID);
  1022.          _loc1_.showNavigationSelection();
  1023.       }
  1024.       else if(_loc1_.c_strMCQType == "PairedMCQScrolling" || _loc1_.c_strMCQType == "PairedMCQExtract")
  1025.       {
  1026.          var iPairCount = 2;
  1027.          var iCompID = Number(_objCompRef._name.split("_")[1]);
  1028.          _loc1_.c_objTestRef.c_strCurrSelected = _loc1_.c_objTestRef.c_iPairID * iPairCount + iCompID;
  1029.          _loc1_.c_objTestRef.c_iCurrQuestion = _loc1_.c_objSection.question[_loc1_.c_objTestRef.c_strCurrSelected - 1].attributes.number;
  1030.          _loc3_ = _loc1_.c_objRef._parent.MCQ_Q1["ComponentMCQ_" + iCompID].c_mCurrentSelection;
  1031.          var mcScrollContent;
  1032.          if(_loc1_.c_strMCQType == "PairedMCQScrolling")
  1033.          {
  1034.             mcScrollContent = _loc1_.c_objRef.mc_ScrollPaneQue.getScrollContent();
  1035.          }
  1036.          else if(_loc1_.c_strMCQType == "PairedMCQExtract")
  1037.          {
  1038.             mcScrollContent = _loc1_.c_objRef;
  1039.          }
  1040.          _loc1_.deselectionAll(mcScrollContent,iPairCount);
  1041.          _loc1_.showCurrentSelection(mcScrollContent,iCompID);
  1042.          if(_loc1_.c_objTestRef.c_strMode != "Review")
  1043.          {
  1044.             _loc1_.showNavigationSelection();
  1045.          }
  1046.       }
  1047.       else
  1048.       {
  1049.          _loc3_ = _loc1_.c_objRef._parent.MCQ_Q1.c_mCurrentSelection;
  1050.       }
  1051.       var strSelected = String(_loc3_);
  1052.       _loc2_.correct = !_loc3_.bValue ? 0 : 1;
  1053.       _loc2_.attempted = strSelected.charAt(strSelected.length - 1);
  1054.       var objScreen = new Object();
  1055.       objScreen.attempted = _loc2_.attempted;
  1056.       objScreen.correct = _loc2_.correct;
  1057.       if(_loc1_.c_strMCQType == "FIBType_3")
  1058.       {
  1059.          _loc1_.handleFIBAttempted(_objCompRef);
  1060.       }
  1061.       var mcChoice = _loc1_.c_objRef.MCQContainer["mc_MCQChoice" + Number(_loc2_.attempted)];
  1062.       if(_loc1_.c_strMCQType == "MCQType_1" || _loc1_.c_strMCQType == "MCQType_5")
  1063.       {
  1064.          _loc1_.c_objTestRef.c_objFIB2.updateText(mcChoice.txt_ChoiceText.text);
  1065.       }
  1066.       if(_loc1_.c_strMCQType != "FIBType_3")
  1067.       {
  1068.          _loc1_.c_objTestRef.appendQuesObject(objScreen);
  1069.          _loc1_.c_objTestRef.c_objNavigator.markAttempted();
  1070.       }
  1071.       if(_loc1_.c_objTestRef.c_strMode != "Review")
  1072.       {
  1073.          _loc1_.showNextButton();
  1074.       }
  1075.    }
  1076.    function deselectionAll(mcScrollContent)
  1077.    {
  1078.       var _objSection = this.c_objTestRef.c_objScreenData.DOC.section[this.c_objTestRef.c_iPartNo];
  1079.       var _loc3_ = _objSection.question.length;
  1080.       var _loc2_ = new com.comp.ResizableBox();
  1081.       var _loc1_ = 0;
  1082.       while(_loc1_ < _loc3_)
  1083.       {
  1084.          _loc2_.disableBox(mcScrollContent["mc_QuestionPanel_" + (_loc1_ + 1)].mc_textcont);
  1085.          _loc1_ = _loc1_ + 1;
  1086.       }
  1087.    }
  1088.    function showCurrentSelection(mcScrollContent, iQuesPanelID)
  1089.    {
  1090.       var _loc1_ = new com.comp.ResizableBox();
  1091.       _loc1_.enableBox(mcScrollContent["mc_QuestionPanel_" + iQuesPanelID].mc_textcont);
  1092.    }
  1093.    function showNavigationSelection()
  1094.    {
  1095.       var _loc1_ = this;
  1096.       var _loc3_ = Number(_loc1_.c_objTestRef.c_iPartNo);
  1097.       var _loc2_ = Number(_loc1_.c_objTestRef.c_strCurrSelected) - 1;
  1098.       _loc1_.c_objTestRef.c_objNavigator.c_iSeleID = _loc1_.c_objTestRef.c_iCurrQuestion;
  1099.       _loc1_.c_objTestRef.c_objNavigator.c_preSelecetd = _loc1_.c_objTestRef.c_objNavigator.c_strSelecetd;
  1100.       _loc1_.c_objTestRef.c_objNavigator.c_strSelecetd = String("_" + _loc3_ + "_" + _loc2_);
  1101.       _loc1_.c_objTestRef.c_objNavigator.navClickedfunction();
  1102.    }
  1103.    function showNextButton()
  1104.    {
  1105.       var _loc1_ = this;
  1106.       var iTotalSections = _loc1_.c_objTestRef.c_objScreenData.DOC.section.length;
  1107.       var iCurrentSectionID = Number(_loc1_.c_objTestRef.c_iPartNo) + 1;
  1108.       var iCurrentPairID = Number(_loc1_.c_objTestRef.c_iPairID);
  1109.       var iTotalQues = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question.length;
  1110.       var iTotalPairs = iTotalQues / 2;
  1111.       var _loc3_ = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].attributes.navType;
  1112.       if(_loc3_ == "2" && iCurrentSectionID != iTotalSections)
  1113.       {
  1114.          var objQuestion = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question;
  1115.          var iPartLength = Number(objQuestion.length);
  1116.          var iFirstQues = Number(objQuestion[0].attributes.number);
  1117.          var iLastQues = Number(objQuestion[iPartLength - 1].attributes.number);
  1118.          _loc1_.c_objRef.btn_next._visible = _loc1_.showNextForNavPart(iFirstQues,iLastQues);
  1119.       }
  1120.       else
  1121.       {
  1122.          _loc1_.c_objRef.btn_next._visible = false;
  1123.       }
  1124.       if(_loc3_ == "3" && iCurrentSectionID != iTotalSections)
  1125.       {
  1126.          var objQuestion = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question;
  1127.          var iPairId = _loc1_.c_objTestRef.c_iPairID;
  1128.          var iSelectNo = iPairId * 2;
  1129.          var iPFirstNumber = objQuestion[iSelectNo].attributes.number;
  1130.          var iPSecondNumber = objQuestion[iSelectNo + 1].attributes.number;
  1131.          var bShowNext = _loc1_.showNextForNavPart(iPFirstNumber,iPSecondNumber);
  1132.          _loc1_.c_objRef.btn_next._visible = bShowNext;
  1133.       }
  1134.       if(_loc3_ == "1" || _loc1_.c_strMCQType == "MCQType_5")
  1135.       {
  1136.          var _loc2_ = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo];
  1137.          var iSectionLength = Number(_loc2_.question.length);
  1138.          var iLastQuesNum = Number(_loc2_.question[iSectionLength - 1].attributes.number);
  1139.          var iCurrentQuesNum = Number(_loc2_.question[_loc1_.c_objTestRef.c_iQuestionNo - 1].attributes.number);
  1140.          _loc1_.c_objRef.btn_next._visible = !(iCurrentQuesNum == iLastQuesNum && iCurrentSectionID == iTotalSections);
  1141.       }
  1142.    }
  1143.    function showNextForNavPart(iFirstQues, iLastQues)
  1144.    {
  1145.       var _loc3_ = this;
  1146.       var bShowNext = false;
  1147.       var iAttempted = 0;
  1148.       var iPartLength = iLastQues - iFirstQues + 1;
  1149.       var _loc1_ = iFirstQues;
  1150.       while(_loc1_ <= iLastQues)
  1151.       {
  1152.          var _loc2_ = _loc3_.c_objTestRef.c_hQuestionState["get"](String(_loc3_.c_strSkill + "_" + _loc1_));
  1153.          if(_loc2_.attempted == null)
  1154.          {
  1155.             break;
  1156.          }
  1157.          iAttempted++;
  1158.          _loc1_ = _loc1_ + 1;
  1159.       }
  1160.       bShowNext = iAttempted == iPartLength;
  1161.       return bShowNext;
  1162.    }
  1163.    function handleFIBAttempted(_objCompRef)
  1164.    {
  1165.       var _loc1_ = this;
  1166.       var _loc2_ = new Object();
  1167.       var mcSelected = _loc1_.c_objRef._parent.MCQ_Q1.c_mCurrentSelection;
  1168.       var strSelected = String(mcSelected);
  1169.       _loc1_.c_objTestRef.StoreOptioncliked(strSelected,_objCompRef,mcSelected.bValue);
  1170.       var _iMaxWordLimit = Number(_loc1_.c_objSection.attributes.maxWords);
  1171.       _loc2_.correct = !mcSelected.bValue ? 0 : 1;
  1172.       _loc2_.attempted = mcSelected._name.split("_")[1];
  1173.       _loc1_.c_mcSelected = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].txt_Question;
  1174.       var objScreen = new Object();
  1175.       objScreen.attempted = _loc2_.attempted;
  1176.       objScreen.correct = _loc2_.correct;
  1177.       var arrSplit = _objCompRef._name.split("_");
  1178.       if(arrSplit[arrSplit.length - 1] != "child")
  1179.       {
  1180.          var _loc3_ = new Object();
  1181.          var strQuestionName = _loc1_.c_strSkill.toLowerCase() + _loc1_.c_objTestRef.c_iCurrQuestion;
  1182.          _loc3_ = _loc1_.c_objTestRef.c_hQuestionState["get"](strQuestionName);
  1183.          if(_loc3_ == null || _loc3_ == undefined)
  1184.          {
  1185.             _loc3_ = new Object();
  1186.          }
  1187.          if(_loc1_.c_objTestRef.c_strMode != "Review" && _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.length < 0)
  1188.          {
  1189.             _loc3_.answeroption = _loc2_.attempted;
  1190.             _loc3_.attempted = _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.text;
  1191.             _loc1_.c_objTestRef.appendQuesObject(_loc3_);
  1192.          }
  1193.          _loc1_.c_PrintQuestionNo = _loc1_.c_objQuestionData.attributes.number;
  1194.          _loc1_.resetMcq7();
  1195.          var objResizeBox = new com.comp.ResizableBox();
  1196.          objResizeBox.enableBox(_loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].mc_textcont);
  1197.          var objRBox = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].mc_textcont;
  1198.          var objQuesField = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].txt_Question;
  1199.          var objFootField = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].txt_footer;
  1200.          var iHeaderHeight = objResizeBox.getHeaderHeight(_loc1_.c_objRef.mc_textcont);
  1201.          var iBoxHeight = objFootField._y - objQuesField._y + objFootField._height + iHeaderHeight + 46;
  1202.          if(_loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].hasChild)
  1203.          {
  1204.             var iAddHeight = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].addHeight;
  1205.             objResizeBox.resizeBox(318,iBoxHeight + iAddHeight,objRBox);
  1206.             _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].objChildMCQ.freeze(false);
  1207.          }
  1208.          else
  1209.          {
  1210.             objResizeBox.resizeBox(318,iBoxHeight,objRBox);
  1211.          }
  1212.          if(mcSelected != undefined)
  1213.          {
  1214.             _loc1_.setEvents();
  1215.          }
  1216.          if(_loc1_.c_objTestRef.c_strMode != "Review")
  1217.          {
  1218.             _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.type = "input";
  1219.             Selection.setFocus(_loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt);
  1220.          }
  1221.          else if(_loc1_.c_objTestRef.c_strMode == "Review")
  1222.          {
  1223.             _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.type = "dynamic";
  1224.          }
  1225.          _loc1_.c_objRef.mc_ScrollContent.gotoAndStop(2);
  1226.          var objWC = new com.comp.WordCount(_loc1_.c_objRef.mc_ScrollContent,"inptxt_WCtxt","dyntxt_WC",_loc1_.c_objTestRef,_iMaxWordLimit);
  1227.          if(_loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.maxscroll > 1)
  1228.          {
  1229.             _loc1_.c_objRef.mc_ScrollContent.cmp_ScrollBar._visible = true;
  1230.             _loc1_.c_objRef.mc_ScrollContent.cmp_ScrollBar1._visible = true;
  1231.          }
  1232.          else
  1233.          {
  1234.             _loc1_.c_objRef.mc_ScrollContent.cmp_ScrollBar._visible = false;
  1235.          }
  1236.          _loc1_.c_objRef.mc_ScrollContent.txt_Header.text = "Question " + _loc1_.c_objQuestionData.text[_loc2_.attempted - 1].attributes.ref;
  1237.          _loc1_.c_PrintQuestionNo = _loc1_.c_objQuestionData.text[_loc2_.attempted - 1].attributes.ref;
  1238.       }
  1239.    }
  1240.    function setEvents()
  1241.    {
  1242.       var _btnObjRef = this;
  1243.       this.c_objRef.btn_PrintFib3.enabled = true;
  1244.       this.c_objRef.btn_PrintFib3.onRelease = function()
  1245.       {
  1246.          var _questionTxt = _btnObjRef.c_mcSelected.htmlText;
  1247.          var _loc3_ = _btnObjRef.c_PrintQuestionNo;
  1248.          var _iTestNum = _btnObjRef.c_objSection.attributes.test;
  1249.          var _loc2_ = _btnObjRef.c_objSection.attributes.skill;
  1250.          _loc2_ = _loc2_.charAt(0).toUpperCase() + _loc2_.substr(1,_loc2_.length);
  1251.          var _loc1_ = _btnObjRef.c_objSection.attributes.type;
  1252.          _loc1_ = _loc1_.charAt(0).toUpperCase() + _loc1_.substr(1,_loc1_.length - 1);
  1253.          _loc1_ = _loc1_.substr(0,_loc1_.length - 1) + " " + _loc1_.substr(-1);
  1254.          var _headerText = com.controller.UICoordinator.getInstance().getTitle() + " - Test: " + _loc2_ + " " + _loc1_;
  1255.          com.comp.PrintManager.printIt(_level101.printText_mc,_headerText,_btnObjRef.c_struserName,_loc3_,_questionTxt,_btnObjRef.c_objRef.mc_ScrollContent.inptxt_WCtxt.text);
  1256.       };
  1257.    }
  1258.    function resetMcq7()
  1259.    {
  1260.       var _loc2_ = this;
  1261.       var objRB = new com.comp.ResizableBox();
  1262.       var _loc1_ = 1;
  1263.       while(_loc1_ <= _loc2_.c_iTotalOptions)
  1264.       {
  1265.          var objRBox = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mc_textcont;
  1266.          objRB.disableBox(_loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mc_textcont);
  1267.          var _loc3_ = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_Question;
  1268.          var objFootField = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_footer;
  1269.          var iHeaderHeight = objRB.getHeaderHeight(_loc2_.c_objRef.mc_textcont);
  1270.          _loc3_.autoSize = true;
  1271.          _loc3_.htmlText = _loc2_.c_objQuestionData.text[_loc1_ - 1].questionText.data;
  1272.          var iAddHeight = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight;
  1273.          if(_loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].hasChild)
  1274.          {
  1275.             objRB.resizeBox(318,_loc3_._height + iHeaderHeight + 46 + iAddHeight,objRBox);
  1276.             _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].objChildMCQ.reset();
  1277.             _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].objChildMCQ.freeze(true);
  1278.          }
  1279.          else
  1280.          {
  1281.             objRB.resizeBox(318,objFootField._y - _loc3_._y + objFootField._height + iHeaderHeight + 46,objRBox);
  1282.          }
  1283.          _loc1_ = _loc1_ + 1;
  1284.       }
  1285.       _loc2_.c_objRef.mc_ScrollPane.refreshPane();
  1286.    }
  1287.    function selectQuestion(strQuestionNumber)
  1288.    {
  1289.       var _loc3_ = this;
  1290.       var iTotalQuestions = _loc3_.c_objSection.question.length;
  1291.       var _loc2_ = undefined;
  1292.       var iQuesID = 0;
  1293.       if(iTotalQuestions == undefined || iTotalQuestions == null || iTotalQuestions == "")
  1294.       {
  1295.          iTotalQuestions = 1;
  1296.       }
  1297.       var _loc1_ = 0;
  1298.       while(_loc1_ < iTotalQuestions)
  1299.       {
  1300.          _loc2_ = _loc3_.c_objSection.question[_loc1_];
  1301.          if(_loc2_ == undefined || _loc2_ == null)
  1302.          {
  1303.             _loc2_ = _loc3_.c_objSection.question;
  1304.          }
  1305.          if(_loc2_.attributes.number == strQuestionNumber)
  1306.          {
  1307.             iQuesID = _loc1_;
  1308.             _loc3_.c_objTestRef.c_strCurrSelected = iQuesID + 1;
  1309.             break;
  1310.          }
  1311.          _loc1_ = _loc1_ + 1;
  1312.       }
  1313.       _loc3_.c_objTestRef.c_iCurrQuestion = strQuestionNumber;
  1314.       _loc3_.showNavigationSelection();
  1315.       _loc3_.showQuestionSelection(_loc3_.c_objTestRef.c_strCurrSelected);
  1316.    }
  1317.    function showQuestionSelection(strQuestionID)
  1318.    {
  1319.       var _loc1_ = this;
  1320.       var _loc2_ = 2;
  1321.       switch(_loc1_.c_strMCQType)
  1322.       {
  1323.          case "PairedMCQExtract":
  1324.             var iCompID = (strQuestionID - 1) % 2 + 1;
  1325.             _loc1_.deselectionAll(_loc1_.c_objRef,_loc2_);
  1326.             _loc1_.showCurrentSelection(_loc1_.c_objRef,iCompID);
  1327.             break;
  1328.          case "PairedMCQScrolling":
  1329.             var iCompID = (strQuestionID - 1) % 2 + 1;
  1330.             var _loc3_ = _loc1_.c_objRef.mc_ScrollPaneQue.getScrollContent();
  1331.             _loc1_.deselectionAll(_loc3_,_loc2_);
  1332.             _loc1_.showCurrentSelection(_loc3_,iCompID);
  1333.             break;
  1334.          case "MCQType_7":
  1335.             _loc1_.showListeningQSelection();
  1336.       }
  1337.    }
  1338. }
  1339.