home *** CD-ROM | disk | FTP | other *** search
Text File | 2007-09-06 | 62.6 KB | 1,339 lines |
- class com.screen.MCQ
- {
- var c_objTestRef;
- var c_iTest;
- var onEnterFrame;
- var c_iQuestionID;
- var c_objRef;
- var c_iTotalOptions;
- var c_strSkill;
- var c_iWidth;
- var c_objQuestionData;
- var c_objSection;
- var c_iQuesSB = 0;
- function MCQ(_objTestRef)
- {
- this.c_objTestRef = _objTestRef;
- this.c_iTest = 20;
- }
- function init(_iTotalOptions, _iCorrect, _objData, _objRef, _iWidth, _strMCQType, _objSection, _strSkill, _blnLoadImage, _iQID)
- {
- var _loc1_ = this;
- _loc1_.c_iWidth = _iWidth;
- _loc1_.c_strMCQType = _strMCQType;
- _loc1_.c_iTotalOptions = _iTotalOptions;
- _loc1_.c_objRef = _objRef;
- _loc1_.c_objQuestionData = _objData;
- _loc1_.c_objSection = _objSection;
- _loc1_.c_objData = new Object();
- _loc1_.c_objData.iTotalOptions = _iTotalOptions;
- _loc1_.c_objData.iCorrect = _iCorrect;
- _loc1_.c_iQuestionID = _iQID;
- _loc1_.c_struserName = com.controller.UICoordinator.getInstance().userName;
- _loc1_.c_strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
- if(_loc1_.c_strMCQType == "MCQType_7")
- {
- _loc1_.c_objRef["MCQ_Q_" + _loc1_.c_iQuestionID].objTimelineRef = _loc1_.c_objRef;
- }
- else
- {
- _loc1_.c_objRef.MCQ_Q1.objTimelineRef = _loc1_.c_objRef;
- }
- _loc1_.c_strSkill = _strSkill;
- _loc1_.showMCQLayout(_blnLoadImage);
- }
- function showMCQLayout(_blnLoadImage)
- {
- var _loc1_ = this;
- switch(_loc1_.c_strMCQType)
- {
- case "MCQType_2":
- case "MCQType_4":
- case "MCQType_5":
- !_blnLoadImage ? _loc1_.arrange() : _loc1_.loadImage();
- break;
- case "MCQType_7":
- _loc1_.arrangeListening2();
- break;
- case "FIBType_3":
- _loc1_.arrangeFIBType3();
- break;
- case "MCQType_6":
- _loc1_.arrangeListening();
- break;
- case "PairedMCQScrolling":
- _loc1_.showPairedMCQScrolling();
- break;
- case "PairedMCQExtract":
- _loc1_.showPairedMCQExtract();
- }
- }
- function loadImage()
- {
- var _loc1_ = this;
- var mcSelf = _loc1_.c_objRef.mc_ImageHolder;
- var iScaleWidth = _loc1_.c_objRef.mc_Imagescaler._width;
- var iScaleHeight = _loc1_.c_objRef.mc_Imagescaler._height;
- var iHeight = mcSelf._height;
- var iWidth = mcSelf._width;
- if(_loc1_.c_objQuestionData.image != undefined && _loc1_.c_objQuestionData.image.data != undefined)
- {
- mcSelf.loadMovie("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/jpegs/" + _loc1_.c_objQuestionData.image.data);
- _loc1_.c_numFieldWidth = _loc1_.c_objRef.txt_Question._width - mcSelf._width;
- _loc1_.c_numFieldXpos = mcSelf._x + mcSelf._width + 6;
- }
- else
- {
- _loc1_.c_numFieldWidth = 317.25;
- _loc1_.c_numFieldXpos = mcSelf._x;
- }
- if(_loc1_.c_strMCQType == "MCQType_2")
- {
- _loc1_.c_objRef.onEnterFrame = function()
- {
- if(mcSelf._width != iWidth && mcSelf._width > 0)
- {
- mcSelf._width = iScaleWidth;
- mcSelf._height = iScaleHeight;
- delete this.onEnterFrame;
- }
- };
- }
- _loc1_.showMCQType2Data(mcSelf._height);
- }
- function showMCQType2Data(_iImageHeight)
- {
- var _loc1_ = this;
- _loc1_.c_objRef.txt_QuestionNo.text = _loc1_.c_objQuestionData.attributes.number;
- _loc1_.c_objRef.txt_Question._width = _loc1_.c_numFieldWidth;
- _loc1_.c_objRef.txt_Question._x = _loc1_.c_numFieldXpos + 10;
- _loc1_.c_objRef.txt_Question.autoSize = true;
- _loc1_.c_objRef.txt_Question.multiline = true;
- _loc1_.c_objRef.txt_Question.html = true;
- _loc1_.c_objRef.txt_Question.htmlText = _loc1_.c_objQuestionData.text.data;
- var objRB = new com.comp.ResizableBox();
- var iHeaderHeight = objRB.getHeaderHeight(_loc1_.c_objRef.mc_textcont);
- var iRB_ypos = _loc1_.c_objRef.mc_textcont._y;
- var iRB_xpos = _loc1_.c_objRef.mc_textcont._x;
- var iY;
- if(_loc1_.c_objQuestionData.text.data != undefined)
- {
- if(_loc1_.c_objRef.txt_Question.height > _iImageHeight)
- {
- iY = _loc1_.c_objRef.txt_Question.height + _loc1_.c_objRef.txt_Question._y + 10;
- }
- else if(_loc1_.c_objQuestionData.image != undefined && _loc1_.c_objQuestionData.image.data != undefined)
- {
- iY = _iImageHeight + _loc1_.c_objRef.txt_Question._y + 7;
- }
- else
- {
- iY = _loc1_.c_objRef.txt_Question._y + _loc1_.c_objRef.txt_Question.textHeight + 10;
- }
- }
- else
- {
- iY = iRB_ypos + iHeaderHeight + 10;
- }
- var iX = iRB_xpos + 10;
- var iHeight = 20;
- var iMargin = iY - (iRB_ypos + iHeaderHeight);
- var _loc3_ = undefined;
- _loc1_.c_objRef.mc_ScrollPane.setScrollContent("SP_Content");
- _loc1_.c_MCQContainer = _loc1_.c_objRef.mc_ScrollPane.getScrollContent();
- _loc1_.c_objRef.mc_ScrollPane._y = iY;
- var choicesYPos = _loc1_.c_MCQContainer._y;
- var mcFeedbackHolder = _loc1_.c_MCQContainer.createEmptyMovieClip("mcFeedbackHolder",21);
- var iResizeBoxHeight = iHeaderHeight + _loc1_.c_objRef.txt_Question._height + _loc1_.c_objRef.mc_ScrollPane._height + 10;
- var _loc2_ = 1;
- while(_loc2_ <= _loc1_.c_iTotalOptions)
- {
- _loc1_.c_MCQContainer.attachMovie("mc_MCQChoice2","mc_MCQChoice" + _loc2_,11 + _loc2_,{_x:_loc1_.c_MCQContainer._x,_y:choicesYPos});
- _loc3_ = _loc1_.c_MCQContainer["mc_MCQChoice" + _loc2_];
- _loc3_.txt_ChoiceText.text = _loc1_.c_objQuestionData.choice[_loc2_ - 1].attributes.id + " - " + _loc1_.c_objQuestionData.choice[_loc2_ - 1].data;
- var mcTick = mcFeedbackHolder.attachMovie("mc_TickCrossL","mc_TickCrossL_" + _loc2_,9000 + _loc2_,{_x:_loc3_._x + _loc3_._width - 25,_y:_loc3_._y});
- mcTick.gotoAndStop("BLANK");
- iHeight += _loc3_._height + 7;
- iY += _loc3_._height + 7;
- choicesYPos += _loc3_._height + 7;
- _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);
- _loc2_ = _loc2_ + 1;
- }
- _loc1_.c_objRef.mc_ScrollPane.refreshPane();
- if(_loc1_.c_objTestRef.c_strMode == "Review")
- {
- var strAttempted = _loc1_.c_objTestRef.c_objHMObject.attempted;
- var strCorrectID = _loc1_.c_objQuestionData.attributes.correct;
- if(strAttempted != strCorrectID)
- {
- mcFeedbackHolder["mc_TickCrossL_" + strAttempted].gotoAndStop("INCORRECT");
- mcFeedbackHolder["mc_TickCrossL_" + strCorrectID].gotoAndStop("CORRECT");
- }
- else
- {
- mcFeedbackHolder["mc_TickCrossL_" + strCorrectID].gotoAndStop("CORRECT");
- }
- }
- else
- {
- mcFeedbackHolder["mc_TickCrossL_" + strAttempted].gotoAndStop("BLANK");
- }
- objRB.resizeBox(_loc1_.c_iWidth,iResizeBoxHeight,_loc1_.c_objRef.mc_textcont);
- _loc1_.c_objRef.btn_next._x = iX + _loc1_.c_iWidth - (_loc1_.c_objRef.btn_next._width + 11);
- _loc1_.c_objRef.btn_next._y = _loc1_.c_objRef.mc_textcont._y + _loc1_.c_objRef.mc_textcont._height + 9;
- }
- function showPairedMCQScrolling()
- {
- var _loc1_ = this;
- var sectionTestRef = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo];
- var queDataTestRef = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question[_loc1_.c_objTestRef.c_iQuestionNo - 1];
- var queNoTestRef = _loc1_.c_objTestRef.c_iQuestionNo;
- var iPairCount = 2;
- var iPairID = _loc1_.c_objTestRef.c_iPairID;
- var blnIsPairChanged = _loc1_.c_objTestRef.c_iPairID != _loc1_.c_objTestRef.c_iPrevPairID;
- var blnIsPartChanged = _loc1_.c_objTestRef.c_objNavigator.c_blnPartChange;
- var _loc2_ = undefined;
- if(_loc1_.c_objTestRef.c_blnPairedScrolling && (blnIsPairChanged || blnIsPartChanged))
- {
- _loc2_ = _loc1_.c_objRef.attachMovie("FScrollPaneSymbol","mcReadingScroll",_loc1_.c_objRef.getNextHighestDepth());
- _loc2_.setScrollContent("mc_ScrollContent_Pair");
- _loc2_.setSize(_loc1_.c_objRef.mc_ScrollBarRef._width - 1,_loc1_.c_objRef.mc_ScrollBarRef._height - 1);
- _loc2_._x = _loc1_.c_objRef.mc_ScrollBarRef._x;
- _loc2_._y = _loc1_.c_objRef.mc_ScrollBarRef._y;
- _loc1_.c_objTestRef.c_blnPairedScrolling = false;
- }
- var mcScrollPaneCont = _loc2_.getScrollContent();
- var objParagraphData = _loc1_.c_objSection.text[iPairID];
- var objTitleData = _loc1_.c_objSection.title[iPairID];
- _loc1_.setParagraphData(objParagraphData,objTitleData,mcScrollPaneCont);
- _loc2_.refreshPane();
- var _loc3_ = _loc1_.c_objRef.attachMovie("FScrollPaneSymbol","mc_ScrollPaneQue",200);
- _loc3_.setScrollContent("SP_Content");
- _loc3_.setSize(_loc1_.c_objRef.mc_ScrollRightRef._width - 1,_loc1_.c_objRef.mc_ScrollRightRef._height - 2);
- _loc3_._x = _loc1_.c_objRef.mc_ScrollRightRef._x;
- _loc3_._y = _loc1_.c_objRef.mc_ScrollRightRef._y + 0.8;
- var MCQContainer = _loc3_.getScrollContent();
- _loc1_.showQuestion(MCQContainer,sectionTestRef,queNoTestRef,iPairID,2);
- _loc3_.refreshPane();
- _loc1_.setScrollBarPosition(_loc1_.c_objRef.mc_ScrollPaneQue);
- var iCompID = (queNoTestRef - 1) % 2 + 1;
- _loc1_.deselectionAll(MCQContainer,iPairCount);
- _loc1_.showCurrentSelection(MCQContainer,iCompID);
- }
- function setScrollBarPosition(mcSPane)
- {
- var _loc1_ = undefined;
- if(this.c_iQuestionID % 2 == 0)
- {
- _loc1_ = 210;
- }
- else
- {
- _loc1_ = 0;
- }
- mcSPane.setScrollPosition(0,_loc1_);
- }
- function setParagraphData(objParagraphData, objTitleData, mcTemplate)
- {
- var _loc1_ = mcTemplate;
- var _loc3_ = this;
- var strTitle = objTitleData.data;
- var strText = objParagraphData.data;
- var iScrollPaneW = _loc3_.c_objRef.mc_ScrollBarRef._width;
- var iScrollPaneH = _loc3_.c_objRef.mc_ScrollBarRef._height;
- var iScrollPaneX = _loc3_.c_objRef.mc_ScrollBarRef._x;
- var iScrollPaneY = _loc3_.c_objRef.mc_ScrollBarRef._y;
- _loc1_.createTextField("titleTxt",100,0,0,0,0);
- var _loc2_ = new TextFormat();
- _loc2_.font = "Verdana";
- _loc2_.size = 11;
- _loc1_.titleTxt.autoSize = true;
- _loc1_.titleTxt.selectable = false;
- _loc1_.titleTxt.html = true;
- if(_loc3_.c_strEnvironment == "Linux")
- {
- _loc1_.titleTxt.embedFonts = true;
- }
- _loc1_.titleTxt.htmlText = strTitle;
- _loc1_.titleTxt.setTextFormat(_loc2_);
- var strTextFormat = new TextFormat();
- strTextFormat.leftMargin = 5;
- _loc1_.txt_Description.autoSize = true;
- _loc1_.txt_Description.html = true;
- _loc1_.txt_Description.htmlText = strText;
- _loc1_.txt_Description.setTextFormat(strTextFormat);
- _loc1_.titleTxt._x = iScrollPaneX + 3;
- _loc1_.titleTxt._y = iScrollPaneY + 5;
- _loc1_.txt_Description._y = _loc1_.titleTxt.textHeight + 10;
- }
- function showQuestion(MCQContainer, sectionTestRef, queNoTestRef, iPairID, showQue)
- {
- var mcBox_xpos = 3;
- var mcBox_ypos = 3;
- var iPairCount = showQue;
- var objRB = new com.comp.ResizableBox();
- objRB.addListener(this);
- var j = 1;
- while(j <= showQue)
- {
- var iQuesID = iPairID * iPairCount + (j - 1);
- var _loc3_ = MCQContainer.attachMovie("mc_txtContContainer","mc_QuestionPanel_" + j,150 + j,{_x:mcBox_xpos,_y:mcBox_ypos});
- _loc3_.txt_Question.autoSize = true;
- _loc3_.txt_Question.html = true;
- _loc3_.txt_QuestionNo.html = true;
- _loc3_.txt_QuestionNo.htmlText = "<b>" + sectionTestRef.question[iQuesID].attributes.number + "</b>";
- _loc3_.txt_Question.htmlText = sectionTestRef.question[iQuesID].text.data;
- var iChoice_ypos;
- var mcNewMCQController = this.c_objRef._parent.MCQ_Q1.attachMovie("ComponentMCQ","ComponentMCQ_" + j,10000 + j);
- mcNewMCQController.init();
- mcNewMCQController.objTimelineRef = this;
- mcNewMCQController.c_bIsToggle = true;
- mcNewMCQController._visible = false;
- var _loc1_ = 1;
- while(_loc1_ <= this.c_iTotalOptions)
- {
- var _loc2_ = _loc3_.attachMovie("mc_PairedMCQChoice","mc_MCQChoice_" + _loc1_,200 + _loc1_);
- _loc2_.txt_ChoiceID.html = true;
- _loc2_.txt_ChoiceText.html = true;
- _loc2_.txt_ChoiceText.autoSize = true;
- _loc2_.txt_ChoiceID.htmlText = "<b>" + sectionTestRef.question[iQuesID].choice[_loc1_ - 1].attributes.id + "</b>";
- _loc2_.txt_ChoiceText.htmlText = sectionTestRef.question[iQuesID].choice[_loc1_ - 1].data;
- _loc2_._x = _loc3_.txt_Question._x;
- if(_loc1_ == 1)
- {
- iChoice_ypos = _loc3_.txt_Question._y + _loc3_.txt_Question.textHeight + 20;
- }
- else
- {
- iChoice_ypos = _loc3_["mc_MCQChoice_" + (_loc1_ - 1)]._y + _loc3_["mc_MCQChoice_" + (_loc1_ - 1)]._height + 10;
- }
- _loc2_._y = iChoice_ypos;
- var iCorrectAns = sectionTestRef.question[iQuesID].attributes.correct;
- iCorrectAns == _loc1_ ? mcNewMCQController.addChild(_loc2_,String(_loc1_),true) : mcNewMCQController.addChild(_loc2_,String(_loc1_),false);
- _loc1_ = _loc1_ + 1;
- }
- if(this.c_objTestRef.c_strMode == "Review")
- {
- var iCorrectAns = sectionTestRef.question[iQuesID].attributes.correct;
- var iQueNo = sectionTestRef.question[iQuesID].attributes.number;
- this.showCorrectIncorrect(iQueNo,iCorrectAns,_loc3_);
- var objHMObject = this.c_objTestRef.c_hQuestionState["get"](String(this.c_strSkill + "_" + iQueNo));
- var strAttemptedID = Number(objHMObject.attempted);
- if(objHMObject != undefined && objHMObject != null)
- {
- mcNewMCQController.setSelect(String(objHMObject.attempted));
- }
- mcNewMCQController.freeze(true);
- }
- var iRB_Height = iChoice_ypos + 48;
- objRB.resizeBox(this.c_iWidth,iRB_Height,_loc3_.mc_textcont);
- mcBox_ypos = iChoice_ypos + 63;
- j++;
- }
- }
- function arrange(_iImageHeight)
- {
- var _loc1_ = this;
- _loc1_.showQuesText();
- var objRB = new com.comp.ResizableBox();
- var iHeaderHeight = objRB.getHeaderHeight(_loc1_.c_objRef.mc_textcont);
- var iRB_ypos = _loc1_.c_objRef.mc_textcont._y;
- var iRB_xpos = _loc1_.c_objRef.mc_textcont._x;
- var iY;
- if(_loc1_.c_objQuestionData.text.data != undefined)
- {
- if(_loc1_.c_objRef.txt_Question.height > _iImageHeight)
- {
- iY = _loc1_.c_objRef.txt_Question.height + _loc1_.c_objRef.txt_Question._y + 10;
- }
- else
- {
- iY = _iImageHeight + _loc1_.c_objRef.txt_Question._y + 7;
- }
- }
- else
- {
- iY = iRB_ypos + iHeaderHeight + 10;
- }
- var iX = iRB_xpos + 10;
- var iHeight = 0;
- var iMargin = iY - (iRB_ypos + iHeaderHeight);
- var _loc3_ = undefined;
- if(_loc1_.c_strMCQType == "MCQType_2")
- {
- var mcScrollPane = _loc1_.c_objRef.attachMovie("FScrollPaneSymbol","mc_ScrollPane",600);
- mcScrollPane.setScrollContent("SP_Content");
- mcScrollPane.setSize(_loc1_.c_objRef.mcBg._width,_loc1_.c_objRef.mcBg._height);
- mcScrollPane._x = _loc1_.c_objRef.mcBg._x;
- mcScrollPane._y = _loc1_.c_objRef.mcBg._y;
- _loc1_.c_MCQContainer = mcScrollPane.getScrollContent();
- }
- var strChoidID = _loc1_.c_strMCQType.split("_")[1];
- var _loc2_ = 1;
- while(_loc2_ <= _loc1_.c_iTotalOptions)
- {
- if(_loc1_.c_strMCQType == "MCQType_5" || _loc1_.c_strMCQType == "MCQType_4")
- {
- _loc1_.c_objRef.createEmptyMovieClip("MCQContainer",600 + _loc2_);
- _loc3_ = _loc1_.c_objRef.MCQContainer.attachMovie("mc_MCQChoice" + strChoidID,"mc_MCQChoice" + _loc2_,11 + _loc2_,{_x:iX,_y:iY});
- }
- else if(_loc1_.c_strMCQType == "MCQType_2")
- {
- _loc3_ = _loc1_.c_MCQContainer.attachMovie("mc_MCQChoice" + strChoidID,"mc_MCQChoice" + _loc2_,600 + _loc2_,{_x:iX,_y:iY});
- }
- else
- {
- _loc3_ = _loc1_.c_objRef.attachMovie("mc_MCQChoice" + strChoidID,"mc_MCQChoice" + _loc2_,11 + _loc2_,{_x:iX,_y:iY});
- }
- if(_loc1_.c_strMCQType == "1" || _loc1_.c_strMCQType == "3" || _loc1_.c_strMCQType == "MCQType_4" || _loc1_.c_strMCQType == "MCQType_5")
- {
- _loc3_.txt_Choice.text = String.fromCharCode(64 + _loc2_);
- _loc3_.txt_ChoiceText.autoSize = true;
- _loc3_.txt_ChoiceText.html = true;
- _loc3_.txt_ChoiceText.htmlText = _loc1_.c_objQuestionData.choice[_loc2_ - 1].data;
- }
- else if(_loc1_.c_strMCQType == "MCQType_2")
- {
- _loc3_.txt_ChoiceText.text = String.fromCharCode(64 + _loc2_) + " - " + _loc1_.c_objSection.paragraph[_loc2_ - 1].title.data;
- }
- if(_loc1_.c_strMCQType == "MCQType_4" && _loc2_ == _loc1_.c_iTotalOptions)
- {
- _loc3_.txt_ChoiceText.htmlText = _loc1_.c_objQuestionData.choice[_loc2_ - 1].data + "\n\n";
- }
- else if(_loc1_.c_strMCQType == "MCQType_5" && _loc2_ == _loc1_.c_iTotalOptions)
- {
- _loc3_.txt_ChoiceText.htmlText = _loc1_.c_objQuestionData.choice[_loc2_ - 1].data + "\n\n";
- }
- if(_loc1_.c_objTestRef.c_strMode == "Review")
- {
- _loc1_.c_objRef["mc_TickCross" + _loc2_].removeMovieClip();
- _loc1_.c_objRef.MCQContainer["mc_TickCross" + _loc2_].removeMovieClip();
- if(_loc2_ == _loc1_.c_objTestRef.c_objHMObject.attempted || _loc2_ == _loc1_.c_objData.iCorrect)
- {
- if(_loc1_.c_strMCQType != "MCQType_4" || _loc1_.c_strMCQType != "MCQType_5")
- {
- _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});
- }
- else
- {
- _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});
- }
- }
- }
- if(_loc1_.c_strMCQType != "MCQType_2")
- {
- iHeight += _loc3_._height + 10;
- iY += _loc3_._height + 10;
- }
- else
- {
- iHeight += _loc3_._height + 7;
- iY += _loc3_._height + 7;
- }
- _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);
- _loc2_ = _loc2_ + 1;
- }
- if(_loc1_.c_strMCQType == "MCQType_2")
- {
- _loc1_.c_objRef.mc_ScrollPane.refreshPane();
- }
- var mcMovieRef;
- if(_loc1_.c_strMCQType != "MCQType_4" || _loc1_.c_strMCQType != "MCQType_5")
- {
- mcMovieRef = _loc1_.c_objRef["mc_TickCross" + _loc1_.c_objTestRef.c_objHMObject.attempted];
- }
- else
- {
- mcMovieRef = _loc1_.c_objRef.MCQContainer["mc_TickCross" + _loc1_.c_objTestRef.c_objHMObject.attempted];
- }
- if(_loc1_.c_objTestRef.c_strMode == "Review")
- {
- mcMovieRef.gotoAndStop("BLANK");
- 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")
- {
- mcMovieRef.gotoAndStop("CORRECT");
- }
- 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")
- {
- mcMovieRef.gotoAndStop("INCORRECT");
- }
- else
- {
- mcMovieRef.gotoAndStop("BLANK");
- }
- 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")
- {
- _loc1_.c_objRef["mc_TickCross" + _loc1_.c_objData.iCorrect].gotoAndStop("CORRECT");
- }
- }
- if(_loc1_.c_strMCQType == "MCQType_4" && _loc1_.c_objRef.MCQContainer._height >= 250 || _loc1_.c_strMCQType == "MCQType_5" && _loc1_.c_objRef.MCQContainer._height >= 250)
- {
- objRB.enableBox(_loc1_.c_objRef.mc_textcont);
- objRB.resizeBox(_loc1_.c_iWidth + 10,320,_loc1_.c_objRef.mc_textcont);
- }
- else
- {
- objRB.enableBox(_loc1_.c_objRef.mc_textcont);
- objRB.resizeBox(_loc1_.c_iWidth,iHeight + (iHeaderHeight + iMargin),_loc1_.c_objRef.mc_textcont);
- }
- if(_loc1_.c_strMCQType == 4 && _loc1_.c_objRef.MCQContainer._height >= 250)
- {
- _loc1_.c_objRef.btn_next._x = iX + _loc1_.c_iWidth - _loc1_.c_objRef.btn_next._width;
- _loc1_.c_objRef.btn_next._y = 335;
- }
- else
- {
- _loc1_.c_objRef.btn_next._x = iX + _loc1_.c_iWidth - (_loc1_.c_objRef.btn_next._width + 10);
- _loc1_.c_objRef.btn_next._y = iY + 7;
- }
- }
- function showQuesText()
- {
- var _loc1_ = this;
- var _loc2_ = new TextFormat();
- _loc2_.font = "Verdana";
- _loc2_.size = 11;
- _loc1_.c_objRef.txt_QuestionNo.text = _loc1_.c_objQuestionData.attributes.number;
- _loc1_.c_objRef.txt_Question.autoSize = true;
- _loc1_.c_objRef.txt_Question.multiline = true;
- if(_loc1_.c_strEnvironment == "Linux")
- {
- _loc1_.c_objRef.txt_Question.embedFonts = true;
- }
- _loc1_.c_objRef.txt_Question.html = true;
- _loc1_.c_objRef.txt_Question.htmlText = _loc1_.c_objQuestionData.text.data;
- _loc1_.c_objRef.txt_Question.setTextFormat(_loc2_);
- }
- function arrangeFIBType3()
- {
- var _loc2_ = this;
- _loc2_.c_objRef.btn_PrintFib3.enabled = false;
- var objRB = new com.comp.ResizableBox();
- var iX = 315;
- var iHeaderHeight = objRB.getHeaderHeight(_loc2_.c_objRef.mc_MCQ7Choice1.mc_textcont);
- _loc2_.c_objRef.mc_ScrollPane.setScrollContent("SP_Content");
- var mcScrollContent = _loc2_.c_objRef.mc_ScrollPane.getScrollContent();
- var iBoxY = 0;
- var iDepth = 100;
- var _loc1_ = 1;
- while(_loc1_ <= _loc2_.c_iTotalOptions)
- {
- var strHasChild = _loc2_.c_objQuestionData.text[_loc1_ - 1].attributes.hasChild;
- mcScrollContent.attachMovie("ID_MCQBox7","mcBox_" + _loc1_,iDepth++);
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_] = mcScrollContent["mcBox_" + _loc1_];
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._y = iBoxY;
- var objRBox = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mc_textcont;
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mcq._name = "BOX_" + _loc1_;
- _loc2_.c_objRef["mc_MCQChoice" + _loc1_] = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]["BOX_" + _loc1_];
- var mcChoice = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_];
- var objQuesField = mcChoice.txt_Question;
- var objTooTipField = mcChoice.txt_toolTip;
- var objFootField = mcChoice.txt_Footer;
- var strQuesText = String(_loc2_.c_objQuestionData.text[_loc1_ - 1].questionText.data);
- mcChoice.txt_Question.autoSize = true;
- mcChoice.txt_Question.multiline = true;
- mcChoice.txt_Question.html = true;
- if(_loc2_.c_strEnvironment == "Linux")
- {
- trace(">>>>%%% - mcChoice.txt_Question.embedFonts = true");
- mcChoice.txt_Question.embedFonts = true;
- }
- mcChoice.txt_Question.htmlText = _loc2_.c_objQuestionData.text[_loc1_ - 1].questionText.data;
- var iY = mcChoice.txt_Question._y + mcChoice.txt_Question._height;
- if(_loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip != undefined || _loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip != null)
- {
- var strBorderClipName = _loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip.attributes.BorderLinkage;
- var toolTipTxt = String(_loc2_.c_objQuestionData.text[_loc1_ - 1].toolTip.data);
- objTooTipField.autoSize = true;
- objTooTipField.html = true;
- if(_loc2_.c_strEnvironment == "Linux")
- {
- trace(">>>>%%% - 2 - objTooTipField");
- objTooTipField.embedFonts = true;
- }
- objTooTipField.htmlText = toolTipTxt;
- objTooTipField._y = iY;
- var mcBorder = mcChoice.attachMovie(strBorderClipName,"mcBorder",1);
- mcBorder._x = objTooTipField._x - 2;
- mcBorder._y = objTooTipField._y + 12;
- iY = objTooTipField._y + objTooTipField._height;
- }
- if(_loc2_.c_objQuestionData.text[_loc1_ - 1].footerText != undefined || _loc2_.c_objQuestionData.text[_loc1_ - 1].footerText != null)
- {
- var footerText = String(_loc2_.c_objQuestionData.text[_loc1_ - 1].footerText.data);
- objFootField.autoSize = true;
- objFootField.html = true;
- if(_loc2_.c_strEnvironment == "Linux")
- {
- trace(">>>>%%% - 3 - objFootField");
- objFootField.embedFonts = true;
- }
- objFootField.htmlText = footerText;
- objFootField._y = iY + 5;
- }
- mcChoice["BOX_" + _loc1_].txt_ChoiceText.html = true;
- mcChoice["BOX_" + _loc1_].txt_ChoiceText.htmlText = "<b>Answer Question " + _loc2_.c_objQuestionData.text[_loc1_ - 1].attributes.ref + "</b>";
- if(strHasChild == "true")
- {
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].hasChild = true;
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight = 0;
- var arrChilds = _loc2_.c_objQuestionData.text[_loc1_ - 1].Q;
- var mcNewMCQController = _loc2_.c_objRef._parent.MCQ_Q1.attachMovie("ComponentMCQ","ComponentMCQ_" + _loc1_ + "_child",10000 + _loc1_);
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].objChildMCQ = mcNewMCQController;
- mcNewMCQController.init();
- mcNewMCQController.objTimelineRef = _loc2_;
- mcNewMCQController._visible = false;
- var j = 0;
- while(j < arrChilds.length)
- {
- var _loc3_ = _loc2_.c_objRef["mc_MCQChoice" + _loc1_].duplicateMovieClip("mc_MCQChoice_" + arrChilds[j].attributes.ref,iDepth++);
- _loc3_._x = 20;
- _loc3_._y = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._height + 10;
- _loc3_.txt_ChoiceText.autoSize = true;
- _loc3_.txt_ChoiceText.multiline = true;
- _loc3_.txt_ChoiceText.html = true;
- if(_loc2_.c_strEnvironment == "Linux")
- {
- trace(">>>>%%% - 4 - mcNewClip.txt_ChoiceText");
- _loc3_.txt_ChoiceText.embedFonts = true;
- }
- _loc3_.txt_ChoiceText.htmlText = arrChilds[j].data;
- mcNewMCQController.addChild(_loc3_,arrChilds[j].attributes.ref,false);
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight += _loc3_._height;
- j++;
- }
- mcNewMCQController.freeze(true);
- }
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight += _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_or._height;
- _loc2_.c_objRef._parent.MCQ_Q1.addChild(mcChoice["BOX_" + _loc1_],String(_loc1_),false);
- iBoxY += _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._height + _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight;
- if(_loc1_ < _loc2_.c_iTotalOptions || _loc2_.c_iTotalOptions == 1)
- {
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_or._y = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_]._height;
- }
- else
- {
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_or._visible = false;
- }
- _loc1_ = _loc1_ + 1;
- }
- _loc2_.c_objRef.mc_ScrollPane.refreshPane();
- if(_loc2_.c_objTestRef.c_strMode == "Review")
- {
- _loc2_.setEvents();
- _loc2_.c_objRef.mc_ScrollContent.inptxt_WCtxt.type = "dynamic";
- }
- else
- {
- _loc2_.c_objRef.mc_ScrollContent.inptxt_WCtxt.selectable = false;
- _loc2_.c_objRef.mc_ScrollContent.txt_Statement._visible = true;
- _loc2_.c_objRef.mc_ScrollContent.txt_WCHeading._visible = true;
- _loc2_.c_objRef.mc_ScrollContent.dyntxt_WC._visible = true;
- }
- }
- function displayPreviousSelection()
- {
- trace("MMMMMMMMMMMMMMMMMMMMMMMMMMMM11111111111111111111");
- var _objOptnName = this.c_objTestRef.GetOptioncliked();
- if(_objOptnName.objCompRef != undefined || _objOptnName.objCompRef != "")
- {
- trace("MMMMMMMMMMMMMMMMMMMMMM@222222222222222222222222");
- var _objCompRef = _objOptnName.objCompRef;
- this.c_objRef._parent.MCQ_Q1.c_mCurrentSelection = eval(_objOptnName.mcSelected);
- var _tempAttempt = Number(eval(_objOptnName.mcSelected)._name.split("_")[1]);
- this.c_objRef["mc_MCQ7Choice" + _tempAttempt]["BOX_" + _tempAttempt].gotoAndStop("down");
- Selection.setFocus(this.c_objRef.mc_ScrollContent.inptxt_WCtxt);
- this.getAttempted(_objCompRef);
- }
- if(_objOptnName.mcSelected != "" && this.c_objTestRef.c_strMode != "Review")
- {
- this.c_objRef.mc_ScrollContent.inptxt_WCtxt.selectable = true;
- }
- else if(this.c_objTestRef.c_strMode != "Review")
- {
- this.c_objRef.mc_ScrollContent.gotoAndStop(1);
- this.c_objRef.mc_ScrollContent.inptxt_WCtxt.selectable = false;
- }
- else if(this.c_objTestRef.c_strMode == "Review")
- {
- Selection.setFocus(null);
- }
- }
- function arrangeListening()
- {
- var _loc2_ = this;
- var objRB = new com.comp.ResizableBox();
- var _iMargin = 10;
- var iHeaderHeight = objRB.getHeaderHeight(_loc2_.c_objRef.mc_textcont);
- var iRB_xpos = _loc2_.c_objRef.mc_textcont._x;
- var iRB_width = _loc2_.c_objRef.mc_textcont._width;
- var _iBoxHeight;
- var _iGapOffset = 0;
- _loc2_.c_objRef.txt_QuestionNo.text = _loc2_.c_objQuestionData.attributes.number;
- _loc2_.c_objRef.txt_Question.autoSize = true;
- _loc2_.c_objRef.txt_Question.multiline = true;
- _loc2_.c_objRef.txt_Question.html = true;
- _loc2_.c_objRef.txt_Question.htmlText = _loc2_.c_objQuestionData.text.data;
- _iBoxHeight = _loc2_.c_objRef.txt_Question._height + iHeaderHeight + _iMargin;
- objRB.resizeBox(_loc2_.c_iWidth,_iBoxHeight,_loc2_.c_objRef.mc_textcont);
- _loc2_.c_objRef.attachMovie("FScrollPaneSymbol","mc_SPmcqType6",1000);
- _loc2_.c_objRef.mc_SPmcqType6.setScrollContent("SP_Content");
- _loc2_.c_objRef.mc_SPmcqType6._y = _loc2_.c_objRef.txt_Question._y + _loc2_.c_objRef.txt_Question._height + 10;
- _loc2_.c_objRef.mc_SPmcqType6._x = 10;
- _loc2_.c_objRef.mc_SPmcqType6.setSize(460,95);
- var mcContent = _loc2_.c_objRef.mc_SPmcqType6.getScrollContent();
- var _loc1_ = 0;
- while(_loc1_ < _loc2_.c_iTotalOptions)
- {
- mcContent.attachMovie("mc_ImageL1","mc_ImageL" + (_loc1_ + 1),11 + _loc1_);
- mcContent.attachMovie("mc_LMCQChoice1","mc_MCQChoiceL" + (_loc1_ + 1),25 + _loc1_);
- var mcImage = mcContent["mc_ImageL" + (_loc1_ + 1)];
- var _loc3_ = mcContent["mc_MCQChoiceL" + (_loc1_ + 1)];
- _loc3_.txt_ChoiceOption.autoSize = true;
- _loc3_.txt_ChoiceOption.html = true;
- _loc3_.txt_ChoiceOption.htmlText = _loc2_.c_objQuestionData.choice[_loc1_].data;
- mcImage._y = (mcImage._height + 10) * _loc1_;
- _loc3_._x = mcImage._x;
- _loc3_._y = mcImage._y;
- _loc3_.txt_Choice.text = String.fromCharCode(64 + (_loc1_ + 1));
- _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);
- if(_loc2_.c_objTestRef.c_strMode == "Review")
- {
- mcContent["mc_TickCross" + (_loc1_ + 1)].removeMovieClip();
- if(_loc1_ + 1 == _loc2_.c_objTestRef.c_objHMObject.attempted || _loc1_ + 1 == _loc2_.c_objData.iCorrect)
- {
- mcContent.attachMovie("mc_TickCross","mc_TickCross" + (_loc1_ + 1),31 + _loc1_,{_x:_loc3_._x + _loc3_._width,_y:_loc3_._y});
- }
- }
- _loc1_ = _loc1_ + 1;
- }
- _loc2_.c_objRef.mc_SPmcqType6.refreshPane();
- if(_loc2_.c_objTestRef.c_strMode == "Review")
- {
- if(_loc2_.c_objTestRef.c_objHMObject.attempted != _loc2_.c_objData.iCorrect)
- {
- if(_loc2_.c_objTestRef.c_objHMObject.attempted == 2 || _loc2_.c_objTestRef.c_objHMObject.attempted == 3)
- {
- mcContent["mc_TickCross" + _loc2_.c_objTestRef.c_objHMObject.attempted].gotoAndStop("INCORRECT");
- mcContent["mc_TickCross" + _loc2_.c_objData.iCorrect].gotoAndStop("CORRECT");
- }
- else
- {
- mcContent["mc_TickCross" + _loc2_.c_objData.iCorrect].gotoAndStop("CORRECT");
- }
- }
- else
- {
- mcContent["mc_TickCross" + _loc2_.c_objTestRef.c_objHMObject.attempted].gotoAndStop("CORRECT");
- }
- }
- }
- function showPairedMCQExtract()
- {
- var _loc3_ = this;
- var iPairCount = 2;
- var iPairID = _loc3_.c_objTestRef.c_iPairID;
- var iChoiceYPos;
- var objRB = new com.comp.ResizableBox();
- objRB.addListener(_loc3_);
- var objExtractData = _loc3_.c_objSection.extract[iPairID];
- _loc3_.setExtractData(objExtractData,_loc3_.c_objRef);
- objRB.resizeBox(_loc3_.c_objRef.mc_RefExtract._width,_loc3_.c_objRef.mc_RefExtract._height,_loc3_.c_objRef.mc_TextCount_Extract);
- var i = 1;
- while(i <= iPairCount)
- {
- var mcNewMCQController = _loc3_.c_objRef._parent.MCQ_Q1.attachMovie("ComponentMCQ","ComponentMCQ_" + i,10000 + i);
- mcNewMCQController.init();
- mcNewMCQController.objTimelineRef = _loc3_;
- mcNewMCQController._x = -100;
- mcNewMCQController._y = -100;
- mcNewMCQController.c_bIsToggle = true;
- mcNewMCQController._visible = false;
- var iQuesID = iPairID * iPairCount + i;
- var objQuestion = _loc3_.c_objSection.question[iQuesID - 1];
- var iQuesNo = objQuestion.attributes.number;
- var objChoices = objQuestion.choice;
- var _loc2_ = _loc3_.c_objRef.attachMovie("pairedMCQ_Question","mc_QuestionPanel_" + i,i);
- _loc2_._x = _loc3_.c_objRef["mc_PosQues_" + i]._x;
- _loc2_._y = _loc3_.c_objRef["mc_PosQues_" + i]._y;
- objRB.resizeBox(_loc2_.mc_textcontReference._width,_loc2_.mc_textcontReference._height,_loc2_.mc_textcont);
- _loc3_.setQuestionData(objQuestion,_loc2_);
- var mcScrollPane = _loc2_.attachMovie("FScrollPaneSymbol","mc_ScrollPaneQue",i);
- mcScrollPane.setScrollContent("SP_Content");
- mcScrollPane._x = _loc2_.mc_RefScrollPane._x;
- mcScrollPane._y = _loc2_.txt_QuestionText._y + _loc2_.txt_QuestionText._height + 10;
- mcScrollPane.setSize(_loc2_.mc_RefScrollPane._width,_loc2_.mc_RefScrollPane._height);
- var mcScrollHolder = mcScrollPane.getScrollContent();
- var iCorrectAns = objQuestion.attributes.correct;
- var _loc1_ = 1;
- while(_loc1_ <= objChoices.length)
- {
- var mcChoice = mcScrollHolder.attachMovie("mc_MCQChoice","mc_MCQChoice_" + _loc1_,_loc1_);
- _loc3_.setChoiceData(objChoices[_loc1_ - 1],_loc1_,mcChoice,mcScrollHolder);
- iCorrectAns == _loc1_ ? mcNewMCQController.addChild(mcChoice,String(_loc1_),true) : mcNewMCQController.addChild(mcChoice,String(_loc1_),false);
- _loc2_.mc_ScrollPane.refreshPane();
- _loc1_ = _loc1_ + 1;
- }
- if(_loc3_.c_objTestRef.c_strMode == "Review")
- {
- _loc3_.showCorrectIncorrect(iQuesNo,iCorrectAns,mcScrollHolder);
- var objHMObject = _loc3_.c_objTestRef.c_hQuestionState["get"](String(_loc3_.c_strSkill + "_" + iQuesNo));
- if(objHMObject != undefined && objHMObject != null)
- {
- mcNewMCQController.setSelect(String(objHMObject.attempted));
- }
- mcNewMCQController.freeze(true);
- }
- i++;
- }
- var iQuesNum = Number(_loc3_.c_objSection.question[_loc3_.c_objTestRef.c_iQuestionNo - 1].attributes.number);
- var iCompID = (iQuesNum - 1) % 2 + 1;
- _loc3_.deselectionAll(_loc3_.c_objRef,iPairCount);
- _loc3_.showCurrentSelection(_loc3_.c_objRef,iCompID);
- }
- function showCorrectIncorrect(_QuesID, _CorrectAnswer, _ChoiceContainer)
- {
- var _loc1_ = this.c_objTestRef.c_hQuestionState["get"](String(this.c_strSkill + "_" + _QuesID));
- var _loc2_ = Number(_loc1_.attempted);
- if(_loc1_.correct == 0)
- {
- _ChoiceContainer["mc_MCQChoice_" + _loc2_].mc_TickCross.gotoAndStop("INCORRECT");
- }
- _ChoiceContainer["mc_MCQChoice_" + _CorrectAnswer].mc_TickCross.gotoAndStop("CORRECT");
- }
- function setExtractData(objExtractData, mcTemplate)
- {
- var _loc1_ = mcTemplate;
- var _loc2_ = objExtractData.title.data;
- var _loc3_ = objExtractData.text.data;
- _loc1_.txt_ExtractTitle.autoSize = true;
- _loc1_.txt_ExtractTitle.html = true;
- _loc1_.txt_ExtractTitle.htmlText = true;
- _loc1_.txt_ExtractText.html = true;
- _loc1_.txt_ExtractText.autoSize = true;
- _loc1_.txt_ExtractText.multiline = true;
- _loc1_.txt_ExtractTitle.htmlText = _loc2_;
- _loc1_.txt_ExtractText.htmlText = _loc3_;
- }
- function setQuestionData(objQuestionData, mcQuestionPanel)
- {
- var _loc1_ = mcQuestionPanel;
- _loc1_.txt_QuestionNo.html = true;
- _loc1_.txt_QuestionNo.htmlText = "<b>" + objQuestionData.attributes.number + "</b>";
- _loc1_.txt_QuestionText.autoSize = true;
- _loc1_.txt_QuestionText.multiline = true;
- _loc1_.txt_QuestionText.html = true;
- _loc1_.txt_QuestionText.htmlText = objQuestionData.text.data;
- }
- function setChoiceData(objChoiceData, iChoiceID, mcChoiceClip, mcScrollHolder)
- {
- var _loc1_ = mcChoiceClip;
- _loc1_.txt_ChoiceID.html = true;
- _loc1_.txt_ChoiceID.htmlText = "<b>" + String.fromCharCode(64 + iChoiceID) + "</b>";
- _loc1_.txt_ChoiceText.autoSize = true;
- _loc1_.txt_ChoiceText.multiline = true;
- _loc1_.txt_ChoiceText.html = true;
- _loc1_.txt_ChoiceText.htmlText = objChoiceData.data;
- _loc1_._x = 5;
- var _loc2_ = iChoiceID - 1;
- _loc1_._y = mcScrollHolder["mc_MCQChoice_" + _loc2_]._y + mcScrollHolder["mc_MCQChoice_" + _loc2_]._height + 7;
- }
- function arrangeListening2()
- {
- var _objSection = this.c_objQuestionData;
- var _iTotalQuestions = _objSection.question.length;
- var _iFirstQuestionNum = Number(_objSection.question[0].attributes.number);
- var _iLastQuestionNum = Number(_iTotalQuestions - 1) + _iFirstQuestionNum;
- var currQue = this.c_objTestRef.c_iQuestionNo;
- var scrollSetX = 0;
- var scrollSetY;
- var _iQuestionY = 0;
- var strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
- var objRB = new com.comp.ResizableBox();
- this.c_objRef.mc_SPType_7.setScrollContent("mcEmpty");
- var mcScrollContent = this.c_objRef.mc_SPType_7.getScrollContent("mcEmpty");
- this.c_objRef.mc_SPType_7.setSize(this.c_iWidth,this.c_objRef.mc_scrollRefrence._height - 2);
- this.c_objRef.mc_SPType_7._x = 130;
- this.c_objRef.mc_scrollRefrence._x = 95;
- var i = 1;
- while(i <= _iTotalQuestions)
- {
- var objComponentMCQ = this.c_objRef._parent.attachMovie("ComponentMCQ","ComponentMCQ_" + i,10000 + i);
- objComponentMCQ._x = -100;
- objComponentMCQ._y = -100;
- objComponentMCQ.objTimelineRef = this;
- objComponentMCQ.init();
- objComponentMCQ.c_bIsToggle = true;
- objComponentMCQ._visible = false;
- var _iCorrectAnswer = _objSection.question[i - 1].attributes.correct;
- var _loc3_ = mcScrollContent.attachMovie("mc_QType7","mc_QuestionPanel_" + i,210 + i);
- _loc3_._x = 10;
- _loc3_._y = _iQuestionY;
- objRB.disableBox(_loc3_.mc_textcont);
- _loc3_.txt_QuestionNo.text = _objSection.question[i - 1].attributes.number;
- _loc3_.txt_Question.html = true;
- _loc3_.txt_Question.htmlText = _objSection.question[i - 1].text.data;
- _loc3_.txt_Question.autoSize = true;
- _loc3_.txt_Question._y += 5;
- var _iTotalChoices = Number(_objSection.question[i - 1].choice.length);
- var _loc1_ = undefined;
- var _iChoiceY = _loc3_.txt_Question._y + _loc3_.txt_Question._height + 10;
- var _loc2_ = 1;
- while(_loc2_ <= _iTotalChoices)
- {
- _loc1_ = _loc3_.attachMovie("mc_MCQChoiceL_7","mc_MCQChoice_" + i + "_" + _loc2_,210 + i * _loc2_);
- _loc1_._x = 10;
- _loc1_._y = _iChoiceY;
- _loc1_.txt_ChoiceText.html = true;
- _loc1_.txt_ChoiceText.autoSize = true;
- _loc1_.txt_ChoiceText.htmlText = _objSection.question[i - 1].choice[_loc2_ - 1].data;
- _iChoiceY += _loc1_.txt_ChoiceText._height;
- _loc1_.txt_ChoiceID.html = true;
- _loc1_.txt_ChoiceID.htmlText = "<b>" + String.fromCharCode(64 + _loc2_) + "</b>";
- _loc1_.mc_TickCross.gotoAndStop("BLANK");
- Number(_iCorrectAnswer) == Number(_loc2_) ? objComponentMCQ.addChild(_loc1_,String(_loc2_),true) : objComponentMCQ.addChild(_loc1_,String(_loc2_),false);
- _loc2_ = _loc2_ + 1;
- }
- if(strEnvironment == "Linux")
- {
- var totHeight = _loc1_._y + _loc1_.txt_ChoiceText._height + 10;
- }
- else
- {
- var totHeight = _loc1_._y + _loc1_.txt_ChoiceText._height;
- }
- objRB.resizeBox(this.c_iWidth - 20,totHeight,_loc3_.mc_textcont);
- objRB.addListener(this);
- _iQuestionY = _loc3_._y + _loc3_._height + 5;
- this.showType7Feedback(_loc3_);
- i++;
- }
- this.c_objRef.mc_SPType_7.refreshPane();
- this.c_objRef.btn_next._x = this.c_objRef.mc_scrollRefrence._x + this.c_objRef.mc_scrollRefrence._width + 40;
- 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;
- if(currQue == 1)
- {
- scrollSetY = 0;
- }
- else
- {
- scrollSetY = mcScrollContent["mc_QuestionPanel_" + currQue]._y - 90;
- }
- this.c_objRef.mc_SPType_7.setScrollPosition(scrollSetX,scrollSetY);
- }
- function showListeningQSelection()
- {
- var _loc1_ = this;
- var _loc2_ = _loc1_.c_objRef.mc_SPType_7.getScrollContent();
- var _loc3_ = _loc1_.c_objTestRef.c_strCurrSelected;
- _loc1_.deselectionAll(_loc2_);
- _loc1_.showCurrentSelection(_loc2_,_loc3_);
- }
- function showType7Feedback(mcQuestionHolder)
- {
- var _loc3_ = mcQuestionHolder;
- var _loc2_ = Number(_loc3_._name.split("_")[2]);
- var objQuesData = this.c_objSection.question[_loc2_ - 1];
- var iChoiceCount = objQuesData.choice.length;
- var _loc1_ = 1;
- while(_loc1_ <= iChoiceCount)
- {
- _loc3_["mc_MCQChoice_" + _loc2_ + "_" + _loc1_].mc_TickCross.gotoAndStop("BLANK");
- _loc1_ = _loc1_ + 1;
- }
- if(this.c_objTestRef.c_strMode == "Review")
- {
- var strQuesNum = objQuesData.attributes.number;
- var objHMData = this.c_objTestRef.c_hQuestionState["get"](String(this.c_strSkill + "_" + strQuesNum));
- var strAttempted = objHMData.attempted;
- var strCorrectID = objQuesData.attributes.correct;
- if(strAttempted != strCorrectID)
- {
- _loc3_["mc_MCQChoice_" + _loc2_ + "_" + strAttempted].mc_TickCross.gotoAndStop("INCORRECT");
- }
- _loc3_["mc_MCQChoice_" + _loc2_ + "_" + strCorrectID].mc_TickCross.gotoAndStop("CORRECT");
- }
- }
- function arrangeListening4()
- {
- var _loc3_ = this;
- var _objSection = _loc3_.c_objTestRef.c_objScreenData.DOC.section[Number(_loc3_.c_strMCQType - 1)];
- var _iTotalQuestions = _objSection.question.length;
- var _iFirstQuestionNum = Number(_objSection.question[0].attributes.number);
- var _iLastQuestionNum = Number(_iTotalQuestions - 1) + _iFirstQuestionNum;
- var _loc2_ = 1;
- while(_loc2_ <= _iTotalQuestions)
- {
- var _TFQuestionTitle = _loc3_.c_objRef["txt_QuestionNo_" + _loc2_];
- var _TFQuestionText = _loc3_.c_objRef["txt_Question_" + _loc2_];
- var _objQuestionData = _objSection.question[_loc2_ - 1];
- var _iCorrectAnswer = _objQuestionData.attributes.correct;
- _TFQuestionTitle.autoSize = true;
- _TFQuestionTitle.multiline = true;
- _TFQuestionTitle.html = true;
- _TFQuestionTitle.htmlText = "<b>" + _objQuestionData.attributes.number + "</b>";
- _TFQuestionText.text = _objQuestionData.text.data;
- var _loc1_ = 1;
- while(_loc1_ <= _loc3_.c_iTotalOptions)
- {
- var mcChoice = _loc3_.c_objRef["mc_Choice_" + _loc2_ + "_" + _loc1_];
- var txtChoice = _objQuestionData.choice[_loc1_ - 1].data;
- mcChoice.txt_ChoiceText.text = txtChoice.toUpperCase();
- 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);
- _loc1_ = _loc1_ + 1;
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc3_.c_objRef.btn_next._x = 620;
- _loc3_.c_objRef.btn_next._y = 340;
- }
- function setOptions()
- {
- var _loc2_ = this;
- var _loc1_ = 1;
- while(_loc1_ <= _loc2_.c_objData.iTotalOptions)
- {
- _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);
- _loc1_ = _loc1_ + 1;
- }
- }
- function getAttempted(_objCompRef)
- {
- var _loc1_ = this;
- var _loc2_ = new Object();
- var _loc3_ = undefined;
- _loc1_.c_strSkill = _loc1_.c_objTestRef.c_strSkill;
- _loc1_.c_objRef = _level101[_loc1_.c_strMCQType];
- if(_loc1_.c_strMCQType == "MCQType_7")
- {
- var mcScrollContent = _loc1_.c_objRef.mc_SPType_7.getScrollContent();
- var _objSection = _loc1_.c_objQuestionData;
- _loc1_.c_objTestRef.c_strCurrSelected = _objCompRef._name.charAt(_objCompRef._name.length - 1);
- _loc1_.c_objTestRef.c_iCurrQuestion = _objSection.question[_loc1_.c_objTestRef.c_strCurrSelected - 1].attributes.number;
- if(_loc1_.c_objTestRef.c_strPreSelected != _loc1_.c_objTestRef.c_strCurrSelected)
- {
- _loc1_.c_objTestRef.setMCQSelection(_loc1_.c_objRef["mc_textcont_" + _loc1_.c_objTestRef.c_strCurrSelected]);
- }
- _loc3_ = _loc1_.c_objRef._parent["ComponentMCQ_" + _loc1_.c_objTestRef.c_strCurrSelected].c_mCurrentSelection;
- var _iTotalQuestions = _objSection.question.length;
- _loc1_.deselectionAll(mcScrollContent,_iTotalQuestions);
- var iQuesPanelID = _loc1_.c_objTestRef.c_strCurrSelected;
- _loc1_.showCurrentSelection(mcScrollContent,iQuesPanelID);
- _loc1_.showNavigationSelection();
- }
- else if(_loc1_.c_strMCQType == "PairedMCQScrolling" || _loc1_.c_strMCQType == "PairedMCQExtract")
- {
- var iPairCount = 2;
- var iCompID = Number(_objCompRef._name.split("_")[1]);
- _loc1_.c_objTestRef.c_strCurrSelected = _loc1_.c_objTestRef.c_iPairID * iPairCount + iCompID;
- _loc1_.c_objTestRef.c_iCurrQuestion = _loc1_.c_objSection.question[_loc1_.c_objTestRef.c_strCurrSelected - 1].attributes.number;
- _loc3_ = _loc1_.c_objRef._parent.MCQ_Q1["ComponentMCQ_" + iCompID].c_mCurrentSelection;
- var mcScrollContent;
- if(_loc1_.c_strMCQType == "PairedMCQScrolling")
- {
- mcScrollContent = _loc1_.c_objRef.mc_ScrollPaneQue.getScrollContent();
- }
- else if(_loc1_.c_strMCQType == "PairedMCQExtract")
- {
- mcScrollContent = _loc1_.c_objRef;
- }
- _loc1_.deselectionAll(mcScrollContent,iPairCount);
- _loc1_.showCurrentSelection(mcScrollContent,iCompID);
- if(_loc1_.c_objTestRef.c_strMode != "Review")
- {
- _loc1_.showNavigationSelection();
- }
- }
- else
- {
- _loc3_ = _loc1_.c_objRef._parent.MCQ_Q1.c_mCurrentSelection;
- }
- var strSelected = String(_loc3_);
- _loc2_.correct = !_loc3_.bValue ? 0 : 1;
- _loc2_.attempted = strSelected.charAt(strSelected.length - 1);
- var objScreen = new Object();
- objScreen.attempted = _loc2_.attempted;
- objScreen.correct = _loc2_.correct;
- if(_loc1_.c_strMCQType == "FIBType_3")
- {
- _loc1_.handleFIBAttempted(_objCompRef);
- }
- var mcChoice = _loc1_.c_objRef.MCQContainer["mc_MCQChoice" + Number(_loc2_.attempted)];
- if(_loc1_.c_strMCQType == "MCQType_1" || _loc1_.c_strMCQType == "MCQType_5")
- {
- _loc1_.c_objTestRef.c_objFIB2.updateText(mcChoice.txt_ChoiceText.text);
- }
- if(_loc1_.c_strMCQType != "FIBType_3")
- {
- _loc1_.c_objTestRef.appendQuesObject(objScreen);
- _loc1_.c_objTestRef.c_objNavigator.markAttempted();
- }
- if(_loc1_.c_objTestRef.c_strMode != "Review")
- {
- _loc1_.showNextButton();
- }
- }
- function deselectionAll(mcScrollContent)
- {
- var _objSection = this.c_objTestRef.c_objScreenData.DOC.section[this.c_objTestRef.c_iPartNo];
- var _loc3_ = _objSection.question.length;
- var _loc2_ = new com.comp.ResizableBox();
- var _loc1_ = 0;
- while(_loc1_ < _loc3_)
- {
- _loc2_.disableBox(mcScrollContent["mc_QuestionPanel_" + (_loc1_ + 1)].mc_textcont);
- _loc1_ = _loc1_ + 1;
- }
- }
- function showCurrentSelection(mcScrollContent, iQuesPanelID)
- {
- var _loc1_ = new com.comp.ResizableBox();
- _loc1_.enableBox(mcScrollContent["mc_QuestionPanel_" + iQuesPanelID].mc_textcont);
- }
- function showNavigationSelection()
- {
- var _loc1_ = this;
- var _loc3_ = Number(_loc1_.c_objTestRef.c_iPartNo);
- var _loc2_ = Number(_loc1_.c_objTestRef.c_strCurrSelected) - 1;
- _loc1_.c_objTestRef.c_objNavigator.c_iSeleID = _loc1_.c_objTestRef.c_iCurrQuestion;
- _loc1_.c_objTestRef.c_objNavigator.c_preSelecetd = _loc1_.c_objTestRef.c_objNavigator.c_strSelecetd;
- _loc1_.c_objTestRef.c_objNavigator.c_strSelecetd = String("_" + _loc3_ + "_" + _loc2_);
- _loc1_.c_objTestRef.c_objNavigator.navClickedfunction();
- }
- function showNextButton()
- {
- var _loc1_ = this;
- var iTotalSections = _loc1_.c_objTestRef.c_objScreenData.DOC.section.length;
- var iCurrentSectionID = Number(_loc1_.c_objTestRef.c_iPartNo) + 1;
- var iCurrentPairID = Number(_loc1_.c_objTestRef.c_iPairID);
- var iTotalQues = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question.length;
- var iTotalPairs = iTotalQues / 2;
- var _loc3_ = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].attributes.navType;
- if(_loc3_ == "2" && iCurrentSectionID != iTotalSections)
- {
- var objQuestion = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question;
- var iPartLength = Number(objQuestion.length);
- var iFirstQues = Number(objQuestion[0].attributes.number);
- var iLastQues = Number(objQuestion[iPartLength - 1].attributes.number);
- _loc1_.c_objRef.btn_next._visible = _loc1_.showNextForNavPart(iFirstQues,iLastQues);
- }
- else
- {
- _loc1_.c_objRef.btn_next._visible = false;
- }
- if(_loc3_ == "3" && iCurrentSectionID != iTotalSections)
- {
- var objQuestion = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo].question;
- var iPairId = _loc1_.c_objTestRef.c_iPairID;
- var iSelectNo = iPairId * 2;
- var iPFirstNumber = objQuestion[iSelectNo].attributes.number;
- var iPSecondNumber = objQuestion[iSelectNo + 1].attributes.number;
- var bShowNext = _loc1_.showNextForNavPart(iPFirstNumber,iPSecondNumber);
- _loc1_.c_objRef.btn_next._visible = bShowNext;
- }
- if(_loc3_ == "1" || _loc1_.c_strMCQType == "MCQType_5")
- {
- var _loc2_ = _loc1_.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objTestRef.c_iPartNo];
- var iSectionLength = Number(_loc2_.question.length);
- var iLastQuesNum = Number(_loc2_.question[iSectionLength - 1].attributes.number);
- var iCurrentQuesNum = Number(_loc2_.question[_loc1_.c_objTestRef.c_iQuestionNo - 1].attributes.number);
- _loc1_.c_objRef.btn_next._visible = !(iCurrentQuesNum == iLastQuesNum && iCurrentSectionID == iTotalSections);
- }
- }
- function showNextForNavPart(iFirstQues, iLastQues)
- {
- var _loc3_ = this;
- var bShowNext = false;
- var iAttempted = 0;
- var iPartLength = iLastQues - iFirstQues + 1;
- var _loc1_ = iFirstQues;
- while(_loc1_ <= iLastQues)
- {
- var _loc2_ = _loc3_.c_objTestRef.c_hQuestionState["get"](String(_loc3_.c_strSkill + "_" + _loc1_));
- if(_loc2_.attempted == null)
- {
- break;
- }
- iAttempted++;
- _loc1_ = _loc1_ + 1;
- }
- bShowNext = iAttempted == iPartLength;
- return bShowNext;
- }
- function handleFIBAttempted(_objCompRef)
- {
- var _loc1_ = this;
- var _loc2_ = new Object();
- var mcSelected = _loc1_.c_objRef._parent.MCQ_Q1.c_mCurrentSelection;
- var strSelected = String(mcSelected);
- _loc1_.c_objTestRef.StoreOptioncliked(strSelected,_objCompRef,mcSelected.bValue);
- var _iMaxWordLimit = Number(_loc1_.c_objSection.attributes.maxWords);
- _loc2_.correct = !mcSelected.bValue ? 0 : 1;
- _loc2_.attempted = mcSelected._name.split("_")[1];
- _loc1_.c_mcSelected = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].txt_Question;
- var objScreen = new Object();
- objScreen.attempted = _loc2_.attempted;
- objScreen.correct = _loc2_.correct;
- var arrSplit = _objCompRef._name.split("_");
- if(arrSplit[arrSplit.length - 1] != "child")
- {
- var _loc3_ = new Object();
- var strQuestionName = _loc1_.c_strSkill.toLowerCase() + _loc1_.c_objTestRef.c_iCurrQuestion;
- _loc3_ = _loc1_.c_objTestRef.c_hQuestionState["get"](strQuestionName);
- if(_loc3_ == null || _loc3_ == undefined)
- {
- _loc3_ = new Object();
- }
- if(_loc1_.c_objTestRef.c_strMode != "Review" && _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.length < 0)
- {
- _loc3_.answeroption = _loc2_.attempted;
- _loc3_.attempted = _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.text;
- _loc1_.c_objTestRef.appendQuesObject(_loc3_);
- }
- _loc1_.c_PrintQuestionNo = _loc1_.c_objQuestionData.attributes.number;
- _loc1_.resetMcq7();
- var objResizeBox = new com.comp.ResizableBox();
- objResizeBox.enableBox(_loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].mc_textcont);
- var objRBox = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].mc_textcont;
- var objQuesField = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].txt_Question;
- var objFootField = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].txt_footer;
- var iHeaderHeight = objResizeBox.getHeaderHeight(_loc1_.c_objRef.mc_textcont);
- var iBoxHeight = objFootField._y - objQuesField._y + objFootField._height + iHeaderHeight + 46;
- if(_loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].hasChild)
- {
- var iAddHeight = _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].addHeight;
- objResizeBox.resizeBox(318,iBoxHeight + iAddHeight,objRBox);
- _loc1_.c_objRef["mc_MCQ7Choice" + _loc2_.attempted].objChildMCQ.freeze(false);
- }
- else
- {
- objResizeBox.resizeBox(318,iBoxHeight,objRBox);
- }
- if(mcSelected != undefined)
- {
- _loc1_.setEvents();
- }
- if(_loc1_.c_objTestRef.c_strMode != "Review")
- {
- _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.type = "input";
- Selection.setFocus(_loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt);
- }
- else if(_loc1_.c_objTestRef.c_strMode == "Review")
- {
- _loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.type = "dynamic";
- }
- _loc1_.c_objRef.mc_ScrollContent.gotoAndStop(2);
- var objWC = new com.comp.WordCount(_loc1_.c_objRef.mc_ScrollContent,"inptxt_WCtxt","dyntxt_WC",_loc1_.c_objTestRef,_iMaxWordLimit);
- if(_loc1_.c_objRef.mc_ScrollContent.inptxt_WCtxt.maxscroll > 1)
- {
- _loc1_.c_objRef.mc_ScrollContent.cmp_ScrollBar._visible = true;
- _loc1_.c_objRef.mc_ScrollContent.cmp_ScrollBar1._visible = true;
- }
- else
- {
- _loc1_.c_objRef.mc_ScrollContent.cmp_ScrollBar._visible = false;
- }
- _loc1_.c_objRef.mc_ScrollContent.txt_Header.text = "Question " + _loc1_.c_objQuestionData.text[_loc2_.attempted - 1].attributes.ref;
- _loc1_.c_PrintQuestionNo = _loc1_.c_objQuestionData.text[_loc2_.attempted - 1].attributes.ref;
- }
- }
- function setEvents()
- {
- var _btnObjRef = this;
- this.c_objRef.btn_PrintFib3.enabled = true;
- this.c_objRef.btn_PrintFib3.onRelease = function()
- {
- var _questionTxt = _btnObjRef.c_mcSelected.htmlText;
- var _loc3_ = _btnObjRef.c_PrintQuestionNo;
- var _iTestNum = _btnObjRef.c_objSection.attributes.test;
- var _loc2_ = _btnObjRef.c_objSection.attributes.skill;
- _loc2_ = _loc2_.charAt(0).toUpperCase() + _loc2_.substr(1,_loc2_.length);
- var _loc1_ = _btnObjRef.c_objSection.attributes.type;
- _loc1_ = _loc1_.charAt(0).toUpperCase() + _loc1_.substr(1,_loc1_.length - 1);
- _loc1_ = _loc1_.substr(0,_loc1_.length - 1) + " " + _loc1_.substr(-1);
- var _headerText = com.controller.UICoordinator.getInstance().getTitle() + " - Test: " + _loc2_ + " " + _loc1_;
- com.comp.PrintManager.printIt(_level101.printText_mc,_headerText,_btnObjRef.c_struserName,_loc3_,_questionTxt,_btnObjRef.c_objRef.mc_ScrollContent.inptxt_WCtxt.text);
- };
- }
- function resetMcq7()
- {
- var _loc2_ = this;
- var objRB = new com.comp.ResizableBox();
- var _loc1_ = 1;
- while(_loc1_ <= _loc2_.c_iTotalOptions)
- {
- var objRBox = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mc_textcont;
- objRB.disableBox(_loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].mc_textcont);
- var _loc3_ = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_Question;
- var objFootField = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].txt_footer;
- var iHeaderHeight = objRB.getHeaderHeight(_loc2_.c_objRef.mc_textcont);
- _loc3_.autoSize = true;
- _loc3_.htmlText = _loc2_.c_objQuestionData.text[_loc1_ - 1].questionText.data;
- var iAddHeight = _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].addHeight;
- if(_loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].hasChild)
- {
- objRB.resizeBox(318,_loc3_._height + iHeaderHeight + 46 + iAddHeight,objRBox);
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].objChildMCQ.reset();
- _loc2_.c_objRef["mc_MCQ7Choice" + _loc1_].objChildMCQ.freeze(true);
- }
- else
- {
- objRB.resizeBox(318,objFootField._y - _loc3_._y + objFootField._height + iHeaderHeight + 46,objRBox);
- }
- _loc1_ = _loc1_ + 1;
- }
- _loc2_.c_objRef.mc_ScrollPane.refreshPane();
- }
- function selectQuestion(strQuestionNumber)
- {
- var _loc3_ = this;
- var iTotalQuestions = _loc3_.c_objSection.question.length;
- var _loc2_ = undefined;
- var iQuesID = 0;
- if(iTotalQuestions == undefined || iTotalQuestions == null || iTotalQuestions == "")
- {
- iTotalQuestions = 1;
- }
- var _loc1_ = 0;
- while(_loc1_ < iTotalQuestions)
- {
- _loc2_ = _loc3_.c_objSection.question[_loc1_];
- if(_loc2_ == undefined || _loc2_ == null)
- {
- _loc2_ = _loc3_.c_objSection.question;
- }
- if(_loc2_.attributes.number == strQuestionNumber)
- {
- iQuesID = _loc1_;
- _loc3_.c_objTestRef.c_strCurrSelected = iQuesID + 1;
- break;
- }
- _loc1_ = _loc1_ + 1;
- }
- _loc3_.c_objTestRef.c_iCurrQuestion = strQuestionNumber;
- _loc3_.showNavigationSelection();
- _loc3_.showQuestionSelection(_loc3_.c_objTestRef.c_strCurrSelected);
- }
- function showQuestionSelection(strQuestionID)
- {
- var _loc1_ = this;
- var _loc2_ = 2;
- switch(_loc1_.c_strMCQType)
- {
- case "PairedMCQExtract":
- var iCompID = (strQuestionID - 1) % 2 + 1;
- _loc1_.deselectionAll(_loc1_.c_objRef,_loc2_);
- _loc1_.showCurrentSelection(_loc1_.c_objRef,iCompID);
- break;
- case "PairedMCQScrolling":
- var iCompID = (strQuestionID - 1) % 2 + 1;
- var _loc3_ = _loc1_.c_objRef.mc_ScrollPaneQue.getScrollContent();
- _loc1_.deselectionAll(_loc3_,_loc2_);
- _loc1_.showCurrentSelection(_loc3_,iCompID);
- break;
- case "MCQType_7":
- _loc1_.showListeningQSelection();
- }
- }
- }
-