home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 2007-09-06 | 80.9 KB | 1,966 lines
class com.screen.Test { var c_objScreenData; var c_objNavigator; var c_iStartQuestion; var c_strMode; var c_arrToNavigator; var c_arrAttepmtedToNav; var objRef; var c_strSkill; var c_hQuestionState; var c_objSourceRef; var c_iPartNo; var _parent; var useHandCursor; var gotoAndStop; var objTimer; var c_strEnvironment; var c_iTotalTestQuestions; var c_objOptName; function Test() { } function init(_objScreenData, _objSourceRef) { var _loc1_ = this; _loc1_.c_strMode = com.controller.UICoordinator.getInstance().currentMode; _loc1_.c_arrToNavigator = new Array(); _loc1_.c_arrAttepmtedToNav = new Array(); _loc1_.c_objOptName = new Array(); _loc1_.c_objScreenData = _objScreenData["get"]("Test"); _loc1_.c_objSourceRef = _objSourceRef; _loc1_.c_blnOnce = true; _loc1_.c_iLastQustion = 0; _loc1_.c_blnOnceMCQ2 = true; _loc1_.c_blnOnceMCQ3 = true; _loc1_.c_blnOnceMCQ4 = true; _loc1_.c_blnOnceMCQ5 = true; _loc1_.c_blnOnceMCQ7 = true; _loc1_.c_blnAttachNext = true; _loc1_.c_blnSoundController = false; _loc1_.c_blnFIB2_2 = false; _loc1_.c_blnUOEFIB3 = false; _loc1_.c_blnPairedMCQExtract = false; _loc1_.c_blnPairedDropDown = false; _loc1_.c_blnDDCollection = false; _loc1_.c_blnOnceMCQ8 = true; _loc1_.c_blnAutoFillFib = true; _loc1_.c_iStartQuestion = 1; _loc1_.c_blnInitL1 = false; _loc1_.c_blnInitL2 = false; _loc1_.c_blnInitL4 = false; _loc1_.c_blnPairedScrolling = true; _loc1_.c_strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment(); _loc1_.c_objMCQContainer = new Object(); _loc1_.countTotalQuestions(_loc1_.c_objScreenData); _loc1_.countTotalTestMark(); _loc1_.c_hQuestionState = new com.util.HashMap(); if(_loc1_.c_strMode == "Continue" || _loc1_.c_strMode == "Review") { if(_objScreenData["get"]("Result") != undefined && _objScreenData["get"]("Result") != null) { var _loc3_ = new Object(); _loc3_ = _objScreenData["get"]("Result").result; var objTemp = new Object(); var arrAttemptedQNos = new Array(); var strQuestionExists = _loc3_.question.attributes.number.split("_")[1]; if((_loc3_.question.length == null || _loc3_.question.length == undefined) && (strQuestionExists != null || strQuestionExists != undefined)) { var strQuestionNumber = _loc3_.question.attributes.number; var objTemp = new Object(); objTemp.attempted = _loc3_.question.attemptedoption.data; objTemp.correct = _loc3_.question.correct.data; objTemp.answeroption = _loc3_.question.answeroption.data; _loc1_.arrForNavigator(objTemp,strQuestionNumber,arrAttemptedQNos); } var _loc2_ = 0; while(_loc2_ < _loc3_.question.length) { var objTemp = new Object(); objTemp.attempted = _loc3_.question[_loc2_].attemptedoption.data; objTemp.correct = _loc3_.question[_loc2_].correct.data; objTemp.answeroption = _loc3_.question[_loc2_].answeroption.data; var strQuestionNumber = _loc3_.question[_loc2_].attributes.number; _loc1_.arrForNavigator(objTemp,strQuestionNumber,arrAttemptedQNos); _loc2_ = _loc2_ + 1; } if(_loc1_.c_strMode == "Continue") { _loc1_.c_iStartQuestion = _loc1_.getFirstUnattempted(arrAttemptedQNos); } } } _loc1_.c_arrQuestionTypes = new Array(); _loc1_.c_iScore = 0; _loc1_.loadScreen(); } function countTotalQuestions(_objScreenData) { var _loc2_ = undefined; var iTotalSections = _objScreenData.DOC.section.length; var iTotalQuestions = 0; if(iTotalSections == undefined || iTotalSections == null || iTotalSections == "") { iTotalSections = 1; } var _loc3_ = 0; while(_loc3_ < iTotalSections) { _loc2_ = _objScreenData.DOC.section[_loc3_]; if(_loc2_ == undefined || _loc2_ == null) { _loc2_ = _objScreenData.DOC.section; } var _loc1_ = _loc2_.question.length; !(_loc1_ == undefined || _loc1_ == null || _loc1_ == "") ? (iTotalQuestions += _loc1_) : iTotalQuestions++; _loc3_ = _loc3_ + 1; } this.setTotalTestQuestions(iTotalQuestions); } function countTotalTestMark() { var iTotalSections = this.c_objScreenData.DOC.section.length; var iTotalMark = 0; var _loc1_ = undefined; if(iTotalSections == undefined || iTotalSections == null || iTotalSections == "") { iTotalSections = 1; } var _loc3_ = 0; while(_loc3_ < iTotalSections) { _loc1_ = this.c_objScreenData.DOC.section[_loc3_]; if(_loc1_ == null || _loc1_ == undefined) { _loc1_ = this.c_objScreenData.DOC.section; } if(_loc1_.attributes.assessed == "true") { var _loc2_ = _loc1_.question.length; if(_loc2_ == undefined || _loc2_ == null || _loc2_ == "") { iTotalMark += _loc1_.attributes.maxMark * 1; } else { iTotalMark += _loc1_.attributes.maxMark * _loc2_; } } _loc3_ = _loc3_ + 1; } com.controller.UICoordinator.getInstance().setTotalTestMark(iTotalMark); } function arrForNavigator(objTemp, strQuestionNumber, arrAttemptedQNos) { var _loc1_ = strQuestionNumber; var _loc2_ = this; var _loc3_ = objTemp; _loc2_.c_hQuestionState.put(_loc1_,_loc3_); _loc2_.c_arrToNavigator[Number(_loc1_.split("_")[1]) - 1] = _loc3_.correct; _loc2_.c_arrAttepmtedToNav[Number(_loc1_.split("_")[1]) - 1] = _loc3_.attempted; arrAttemptedQNos.push(Number(_loc1_.split("_")[1])); } function getFirstUnattempted(_arrAttemptedQNos) { var _loc2_ = _arrAttemptedQNos; var _loc3_ = 0; var iStartNo = 1; if(_loc2_[0] > iStartNo) { return 1; } var _loc1_ = 1; while(_loc1_ <= _loc2_.length) { if(_loc2_[_loc1_] != _loc2_[_loc1_ - 1] + 1) { break; } _loc3_ = _loc3_ + 1; _loc1_ = _loc1_ + 1; } return _loc2_[_loc3_] + 1; } function loadScreen() { var _loc1_ = this; _level101.gotoAndStop("TEST"); _level101.txt_UserName.text = "Name: " + _loc1_.c_objSourceRef.c_objUICoodInstance.userName; _level101.btn_submitTest._visible = false; _loc1_.attachPopUp(); _loc1_.setEvents(); _loc1_.attachAllClips(); _loc1_.c_iInterval = setInterval(_loc1_.loadScreenInterval,50,_loc1_); } function loadScreenInterval(objRef) { var _loc1_ = objRef; clearInterval(_loc1_.c_iInterval); _loc1_.arrangeNavigation(); if(_loc1_.c_strMode != "Review") { _loc1_.displayTimer(); } else { _level101.mc_Timer._visible = false; _level101.btn_quitTest._visible = false; _level101.btn_submitTest._visible = false; _level101.btn_quit._visible = false; _level101.btn_backToMenu._visible = true; } } function arrangeRubric() { var _loc2_ = this; var _loc3_ = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].attributes.rubricClip; var _loc1_ = _level101.attachMovie(_loc3_,"rubricBox",_level101.getNextHighestDepth(),{_x:8,_y:34.5}); _loc1_.txt_rubric.html = true; _loc1_.txt_rubric.htmlText = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].rubric.data; } function displayTimer() { var _loc1_ = this; _level101.mc_Timer._visible = true; _level101.btn_quitTest._visible = true; _level101.btn_quit._visible = true; _level101.btn_backToMenu._visible = false; if(_loc1_.c_strMode == "Continue") { var _loc2_ = com.controller.UICoordinator.getInstance().timeLeft; var _iMinLeft = _loc2_.split(".")[0]; var _loc3_ = _loc2_.split(".")[1]; _loc1_.objTimer = new com.comp.Timer(_level101,Number(_iMinLeft) + 1,Number(_loc3_),"mc_timer","txt_time",_loc1_); } else { var _iTotalTime = com.controller.UICoordinator.getInstance().getTestTime(); _loc1_.objTimer = new com.comp.Timer(_level101,_iTotalTime,60,"mc_timer","txt_time",_loc1_); } } function attachAllClips() { var _loc3_ = this; var iTotalSections = _loc3_.c_objScreenData.DOC.section.length; var _loc1_ = 0; while(_loc1_ < iTotalSections) { var _loc2_ = _loc3_.c_objScreenData.DOC.section[_loc1_].attributes.templateType; var iXPos = Number(_loc3_.c_objScreenData.DOC.section[_loc1_].attributes.XPos); var iYPos = Number(_loc3_.c_objScreenData.DOC.section[_loc1_].attributes.YPos); var mcQuestion = _level101.attachMovie(_loc2_,_loc2_,151 + _loc1_,{_x:iXPos,_y:iYPos}); mcQuestion._visible = false; _loc1_ = _loc1_ + 1; } } function arrangeNavigation() { var arrNav = new Array(); var _loc3_ = this.c_objScreenData.DOC.section; var _loc1_ = 0; while(_loc1_ < _loc3_.length) { var _loc2_ = ""; if(_loc3_[_loc1_].question.length != undefined) { var i = 0; while(i < _loc3_[_loc1_].question.length) { _loc2_ = _loc2_ + _loc3_[_loc1_].question[i].attributes.number + ","; i++; } _loc2_ = _loc2_.substr(0,_loc2_.length - 1); arrNav.push({id:_loc2_,type:_loc3_[_loc1_].attributes.navType,skill:_loc3_[_loc1_].attributes.skill}); } else { _loc2_ = _loc3_[_loc1_].question.attributes.number; arrNav.push({id:_loc2_,type:_loc3_[_loc1_].attributes.navType,skill:_loc3_[_loc1_].attributes.skill}); } false; _loc1_ = _loc1_ + 1; } var SkillType; SkillType = this.c_objScreenData.DOC.section[0].attributes.skill; var iNavYPos = this.c_objScreenData.DOC.attributes.YPos; this.c_objNavigator = new com.comp.Navigator(_level101,arrNav,SkillType,490,380,iNavYPos,this,this.c_iStartQuestion); this.c_objNavigator.showResult(); if(this.c_strMode == "Review" || this.c_strMode == "Continue") { this.c_objNavigator.reviewNav(this.c_arrToNavigator,this.c_strMode,this.c_arrAttepmtedToNav); } } function handleSound11() { var _loc1_ = this; if(!_loc1_.c_objSoundController) { } _loc1_.c_objSoundController = new com.comp.Soundconroller(_level101,604,47,null,1,"soundBtn"); if(!_loc1_.c_objVolumeController) { } if(!_loc1_.c_blnSoundController) { var _loc2_ = com.controller.UICoordinator.getInstance().volumeLevel; if(_loc2_ == "" or _loc2_ == undefined or _loc2_ == null) { _loc2_ = 50; } _loc1_.c_objVolumeController = new com.comp.Volumecontroller(_level101,534,5.5,_loc2_); _loc1_.c_blnSoundController = true; } else { _loc1_.c_objSoundController.c_icount = 0; _loc1_.c_objSoundController.c_ivolume = _loc1_.c_objVolumeController.getLevel(); } _loc1_.c_objSoundController.c_selfRef = _loc1_.c_objVolumeController; _loc1_.c_objSoundController.setVolumeValue(_loc1_.c_objVolumeController.getLevel()); } function showScreen(_strTemplateType, _strSelected, _iCurrQuestion, _strSkill) { var _loc1_ = this; var _loc2_ = _strSelected; _loc1_.c_iCurrQuestion = _iCurrQuestion; _loc1_.c_strSelected = _loc2_; _loc1_.c_strSkill = _strSkill; switch(_strTemplateType) { case "MCQType_1": _loc1_.initMCQType1(); break; case "MCQType_2": _loc1_.initMCQType2(); break; case "MCQType_3": _loc1_.initMCQType3(_loc2_); break; case "MCQType_4": _loc1_.initMCQType4(_loc2_); break; case "PairedMCQScrolling": _loc1_.initPairedMCQScrolling(); break; case "MCQType_5": _loc1_.initMCQType5(); break; case "FIBType_1": _loc1_.initFIB1(); break; case "AutoFillFib": _loc1_.initAutoFillFib(); break; case "FIBType_2": _loc1_.initWordCount(); break; case "FIBType_3": _loc1_.initMCQType7(); break; case "MCQType_6": _loc1_.initMCQTypeL1(); break; case "PairedMCQExtract": _loc1_.initPairedMCQExtract(); break; case "MCQType_7": _loc1_.initMCQTypeL2(); break; case "MCQType_8": _loc1_.initMCQType8(); break; case "FIBType_6": _loc1_.initFIBType6(); break; case "FIBType_4": _loc1_.initMCQTypeL3(); break; case "FIBType_5": _loc1_.initFIBType5(); break; case "UOEFIBType_5": _loc1_.initUOEFIBType5(); break; case "PairedDropDown": _loc1_.initPairedDropDown(); break; case "DropDownCollection": _loc1_.initDDCollection(); } } function commonToAllMCQs() { var _loc1_ = this; _level101.MCQ_Q1.init(); _loc1_.c_objMCQ = new com.screen.MCQ(_loc1_); _level101.MCQ_Q1.objTimelineRef = _loc1_.c_objMCQ; } function commonToAllQs() { var _loc1_ = this; _loc1_.c_iPartNo = Number(_loc1_.c_strSelected.split("_")[1]); _loc1_.arrangeRubric(); _loc1_.c_iQuestionNo = Number(_loc1_.c_strSelected.split("_")[2]) + 1; var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.templateType; _level101[_loc2_]._visible = true; return _loc2_; } function initNext(_strQuesType) { var _loc1_ = this; var _iSectionLength = Number(_loc1_.c_objScreenData.DOC.section.length); var _objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question; var _loc3_ = Number(_loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question.length); var _loc2_ = _level101[_strQuesType]; if(_loc1_.c_strMode == "Review") { if(_loc1_.c_objNavigator.c_iSeleID == _loc3_ && _loc1_.c_iPartNo == _iSectionLength - 1) { _loc2_.btn_next._visible = false; } else { _loc2_.btn_next._visible = true; } } else { _loc2_.btn_next._visible = false; } _loc2_.btn_next.objRef = _loc1_; _loc2_.btn_next.onRelease = function() { this.objRef.c_objNavigator.nextBtn(); }; } function selectAndFreeze() { var _loc1_ = this; if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null) { _level101.MCQ_Q1.setSelect(String(_loc1_.c_objHMObject.attempted)); } if(_loc1_.c_strMode == "Review") { _level101.MCQ_Q1.freeze(true); } } function initMCQType1() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); _loc1_.commonToAllMCQs(); _loc1_.initNext(_loc2_); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var iTotalChoices = _loc3_.choice.length; var iCorrectAnswer = _loc3_.attributes.correct; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,_loc3_,_level101[_loc2_],451,"1",null,_loc1_.c_strSkill,true); _loc1_.selectAndFreeze(); } function initMCQTypeL1() { var _loc1_ = this; var _loc3_ = _loc1_.commonToAllQs(); _loc1_.commonToAllMCQs(); _loc1_.initNext(_loc3_); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc3_; var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var iTotalChoices = _loc2_.choice.length; var iCorrectAnswer = _loc2_.attributes.correct; _loc1_.handleSound11(); var strSoundName = _loc2_.audio.data; _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName); _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,_loc2_,_level101[_loc3_],680,"MCQType_6",null,_loc1_.c_strSkill,false); _loc1_.selectAndFreeze(); } function initMCQType2() { var _loc1_ = this; var strClipName = _loc1_.commonToAllQs(); var _loc3_ = _level101[strClipName]; _loc1_.commonToAllMCQs(); var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var iTotalChoices = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].paragraph.length; var iTotalQuestionChoices = objQuestion.choice.length; var strCorrectAnswer = objQuestion.attributes.correct.toLowerCase().charCodeAt(0); var iCorrectAnswer = objQuestion.attributes.correct; if(_loc1_.c_blnOnceMCQ2) { _loc3_.mc_ScrollPaneContent.setScrollContent("mc_ScrollContent"); _loc3_.mc_ScrollContent = _level101[strClipName].mc_ScrollPaneContent.getScrollContent(); _loc3_.mc_ScrollPaneContent.setSize(_level101[strClipName].mc_ScrollReference._width,_level101[strClipName].mc_ScrollReference._height); _loc3_.mc_ScrollPaneContent._x = _level101[strClipName].mc_ScrollReference._x; _loc3_.mc_ScrollPaneContent._y = _level101[strClipName].mc_ScrollReference._y; _loc3_.mc_ScrollContent.txt_Description.selectable = false; _loc1_.c_blnOnceMCQ2 = false; } if(objSection.paragraphTitle.data.length > 0) { _loc3_.mc_ScrollContent.txt_Description.htmlText = "<p align=\'center\'><b>" + objSection.paragraphTitle.data + "<br><br></b>"; } else { _loc3_.mc_ScrollContent.txt_Description.htmlText = ""; } var _loc2_ = 1; while(_loc2_ <= iTotalChoices) { var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].paragraph[_loc2_ - 1].title.data; var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].paragraph[_loc2_ - 1].text.data; _loc3_.mc_ScrollContent.txt_Description.autoSize = true; _loc3_.mc_ScrollContent.txt_Description.htmlText += "<b>" + String.fromCharCode(64 + _loc2_) + " - " + strTitle + "</b>" + "<p></p>" + strText + "<p></p>" + "<p></p>"; _loc2_ = _loc2_ + 1; } _loc3_.mc_ScrollPaneContent.refreshPane(); _loc1_.initNext(strClipName); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objMCQ.init(iTotalQuestionChoices,iCorrectAnswer,objQuestion,_level101[strClipName],331.9,"MCQType_2",objSection,_loc1_.c_strSkill,true); _loc1_.selectAndFreeze(); } function initMCQTypeL2() { var _loc1_ = this; var strClipName = _loc1_.commonToAllQs(); var iTotalQuestions = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question.length; var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var strSoundName = objSection.audio.data; _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName; if(!_loc1_.c_blnInitL2) { var _loc2_ = 0; while(_loc2_ < iTotalQuestions) { var strInstanceName = "MCQ_Q_" + (_loc2_ + 1); var _loc3_ = new com.comp.ComponentMCQ(); _loc3_.init(); var objMCQ = new com.screen.MCQ(_loc1_); _loc3_.objTimelineRef = objMCQ; _loc1_.c_objMCQContainer[strInstanceName] = objMCQ; _loc2_ = _loc2_ + 1; } _loc1_.handleSound11(); _loc1_.c_blnInitL2 = true; } var strSound = "tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName; if(_loc1_.c_objNavigator.c_blnPartChange) { _loc1_.c_objSoundController.setSoundFile(strSound); _loc1_.c_objNavigator.c_blnPartChange = false; } _loc1_.initNext(strClipName); var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var iTotalChoices = objQuestion.choice.length; var iCorrectAnswer = objQuestion.attributes.correct; _loc1_.c_objMCQContainer["MCQ_Q_" + _loc1_.c_iQuestionNo].init(iTotalChoices,iCorrectAnswer,objSection,_level101[strClipName],493,"MCQType_7",objSection,_loc1_.c_strSkill,false); _loc1_.showSectionData(objSection); var bFreeze = _loc1_.c_strMode == "Review"; _loc1_.setFreezeMode(objSection,bFreeze); if(_loc1_.c_strMode == "Review") { var bLastPart = _loc1_.c_iPartNo == _loc1_.c_objScreenData.DOC.section.length - 1; _level101[strClipName].btn_Next._visible = !bLastPart; } } function showSectionData(objSection) { var iQuesCount = objSection.question.length; var _loc1_ = 0; while(_loc1_ < iQuesCount) { var _loc3_ = objSection.question[_loc1_].attributes.number; var _loc2_ = this.c_hQuestionState["get"](String(this.c_strSkill + "_" + _loc3_)); if(_loc2_ != null || _loc2_ != undefined) { _level101["ComponentMCQ_" + (_loc1_ + 1)].setSelect(String(_loc2_.attempted)); } _loc1_ = _loc1_ + 1; } } function setFreezeMode(objSection, bFreeze) { var _loc3_ = bFreeze; var _loc2_ = objSection.question.length; var _loc1_ = 1; while(_loc1_ <= _loc2_) { _level101["ComponentMCQ_" + _loc1_].freeze(_loc3_); _loc1_ = _loc1_ + 1; } } function initMCQType3() { var _loc1_ = this; var strClipName = _loc1_.commonToAllQs(); _loc1_.commonToAllMCQs(); var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var iTotalChoices = objQuestion.choice.length; var iCorrectAnswer = objQuestion.attributes.correct; if(_loc1_.c_blnOnceMCQ3) { var _loc2_ = 1; while(_loc2_ <= iTotalChoices) { var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].textTitle.data; var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].text.data; var _loc3_ = new com.comp.WordWrap(); _loc3_.init(_level101[strClipName],strTitle,strText,575,9,480); _loc2_ = _loc2_ + 1; } _loc1_.c_blnOnceMCQ3 = false; } _loc1_.initNext(strClipName); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],214,"3",objSection,_loc1_.c_strSkill,false); _loc1_.selectAndFreeze(); } function initMCQType4() { var _loc1_ = this; var _loc3_ = _loc1_.commonToAllQs(); _loc1_.commonToAllMCQs(); var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var iTotalChoices = objQuestion.choice.length; var iCorrectAnswer = objQuestion.attributes.correct; if(_loc1_.c_blnOnceMCQ4) { var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].title.data; var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].text.data; var _iCurrentQuestion = Number(objQuestion.attributes.number); var _iTotalQuestions = Number(objSection.question.length); _loc1_.c_iLastQustion = Number(_iTotalQuestions + _iCurrentQuestion - 1); var mcScrollPane = _level101[_loc3_].attachMovie("FScrollPaneSymbol","mcReadingScroll",_level101[_loc3_].getNextHighestDepth()); var iScrollPaneW = _level101[_loc3_].mc_ScrollBarRef._width; var iScrollPaneH = _level101[_loc3_].mc_ScrollBarRef._height; var iScrollPaneX = _level101[_loc3_].mc_ScrollBarRef._x; var iScrollPaneY = _level101[_loc3_].mc_ScrollBarRef._y; mcScrollPane.setSize(iScrollPaneW - 1,iScrollPaneH - 2); mcScrollPane._x = iScrollPaneX; mcScrollPane._y = iScrollPaneY + 1; var strTextFormat = new TextFormat(); strTextFormat.leftMargin = 7; mcScrollPane.setScrollContent("mc_ScrollContent"); var _loc2_ = mcScrollPane.getScrollContent(); _loc2_.txt_Description.autoSize = true; _loc2_.titleTxt.autoSize = true; _loc2_.txt_Description.htmlText = strText; _loc2_.txt_Description.setTextFormat(strTextFormat); if(strTitle != null && strTitle != "") { _loc2_.createTextField("titleTxt",15000,0,0,0,0); _loc1_.displayTitleText(_loc2_,strTitle); if(_loc1_.c_strEnvironment == "Linux") { _loc2_.titleTxt.embedFonts = true; } _loc2_.titleTxt.autoSize = "left"; _loc2_.txt_Description._y = _loc2_.titleTxt.textHeight + 8; } mcScrollPane.refreshPane(); _loc1_.c_blnOnceMCQ4 = false; } _loc1_.initNext(_loc3_); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc3_; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[_loc3_],330,"MCQType_4",objSection,_loc1_.c_strSkill,false); _loc1_.selectAndFreeze(); } function displayTitleText(mcScrollContent, strTitle) { var _loc2_ = mcScrollContent; var _loc1_ = new TextFormat(); _loc1_.font = "Verdana"; _loc1_.size = 11; _loc1_.color = "0x000000"; _loc1_.align = "center"; _loc2_.titleTxt.autoSize = true; _loc2_.titleTxt.html = true; _loc2_.titleTxt.htmlText = strTitle; _loc2_.titleTxt.multiline = true; _loc2_.titleTxt.selectable = false; _loc2_.titleTxt.text.autoSize = true; _loc2_.titleTxt.setTextFormat(_loc1_); false; } function initPairedMCQExtract() { var _loc2_ = this; var strClipName = _loc2_.commonToAllQs(); _loc2_.commonToAllMCQs(); _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName; var objSection = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo]; var objQuestion = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].question[_loc2_.c_iQuestionNo - 1]; var _loc3_ = Number(objQuestion.attributes.number); var iTotalChoices = objQuestion.choice.length; var iCorrectAnswer = objQuestion.attributes.correct; _loc2_.initNext(strClipName); _loc2_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],680,"PairedMCQExtract",objSection,_loc2_.c_strSkill,false,_loc3_); if(_loc3_ % 2 == 0) { _loc2_.showSectionDataMCQ(_loc3_ - 1,_loc3_); } if(_loc3_ % 2 == 1) { _loc2_.showSectionDataMCQ(_loc3_,_loc3_ + 1); } if(!_loc2_.c_blnPairedMCQExtract) { _loc2_.c_blnPairedMCQExtract = true; } if(_loc2_.c_iPairID != null || _loc2_.c_iPairID != undefined) { if(_loc2_.c_iPairID != _loc2_.c_iPrevPairID || _loc2_.c_objNavigator.c_blnPartChange) { _loc2_.handleSound11(); var strSoundName = objSection.extract[_loc2_.c_iPairID].audio.data; var strSound = "tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName; _loc2_.c_objSoundController.setSoundFile(strSound); _loc2_.c_iPrevPairID = _loc2_.c_iPairID; _loc2_.c_objNavigator.c_blnPartChange = false; } } if(_loc2_.c_strMode == "Review") { var queObj = objSection.question; var _loc1_ = 0; while(_loc1_ < queObj.length) { _level101.MCQ_Q1["ComponentMCQ_" + _loc1_].freeze(true); _loc1_ = _loc1_ + 1; } } } function initPairedMCQScrolling() { var _loc2_ = this; var strClipName = _loc2_.commonToAllQs(); _loc2_.commonToAllMCQs(); var objQuestion = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo].question[_loc2_.c_iQuestionNo - 1]; var objSection = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo]; var iTotalChoices = objQuestion.choice.length; var iCorrectAnswer = objQuestion.attributes.correct; var iPairId = objQuestion.attributes.Pair; var _loc3_ = Number(objQuestion.attributes.number); _loc2_.initNext(strClipName); _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName; _loc2_.c_objHMObject = _loc2_.c_hQuestionState["get"](String(_loc2_.c_strSkill + "_" + _loc2_.c_iCurrQuestion)); _loc2_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],340,"PairedMCQScrolling",objSection,_loc2_.c_strSkill,false,_loc3_); if(_loc2_.c_iPairID != null || _loc2_.c_iPairID != undefined) { if(_loc2_.c_iPairID != _loc2_.c_iPrevPairID) { _loc2_.c_blnPairedScrolling = true; _loc2_.c_iPrevPairID = _loc2_.c_iPairID; } } if(_loc3_ % 2 == 0) { _loc2_.showSectionDataMCQ(_loc3_ - 1,_loc3_); } if(_loc3_ % 2 == 1) { _loc2_.showSectionDataMCQ(_loc3_,_loc3_ + 1); } if(_loc2_.c_strMode == "Review") { var _loc1_ = 1; while(_loc1_ <= 2) { _level101.MCQ_Q1["ComponentMCQ_" + _loc1_].freeze(true); _loc1_ = _loc1_ + 1; } } } function showSectionDataMCQ(iFirstQues, iLastQues) { var iQuesCount = iLastQues - iFirstQues + 1; var _loc3_ = iFirstQues; var _loc2_ = 0; while(_loc2_ < iQuesCount) { var _loc1_ = this.c_hQuestionState["get"](String(this.c_strSkill + "_" + _loc3_)); if(_loc1_.attempted != null || _loc1_.attempted != undefined) { _level101.MCQ_Q1["ComponentMCQ_" + (_loc2_ + 1)].setSelect(String(_loc1_.attempted)); } _loc3_ = _loc3_ + 1; _loc2_ = _loc2_ + 1; } } function initMCQTypeL4() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); var iTotalQuestions = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question.length; var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var strSoundName = objSection.audio.data; _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; if(!_loc1_.c_blnInitL4) { _loc1_.commonToAllMCQs(); _loc1_.handleSound11(); _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName); _loc1_.c_blnInitL4 = true; } _loc1_.initNext(_loc2_); var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var iTotalChoices = _loc3_.choice.length; var iCorrectAnswer = _loc3_.attributes.correct; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_["c_objMCQ_1" + _loc1_.c_iQuestionNo].init(iTotalChoices,iCorrectAnswer,_loc3_,_level101[_loc2_],300,"4",objSection,_loc1_.c_strSkill,false); if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null) { _level101["MCQ_Q_1" + _loc1_.c_iQuestionNo].setSelect(String(_loc1_.c_objHMObject.attempted)); } if(_loc1_.c_strMode == "Review") { _level101["MCQ_Q_1" + _loc1_.c_iQuestionNo].freeze(true); } } function initMCQType5() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); _loc1_.commonToAllMCQs(); var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var iTotalChoices = _loc3_.choice.length; var iCorrectAnswer = _loc3_.attributes.correct; if(_loc1_.c_blnOnceMCQ5) { var strTitle = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].title; var strText = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].text.data; _loc1_.c_objFIB2 = new com.screen.FIB2(); _loc1_.c_objFIB2.init(_level101[_loc2_],strTitle,strText,500,294.6,10,"fibbox","Button",1,_loc1_.c_objNavigator); _loc1_.c_blnOnceMCQ5 = false; } _loc1_.c_objFIB2.navBtnClicked(_loc1_.c_iQuestionNo - 1); _loc1_.initNext(_loc2_); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,_loc3_,_level101[_loc2_],195.9,"MCQType_5",objSection,_loc1_.c_strSkill,false); _loc1_.selectAndFreeze(); if(_loc1_.c_strMode == "Review") { _loc1_.c_objFIB2.freeze(true); } } function initMCQType7() { var _loc1_ = this; var strClipName = _loc1_.commonToAllQs(); _loc1_.commonToAllMCQs(); var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question; var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var iTotalChoices = objQuestion.text.length; var iCorrectAnswer = objQuestion.attributes.correct; if(_loc1_.c_blnOnceMCQ7) { _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.type = "dynamic"; _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.selectable = false; _loc1_.c_blnOnceMCQ7 = false; } _loc1_.initNext(strClipName); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _level101.FIBType_3.mc_ScrollContent.txt_wordLimit.text = objSection.attributes.rubricLimit; _loc1_.c_objMCQ.init(iTotalChoices,iCorrectAnswer,objQuestion,_level101[strClipName],214,"FIBType_3",objSection,_loc1_.c_strSkill,false); _loc1_.c_objMCQ.resetMcq7(); if(_loc1_.c_strMode != "Review") { _loc1_.c_objMCQ.displayPreviousSelection(); } if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null && _loc1_.c_objHMObject != "") { if(_loc1_.c_objHMObject.answeroption != null && _loc1_.c_objHMObject.answeroption != undefined && _loc1_.c_objHMObject.answeroption != "") { _level101.MCQ_Q1.setSelect(String(_loc1_.c_objHMObject.answeroption - 1)); var mcScrollContent = _level101.MCQ_Q1.mc_ScrollPane.getScrollContent(); _level101.txt_Tracer.text += mcScrollContent["mc_MCQ7Choice" + (_loc1_.c_objHMObject.answeroption - 1)].mc_textcont; var _loc3_ = 1; while(_loc3_ <= iTotalChoices) { mcScrollContent["mc_MCQ7Choice" + _loc3_].mc_textcont.gotoAndStop("_desel"); _loc3_ = _loc3_ + 1; } mcScrollContent["mc_MCQ7Choice" + (_loc1_.c_objHMObject.answeroption - 1)].mc_textcont.gotoAndStop("_sel"); } if(_loc1_.c_objHMObject.attempted != null && _loc1_.c_objHMObject.attempted != undefined && _loc1_.c_objHMObject.attempted != "") { if(_level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.maxscroll > 1) { _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar._visible = true; _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar1._visible = true; } _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.type = "input"; } } if(_loc1_.c_strMode == "Review") { _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.text = ""; _level101.FIBType_3.mc_ScrollContent.dyntxt_WC._visible = false; _level101.FIBType_3.mc_ScrollContent.txt_Statement._visible = false; _level101.FIBType_3.mc_ScrollContent.txt_wordLimit._visible = false; _level101.FIBType_3.mc_ScrollContent.txt_WCHeading._visible = false; var _iCurrentOptionID = Number(_loc1_.c_objHMObject.answeroption); var _strSaparator = ""; _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar1._visible = true; if(_level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.maxscroll > 2 || _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.scroll > 1) { _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar._visible = true; } _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.html = true; _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.selectable = false; var tempBoolean = false; var _loc2_ = 0; while(_loc2_ <= iTotalChoices - 1) { if(_loc1_.c_objHMObject.attempted != null || _loc1_.c_objHMObject.attempted != undefined) { if(!tempBoolean) { _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText = _loc1_.c_objHMObject.attempted; tempBoolean = true; } _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText += "<br/><b>Sample Answer -- " + (_loc2_ + 2) + "</b>" + "<br/><br/>" + unescape(objQuestion.sampleAnswer[_loc2_].data) + "<br/>"; var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" "); } else { _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText += "<b>Sample Answer --" + (_loc2_ + 2) + "</b><br/><br/>" + objQuestion.sampleAnswer[_loc2_].data + "<br/><br/>"; } _loc2_ = _loc2_ + 1; } _level101.MCQ_Q1.freeze(true); _loc1_.c_objWordCountText.freeze(); } if(_loc1_.c_strMode == "Continue") { _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.htmlText = _loc1_.c_objHMObject.attempted; var txtBox = _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.text; if(_level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.maxscroll > 2 || _level101.FIBType_3.mc_ScrollContent.inptxt_WCtxt.scroll > 1) { _level101.FIBType_3.mc_ScrollContent.cmp_ScrollBar._visible = true; } if(_loc1_.c_objHMObject.attempted != null || _loc1_.c_objHMObject.attempted != undefined) { var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" "); var ctr = 0; _loc3_ = 0; while(_loc3_ < _arrSplitedspace.length) { if(_arrSplitedspace[_loc3_] != "") { ctr += 1; } _loc3_ = _loc3_ + 1; } _level101.FIBType_3.mc_ScrollContent.dyntxt_WC.text = ctr.toString(); _level101.FIBType_3.mc_ScrollContent.dyntxt_WC.selectable = false; } else { _level101.FIBType_3.mc_ScrollContent.dyntxt_WC.text = 0; } var strLen = String(_loc1_.c_objHMObject.attempted).length; Selection.setFocus(); Selection.setSelection(0,strLen); } } function initMCQType8() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; _loc1_.commonToAllMCQs(); var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var objQuestions = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question; var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var iTotalChoices = _loc3_.choices.length; var iCorrectAnswer = _loc3_.attributes.correct; if(_loc1_.c_blnOnceMCQ8) { _loc1_.c_objDropDown = new com.screen.DropDown(); _loc1_.c_objDropDown.init(_level101[_loc2_],objSection,400,294.6,10,"FComboBoxSymbol","Button",_loc1_.c_iPartNo,_loc1_.c_objNavigator); _loc1_.c_blnOnceMCQ8 = false; } _level101[_loc2_].txt_QuestionNo.text = _loc3_.attributes.number; _loc1_.initNext(_loc2_); _loc1_.c_objDropDown.navBtnClicked(_loc1_.c_iQuestionNo - 1); if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo) { _level101[_loc2_].btn_Next._visible = false; } } function initFIB1(_strFibType, _strQuesSelected) { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var strTitle = objQuestion.text.data; var strText = objQuestion.text2.data; var objText = objQuestion.text2; var iQuesNumber; iQuesNumber = Number(_loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1].attributes.number); var _iX = 180; var _iY = 250; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objFIB2_1 = new com.screen.FIB2(); _loc1_.c_objFIB2_1.init(_level101[_loc2_],"",strText,400,0,0,"mc_FIBquestion","textField",_loc1_.c_iPartNo); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; var _loc3_ = new com.screen.FIB1(); var firstBoxRefY = _loc1_.c_objFIB2_1.getFibRefY(); _loc3_.init(_level101,iQuesNumber,_loc2_,_loc1_.c_objFIB2_1.getHeight(),_loc1_.c_objFIB2_1.getFibRefY(),objText,_loc1_.c_iPartNo,_loc1_); _loc1_.initNext(_loc2_); if(_loc1_.c_strMode == "Review") { _loc3_.c_objFIB.freeze(); } if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null) { _loc3_.c_objFIB.c_txtInpRef.text = _loc1_.c_objHMObject.attempted; if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo) { _level101[_loc2_].btn_Next._visible = true; } else { _level101[_loc2_].btn_Next._visible = false; } } if(_loc1_.c_strMode == "Review") { if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo) { _level101[_loc2_].btn_Next._visible = true; } else { _level101[_loc2_].btn_Next._visible = false; } } } function initAutoFillFib() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question[_loc1_.c_iQuestionNo - 1]; var strText = objQuestion.text.data; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objFIB2_1 = new com.screen.FIB2(); _loc1_.c_objFIB2_1.init(_level101[_loc2_],"",strText,500,0,0,"mc_FIB_Answer","textField",_loc1_.c_iPartNo); var arrFib = _loc1_.c_objFIB2_1.getNumberOfBox(); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; var _loc3_ = new com.screen.AutoFillFib(); _loc3_.init(_level101[_loc2_],objSection,objQuestion,_loc1_.c_objFIB2_1.getHeight(),arrFib,_loc1_); _loc1_.initNext(_loc2_); if(_loc1_.c_strMode == "Review") { _loc3_.freeze(); } if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null) { _level101.txt_Tracer7.text += "TTTTTTTTTT APEND OBJECT"; _loc3_.c_txtInpRef.text = _loc1_.c_objHMObject.attempted; _loc3_.c_txtInpRef_1.text = _loc1_.c_objHMObject.attempted; _loc3_.c_txtInpRef_2.text = _loc1_.c_objHMObject.attempted; if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo) { _level101[_loc2_].btn_Next._visible = true; } else { _level101[_loc2_].btn_Next._visible = false; } } if(_loc1_.c_strMode == "Review") { if(_loc1_.c_objScreenData.DOC.section[_loc1_.c_objScreenData.DOC.section.length - 1].question.length != _loc1_.c_iQuestionNo) { _level101[_loc2_].btn_Next._visible = true; } else { _level101[_loc2_].btn_Next._visible = false; } } } function initWordCount() { var _loc1_ = this; var strClipName = _loc1_.commonToAllQs(); var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question; _loc1_.c_objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var maxWordLimit = Number(_loc1_.c_objSection.attributes.maxWords); _level101[strClipName].txt_wordLimit.text = _loc1_.c_objSection.attributes.rubricLimit; var strQuestionNo = _loc1_.c_iCurrQuestion; var strText = objQuestion.text.data; var headerText = objQuestion.headerText.data; var imageData = objQuestion.image.data; _loc1_.c_objHMObject = _loc1_.c_hQuestionState["get"](String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion)); _loc1_.c_objWordCountText = new com.screen.WordCountText(); _loc1_.c_objWordCountText.init(_level101[strClipName],strQuestionNo,strText,_loc1_,headerText,imageData,maxWordLimit); _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = strClipName; _loc1_.initNext(strClipName); if(_loc1_.c_objHMObject != undefined && _loc1_.c_objHMObject != null) { _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.text = _loc1_.c_objHMObject.attempted; var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" "); _level101[strClipName].btn_Next._visible = true; var _loc3_ = 0; var _loc2_ = 0; while(_loc2_ < _arrSplitedspace.length) { if(_arrSplitedspace[_loc2_] != "") { _loc3_ += 1; } _loc2_ = _loc2_ + 1; } _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.dyntxt_WC.text = _loc3_.toString(); _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.dyntxt_WC.selectable = false; var strLen = _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.text; Selection.setFocus(); Selection.setSelection(0,strLen.length); } if(_loc1_.c_strMode == "Review") { _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.dyntxt_WC._visible = false; _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.txt_wordLimit._visible = false; _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.txtFooter._visible = false; _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.headerWord._visible = false; _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.mc_bottomText._visible = false; var _arrSplitedspace = _loc1_.c_objHMObject.attempted.split(String.fromCharCode(13)).join(" ").split(" "); _loc1_.c_objWordCountText.freeze(); _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.html = true; _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.htmlText = _loc1_.c_objHMObject.attempted + "\n\n<b>Sample Answer -- </b><br/><br/>" + objQuestion.sampleAnswer.data; if(_loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.textHeight > _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.height) { _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = true; } else { _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = false; } } if(_loc1_.c_strMode == "Continue") { if(_loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.textHeight > _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.inptxt_WCtxt.height) { _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = true; } else { _loc1_.c_objWordCountText.c_SourceClip.mc_WordInp.wcTextScroller._visible = false; } } } function initFIBType6() { var _loc2_ = this; var strClipName = _loc2_.commonToAllQs(); var _loc3_ = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo]; var strTitle = _loc3_.textTitle.data; var strText = _loc3_.text.data; var strSoundName = _loc3_.audio.data; _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName; if(!_loc2_.c_blnFIB4) { _loc2_.c_objFIB4 = new com.screen.FIB4(); _loc2_.c_objFIB4.c_iExtID = _loc3_.question[0].attributes.number; var totalQuestion = _loc3_.question[0].attributes.totalQuestion; var _loc1_ = 0; while(_loc1_ < totalQuestion) { _loc2_.c_objFIB4.c_hintArray[_loc1_] = _loc3_.question[_loc1_].ansHint.data; _loc1_ = _loc1_ + 1; } _loc2_.c_objFIB4.init(_level101[strClipName],_loc3_," ",strText,470,14,10,"FComboBoxSymbol","MovieClip",_loc2_.c_iPartNo,_loc2_.c_objNavigator); _loc2_.handleSound11(); _loc2_.c_blnFIB4 = true; } if(_loc2_.c_objNavigator.c_blnPartChange) { _loc2_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName); _loc2_.c_objNavigator.c_blnPartChange = false; } _loc2_.initNext(strClipName); _loc2_.c_objFIB4.navBtnClicked(_loc2_.c_iQuestionNo - 1); } function initMCQTypeL3() { var _loc1_ = this; var _loc3_ = _loc1_.commonToAllQs(); var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var strTitle = _loc2_.textTitle; var strText = _loc2_.text.data; var strSoundName = _loc2_.audio.data; _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc3_; if(!_loc1_.c_blnFIB3) { _loc1_.c_objFIB2_2 = new com.screen.FIB2(); _loc1_.c_objFIB2_2.c_iExtID = _loc2_.question[0].attributes.number; _loc1_.c_objFIB2_2.init(_level101[_loc3_],strTitle,strText,470,14,10,"mc_FIBL","MovieClip",_loc1_.c_iPartNo,_loc1_.c_objNavigator); _loc1_.handleSound11(); _loc1_.c_blnFIB3 = true; } if(_loc1_.c_objNavigator.c_blnPartChange) { _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName); _loc1_.c_objNavigator.c_blnPartChange = false; } _loc1_.initNext(_loc3_); _loc1_.c_objFIB2_2.navBtnClicked(_loc1_.c_iQuestionNo - 1); } function initUOEFIBType5() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var strTitle = _loc3_.textTitle; var strText = _loc3_.text.data; var strSoundName = _loc3_.audio.data; _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; if(!_loc1_.c_blnUOEFIB3) { _loc1_.c_objUOEFIB3 = new com.screen.FIB2(); _loc1_.c_objUOEFIB3.c_iExtID = _loc3_.question[0].attributes.number; _loc1_.c_objUOEFIB3.init(_level101[_loc2_],strTitle,strText,425,14,10,"mc_FIBL","MovieClip",_loc1_.c_iPartNo,_loc1_.c_objNavigator); _loc1_.c_blnUOEFIB3 = true; } _loc1_.initNext(_loc2_); _loc1_.c_objUOEFIB3.navBtnClicked(_loc1_.c_iQuestionNo - 1); if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo) { _level101[_loc2_].btn_Next._visible = false; } } function initPairedDropDown() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); var objSection = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var strTitle = _loc3_.textTitle.data; var strText = _loc3_.text.data; var strSoundName = _loc3_.audio.data; _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; if(!_loc1_.c_blnPairedDropDown) { _loc1_.c_objPairedDropDown = new com.screen.PairedDropDown(); _loc1_.c_objPairedDropDown.init(_level101[_loc2_],objSection,strTitle,strText,520,14,10,"FComboBoxSymbol","Button",_loc1_.c_iPartNo,_loc1_.c_objNavigator); _loc1_.c_blnPairedDropDown = true; } _loc1_.initNext(_loc2_); _loc1_.c_objPairedDropDown.navBtnClicked(_loc1_.c_iQuestionNo - 1); if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo) { _level101[_loc2_].btn_Next._visible = false; } } function initDDCollection() { var _loc1_ = this; var _loc2_ = _loc1_.commonToAllQs(); var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo]; var strSoundName = _loc3_.audio.data; _loc1_.c_arrQuestionTypes[_loc1_.c_iPartNo] = _loc2_; if(!_loc1_.c_blnDDCollection) { _loc1_.c_objDDCollection = new com.screen.DropDownCollection(); var totalQuestion = _loc3_.question[0].attributes.totalQuestion; _loc1_.c_objDDCollection.init(_level101[_loc2_],_loc3_,425,14,10,"FComboBoxSymbol",_loc1_.c_iPartNo,_loc1_.c_objNavigator); _loc1_.handleSound11(); _loc1_.c_blnDDCollection = true; } var strSound = "tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName; if(_loc1_.c_objNavigator.c_blnPartChange) { _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName); _loc1_.c_objNavigator.c_blnPartChange = false; } _loc1_.initNext(_loc2_); _loc1_.c_objDDCollection.navBtnClicked(_loc1_.c_iQuestionNo - 1); if(_loc1_.c_objScreenData.DOC.section.length - 1 == _loc1_.c_iPartNo) { _level101[_loc2_].btn_Next._visible = false; } } function initFIBType5() { var _loc2_ = this; var strClipName = _loc2_.commonToAllQs(); var _loc3_ = _loc2_.c_objScreenData.DOC.section[_loc2_.c_iPartNo]; var strTitle = _loc3_.textTitle; var strText = _loc3_.text.data; var strSoundName = _loc3_.audio.data; _loc2_.c_arrQuestionTypes[_loc2_.c_iPartNo] = strClipName; if(!_loc2_.c_blnFIB2_2) { _loc2_.c_objFIB3_1 = new com.screen.FIB3(); _loc2_.c_objFIB3_1.c_iExtID = _loc3_.question[0].attributes.number; var totalQuestion = _loc3_.question[0].attributes.totalQuestion; _loc2_.c_objFIB3_1.exampleText = _loc3_.question[0].attributes.dummyText; var _loc1_ = 0; while(_loc1_ < totalQuestion) { _loc2_.c_objFIB3_1.c_hintArray[_loc1_] = _loc3_.question[_loc1_].ansHint.data; _loc1_ = _loc1_ + 1; } _loc2_.c_objFIB3_1.init(_level101[strClipName],strTitle,strText,425,14,10,"mc_FIBLarge","MovieClip",_loc2_.c_iPartNo,_loc2_.c_objNavigator); _loc2_.c_blnFIB2_2 = true; } _loc2_.initNext(strClipName); _loc2_.c_objFIB3_1.navBtnClicked(_loc2_.c_iQuestionNo - 1); if(_loc2_.c_objScreenData.DOC.section.length - 1 == _loc2_.c_iPartNo) { _level101[strClipName].btn_Next._visible = false; } } function arrangeButtons() { if(this.c_objSourceRef.c_blnXMLLoaded) { } } function appendQuesObject(_objQuesData) { var _loc1_ = this; _loc1_.c_hQuestionState.put(String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion),_objQuesData); if(_loc1_.c_hQuestionState.getlength() == _loc1_.getTotalTestQuestions()) { if(_loc1_.c_strMode != "Review") { _level101.btn_quitTest._visible = false; _level101.btn_submitTest._visible = true; } } } function removeQuesObject() { var _loc1_ = this; var _loc2_ = String(_loc1_.c_strSkill + "_" + _loc1_.c_iCurrQuestion); _loc1_.c_hQuestionState.deleteKey(_loc2_); _level101.btn_quitTest._visible = true; _level101.btn_submitTest._visible = false; } function onPartChange(_iPrePart, _iCurrPart) { var _loc1_ = this; _loc1_.c_objNavigator.setTopNavPosition(); var _loc2_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.templateType; if(_loc2_ == "PairedDropDown" || _loc2_ == "MCQType_4") { _level101.PairedDropDown.mc_textOnlyScrollBar.setScrollPosition(0,0); _loc1_.c_blnOnceMCQ4 = true; _loc1_.c_blnPairedScrolling = true; } _level101.mc_Nav._y = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.navYPos; var strPreviousTemplate = _loc1_.c_objScreenData.DOC.section[_iPrePart].attributes.templateType; switch(strPreviousTemplate) { case "UOEFIBType_5": _loc1_.c_objUOEFIB3.removedMovieObject(); break; case "FIBType_5": _loc1_.c_objFIB3_1.removedMovieObject(); break; case "FIBType_1": _loc1_.c_objFIB2_1.removedMovieObject(); break; case "AutoFillFib": _loc1_.c_objFIB2_1.removedMovieObject(); break; case "FIBType_4": _loc1_.c_objFIB2_2.removedMovieObject(); break; case "FIBType_6": _loc1_.c_objFIB4.removedMovieObject(); } var strClip = _loc1_.c_arrQuestionTypes[_iPrePart]; _level101[strClip]._visible = false; var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].attributes.navType; if(_loc1_.c_strSkillName.toLowerCase() == "listening" && _loc3_ == "2") { var strSoundName = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].audio.data; _loc1_.handleSound11(); _loc1_.c_objSoundController.setSoundFile("tests/test" + com.controller.UICoordinator.getInstance().currentTestNumber + "/sound/" + strSoundName); } else { _level101[_loc1_.c_arrQuestionTypes[_iCurrPart]]._visible = true; } } function setFirstUnattemptedL(_objNavData) { var _loc1_ = this; if(!_loc1_.c_blnContinueL) { var objQuestion = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question; var _iQPartTwo = objQuestion[0].attributes.number; if(_loc1_.c_iStartQuestion >= _iQPartTwo) { var _loc2_ = 0; while(_loc2_ < objQuestion.length) { var _loc3_ = Number(objQuestion[_loc2_].attributes.number); if(_loc3_ == _loc1_.c_iStartQuestion) { _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd; _loc1_.c_objNavigator.c_strSelecetd = "_" + _loc1_.c_iPartNo + "_" + _loc2_; _loc1_.c_objNavigator.c_iSeleID = _loc1_.c_iStartQuestion; _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------ "; _loc1_.c_objNavigator.navClickedfunction(); break; } _loc2_ = _loc2_ + 1; } } else { _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd; _loc1_.c_objNavigator.c_strSelecetd = _objNavData.navCurrSel; _loc1_.c_objNavigator.c_iSeleID = _objNavData.navSelID; _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------ "; _loc1_.c_objNavigator.navClickedfunction(); } _loc1_.c_blnContinueL = true; } else { _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd; _loc1_.c_objNavigator.c_strSelecetd = _objNavData.navCurrSel; _loc1_.c_objNavigator.c_iSeleID = _objNavData.navSelID; _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------ "; _loc1_.c_objNavigator.navClickedfunction(); } } function setMCQSelection(_mcChoice) { var _loc1_ = this; var _loc2_ = Number(_mcChoice._name.split("_")[2]); var _loc3_ = _loc1_.c_objScreenData.DOC.section[_loc1_.c_iPartNo].question; _loc1_.resetPanelState(); _mcChoice.gotoAndStop("_SELECTED"); _loc1_.c_iQuestionNo = _loc2_; if(_loc1_.c_strMode == "Take" || _loc1_.c_strMode == "Retake" || _loc1_.c_strMode == "Continue") { _loc1_.c_objNavigator.c_preSelecetd = _loc1_.c_objNavigator.c_strSelecetd; _loc1_.c_objNavigator.c_strSelecetd = "_" + _loc1_.c_iPartNo + "_" + (_loc2_ - 1); _loc1_.c_objNavigator.c_iSeleID = _loc3_[_loc1_.c_iQuestionNo - 1].attributes.number; _level101.txt_Tracer20.text += "\n navClickedfunction::::TEST Class::::called ------ "; _loc1_.c_objNavigator.navClickedfunction(); } } function updateHeader(_str) { var _loc1_ = new TextFormat(); _loc1_.bold = true; var _loc2_ = String(this.c_objScreenData.DOC.section[this.c_iPartNo].attributes.header + " Test" + ": " + _str); _level101.txt_Screenheader.html = true; _level101.txt_Screenheader.htmlText = _loc2_; _level101.txt_Screenheader.setTextFormat(_loc1_); } function setEvents() { var _loc1_ = this; if(_loc1_.c_strMode == "Review") { _level101.btn_Instruction._visible = false; } else { _level101.btn_Instruction._visible = true; } _level101.btn_quitTest.objRef = _loc1_; _level101.btn_quitTest.onRelease = function() { var _loc1_ = this; if(_loc1_.objRef.c_strEnvironment == "Windows" || _loc1_.objRef.c_strEnvironment == "Macintosh") { _loc1_.objRef.btn_quitTest(); } else if(_loc1_.objRef.c_strEnvironment == "Linux") { _loc1_.objRef.popupNo(); } }; _level101.btn_submitTest.objRef = _loc1_; _level101.btn_submitTest.onRelease = function() { this.objRef.btn_submitTest(); }; _level101.btn_backToMenu.objRef = _loc1_; _level101.btn_backToMenu.enabled = true; _level101.btn_backToMenu.onRelease = function() { this.objRef.backToTestMenu(); }; _level101.btn_quit.objRef = _loc1_; _level101.btn_quit.onRelease = function() { this.objRef.btn_quit(); }; _level101.btn_Instruction.objRef = _loc1_; _level101.btn_Instruction.onRelease = function() { this.objRef.showInstruction(); }; } function btn_quit() { var _loc1_ = this; var strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment(); _loc1_.removeElements(); var _loc2_ = function(success) { if(strEnvironment == "Windows" || strEnvironment == "Macintosh") { getUrl("lingo:closeApplication", ""); } else if(strEnvironment == "Linux") { fscommand("quit"); } }; if(_loc1_.c_strEnvironment == "Windows" || _loc1_.c_strEnvironment == "Macintosh") { _loc1_.connectXMLSocket("true",_loc1_.objTimer.getMinsTime(),_loc2_); } else if(_loc1_.c_strEnvironment == "Linux") { _loc2_(); } } function showInstruction() { var _loc3_ = this; _level101.attachMovie("mc_PopupInstruction","mc_PopupInstruction",650); var _loc1_ = _level101.mc_PopupInstruction; var _txtInstruction = _loc1_.mc_text.txt_inst; var _loc2_ = undefined; _loc1_._x = 175; _loc1_._y = 160; _loc1_.btn_CloseInstruction.onRelease = function() { this._parent._visible = false; }; _loc1_.btn_Disable.onRelease = function() { trace(""); }; _loc1_.btn_Disable.onRollOver = function() { this.useHandCursor = false; }; var _objInstructionXML = com.controller.UICoordinator.getInstance().c_objInstructionXML; if(_loc3_.c_strSkill.toLowerCase() == "listening") { _loc2_ = _objInstructionXML.instructions.instructionslistening.data; } else if(_loc3_.c_strSkill.toLowerCase() == "reading") { _loc2_ = _objInstructionXML.instructions.instructionsreading.data; } else if(_loc3_.c_strSkill.toLowerCase() == "writing") { _loc2_ = _objInstructionXML.instructions.instructionswriting.data; } else if(_loc3_.c_strSkill.toLowerCase() == "use of english") { _loc2_ = _objInstructionXML.instructions.instructionsuseofenglish.data; } _txtInstruction.html = true; _txtInstruction.htmlText = _loc2_; _loc1_._visible = true; } function removeElements() { var _loc2_ = this; _level101.rubricBox._visible = false; var _loc1_ = 0; while(_loc1_ < _loc2_.c_arrQuestionTypes.length) { _level101[_loc2_.c_arrQuestionTypes[_loc1_]].removeMovieClip(); _level101.soundBtn._visible = false; _level101.volumeBox._visible = false; _level101.soundLevel._visible = false; _loc1_ = _loc1_ + 1; } } function btn_quitTest() { var _loc2_ = this; var _loc1_ = _level101.mc_PopUp; _loc1_.gotoAndStop("quittest"); _loc1_._x = 173.5; _loc1_._y = 155.5; var iTotalAttemptedQues = _loc2_.c_hQuestionState.getlength(); var iRemainingQues = _loc2_.c_iTotalTestQuestions - iTotalAttemptedQues; _loc1_.txt_leftQues.text = iRemainingQues; _loc1_.txt_QuitTest.autoSize = true; if(_loc2_.c_strSkill == "writing") { _loc1_.txt_QuitTest.text = "You have not answered questions\nand have minute(s) remaining.\nIn this section your answers are not scored.\nDo you want to complete this test later?"; } else { _loc1_.txt_QuitTest.text = "You have not answered questions\nand have minute(s) remaining.\nDo you want to complete this test later?"; } _loc1_.txt_QuitTest.autoSize = true; var _loc3_ = 0; _loc3_ = _loc2_.objTimer.getSecTime(); _loc1_.txt_timeRemain.text = Math.floor(_loc3_); _loc1_.popupYes.objRef = _loc2_; _loc1_.popupYes.onRelease = function() { this.objRef.popupYes(); }; _loc1_.popupYes.onRollOver = function() { this.gotoAndStop("OVER"); }; _loc1_.popupYes.onRollOut = _loc1_.popupYes.onReleaseOutside = function() { this.gotoAndStop("UP"); }; _loc1_.popupNo.objRef = _loc2_; _loc1_.popupNo.onRelease = function() { this.objRef.popupNo(); }; _loc1_.popupNo.onRollOver = function() { this.gotoAndStop("OVER"); }; _loc1_.popupNo.onRollOut = _loc1_.popupNo.onReleaseOutside = function() { this.gotoAndStop("UP"); }; _loc1_.btn_CloseQuitTestDialog.objRef = _loc2_; _loc1_.btn_CloseQuitTestDialog.onRelease = function() { this._parent.gotoAndStop("blank"); }; } function getScore() { var iscore = 0; var _iTotalQuestion = this.getTotalTestQuestions(); var _loc1_ = 0; while(_loc1_ < _iTotalQuestion) { var _loc3_ = String(this.c_strSkill.toLowerCase() + "_" + (_loc1_ + 1)); var _loc2_ = this.c_hQuestionState["get"](_loc3_); if(_loc2_ != null && _loc2_ != undefined) { var blnCorrect = _loc2_.correct; iscore += Number(blnCorrect); } _loc1_ = _loc1_ + 1; } return iscore; } function initResultScreen() { var c_objUICoodInstance = com.controller.UICoordinator.getInstance(); var iTotalSections = this.c_objScreenData.DOC.section.length; var _loc3_ = new Object(); _loc3_.iscore = this.getScore(); if(iTotalSections == undefined || iTotalSections == null || iTotalSections == "") { var _loc2_ = this.c_objScreenData.DOC.section.question.length; if(_loc2_ == undefined || _loc2_ == null || _loc2_ == "") { _loc3_.iTotalNumberQuestions = this.c_objScreenData.DOC.section.attributes.maxMark; } else { _loc3_.iTotalNumberQuestions = this.c_objScreenData.DOC.section.attributes.maxMark * _loc2_; } } else { var _loc1_ = 0; while(_loc1_ < iTotalSections) { _loc2_ = this.c_objScreenData.DOC.section[_loc1_].question.length; if(_loc2_ == undefined || _loc2_ == null || _loc2_ == "") { _loc3_.iTotalNumberQuestions += this.c_objScreenData.DOC.section[_loc1_].attributes.maxMark * 1; } else { _loc3_.iTotalNumberQuestions += this.c_objScreenData.DOC.section[_loc1_].attributes.maxMark * _loc2_; } _loc1_ = _loc1_ + 1; } } _loc3_.iTimeTaken = this.objTimer.getMinsTime() + " min(s)"; _loc3_.strTestNum = this.c_objScreenData.DOC.section[this.c_iPartNo].attributes.test; com.controller.UICoordinator.getInstance().c_objScreenFactory.resultInstance.populateResult(_loc3_,this.c_strSkill); _level101.result.testMenu.objRef = this; _level101.result.testMenu.onRelease = function() { this.objRef.backToTestMenu(); }; _level101.btn_quitTest._visible = false; _level101.btn_quitTest._visible = false; _level101.btn_quitTest._visible = false; } function btn_submitTest() { var _objRef = this; this.removeElements(); var _loc3_ = _objRef.objTimer.getMinsTime(); var _loc2_ = function(success) { var _loc1_ = com.controller.UICoordinator.getInstance(); _loc1_.doAction("SHOWRESULT",""); _objRef.initResultScreen(); _objRef.c_objNavigator.destroyNav(); _objRef.c_objSoundController.killSoundController(); _objRef.c_objVolumeController.killVolumeController(); _objRef.objTimer.destroyTimer(); _level101.btn_submitTest._visible = false; _objRef.onPartChange(Number(_objRef.c_strSelected.split("_")[1])); }; this.connectXMLSocket("true",_loc3_,_loc2_); } function backToTestMenu() { var _loc1_ = this; _level101.btn_backToMenu.enabled = false; _loc1_.removeElements(); _level101.result.removeMovieClip(); com.controller.UICoordinator.getInstance().volumeLevel = String(_loc1_.c_objVolumeController.getLevel()); _loc1_.c_objNavigator.destroyNav(); _loc1_.c_objSoundController.killSoundController(); _loc1_.c_objVolumeController.killVolumeController(); _loc1_.objTimer.destroyTimer(); var _loc2_ = com.controller.UICoordinator.getInstance(); _loc2_.doAction("TestXML","_objData"); } function popupYes() { var _loc1_ = this; _loc1_.removeElements(); _level101.mc_PopUp.gotoAndStop("blank"); var _loc2_ = 0; _loc2_ = _loc1_.objTimer.getSecTime(); _loc2_ = Math.round(_loc2_); com.controller.UICoordinator.getInstance().volumeLevel = String(_loc1_.c_objVolumeController.getLevel()); _loc1_.c_objNavigator.destroyNav(); _loc1_.c_objSoundController.killSoundController(); _loc1_.c_objVolumeController.killVolumeController(); _loc1_.onPartChange(Number(_loc1_.c_strSelected.split("_")[1])); _loc1_.objTimer.destroyTimer(); var _loc3_ = function(success) { var _loc1_ = com.controller.UICoordinator.getInstance(); _loc1_.doAction("TestXML",""); }; if(_loc1_.c_strEnvironment == "Windows" || _loc1_.c_strEnvironment == "Macintosh") { _loc1_.connectXMLSocket("false",_loc2_,_loc3_); } else if(_loc1_.c_strEnvironment == "Linux") { _loc3_(); } } function popupNo() { var _loc1_ = this; _loc1_.removeElements(); _level101.mc_PopUp.gotoAndStop("blank"); _level101.btn_submitTest._visible = false; com.controller.UICoordinator.getInstance().volumeLevel = String(_loc1_.c_objVolumeController.getLevel()); _loc1_.c_objNavigator.destroyNav(); _loc1_.c_objSoundController.killSoundController(); _loc1_.c_objVolumeController.killVolumeController(); _loc1_.onPartChange(Number(_loc1_.c_strSelected.split("_")[1])); _loc1_.objTimer.destroyTimer(); var objRef = _loc1_; var _loc3_ = function(success) { var _loc1_ = com.controller.UICoordinator.getInstance(); _loc1_.doAction("SHOWRESULT",""); objRef.initResultScreen(); }; _loc1_.connectXMLSocket("true",_loc1_.objTimer.getMinsTime(),_loc3_); } function connectXMLSocket(_status, _time, fnCallback) { var _loc1_ = this; var objXML = new com.data.OTOXML(); var strSocketdata = objXML.getXMLString(_loc1_.c_hQuestionState,_loc1_.c_strSkill,_loc1_.c_iTotalTestQuestions); var strFileName = com.controller.UICoordinator.getInstance().currentTestName; var strUserName = com.controller.UICoordinator.getInstance().userASCIIName; var objThis = _loc1_; var fnWriteScoreFile = function(success) { if(success) { var strResult = objXML.getResultXmlString(_status,_time,objThis.c_iTotalTestQuestions); var _loc3_ = com.controller.UICoordinator.getInstance().convertToASCII("_s".toString()); var strFileName = com.controller.UICoordinator.getInstance().currentTestName; var _loc2_ = strFileName + _loc3_; var fnWriteUserFile = function(blnsuccess) { if(blnsuccess) { var _loc1_ = objThis.createRecordXML(strFileName); if(this.c_strEnvironment == "Linux") { objThis.storeRecord(_loc1_,fnCallback); } } else { fnCallback.call(objThis,false); } }; var _loc1_ = undefined; if(objThis.c_strMode == "Take") { _loc1_ = fnWriteUserFile; } else { _loc1_ = fnCallback; } if(this.c_strEnvironment == "Linux") { objThis.writeTestData(_loc2_,strResult,_loc1_); } } else { fnCallback.call(objThis,false); } }; if(_loc1_.c_strEnvironment == "Windows" || _loc1_.c_strEnvironment == "Macintosh" || _loc1_.c_strEnvironment == "Linux") { objThis.writeTestData(strFileName,strSocketdata,fnWriteScoreFile); } } function createRecordXML(_strFileName) { var _loc1_ = this.c_objSourceRef.c_objUICoodInstance.c_objRecordXML; var _loc3_ = _loc1_.parentNode; var _loc2_ = _loc3_.createElement("testname"); var objTextNode = _loc3_.createTextNode(_strFileName + "_W.xml"); _loc1_.appendChild(_loc2_); _loc2_.appendChild(objTextNode); return _loc1_.toString(); } function attachPopUp() { _level101.attachMovie("mc_popup","mc_PopUp",700); } function resetPanelState() { var _loc3_ = this; var objQuestion = _loc3_.c_objScreenData.DOC.section[_loc3_.c_iPartNo].question; var _loc1_ = 0; while(_loc1_ < objQuestion.length) { var _loc2_ = _level101["mc_QuesType" + (_loc3_.c_iPartNo + 1)]["mc_textcont_" + (_loc1_ + 1)]; _loc2_.gotoAndStop("_DESELECTED"); _loc1_ = _loc1_ + 1; } } function showFeedbackL(_QuesID) { var _loc1_ = _QuesID; var _loc2_ = _level101["mc_QuesType" + (this.c_iPartNo + 1)]; var _objQuestion = this.c_objScreenData.DOC.section[this.c_iPartNo].question; var _iFirstQNum = Number(_objQuestion[Number(_loc1_) - 1].attributes.number); var _iCorrectOption = Number(_objQuestion[Number(_loc1_) - 1].attributes.correct); var _loc3_ = this.c_hQuestionState["get"](String("listening_" + _iFirstQNum)); var _objChoice = _objQuestion[_loc1_ - 1].choice; if(_loc3_.attempted != undefined || _loc3_.attempted != null) { var _iAttempted = Number(_loc3_.attempted); if(_loc3_.correct == 0) { _loc2_["mc_TickCross_" + _loc1_ + "_" + _iAttempted].gotoAndStop("INCORRECT"); _loc2_["mc_TickCross_" + _loc1_ + "_" + _iCorrectOption].gotoAndStop("CORRECT"); } else { _loc2_["mc_TickCross_" + _loc1_ + "_" + _iAttempted].gotoAndStop("CORRECT"); } } else { _loc2_["mc_TickCross_" + _loc1_ + "_" + _iCorrectOption].gotoAndStop("CORRECT"); } } function showQuesSelection(strTemplateType, iQueNo) { var _loc1_ = iQueNo; var _loc3_ = this; var _loc2_ = undefined; var iQuesCount = 2; _loc3_.c_strCurrSelected = String(_loc1_); if(strTemplateType == "MCQType_7") { _loc2_ = _level101.MCQType_7.mc_SPType_7.getScrollContent(); iQuesCount = _loc3_.c_objSection.question.length; } else if(strTemplateType == "PairedMCQScrolling") { _loc2_ = _level101.PairedMCQScrolling.mc_ScrollPaneQue.getScrollContent(); _loc1_ = (_loc1_ - 1) % 2 + 1; } else if(strTemplateType == "PairedMCQExtract") { _loc2_ = _level101.PairedMCQExtract; _loc1_ = (_loc1_ - 1) % 2 + 1; } _loc3_.c_objMCQ.deselectionAll(_loc2_,iQuesCount); _loc3_.c_objMCQ.showCurrentSelection(_loc2_,_loc1_); _loc3_.c_objMCQ.showNavigationSelection(); } function setTotalTestQuestions(_iTotalTestQuestions) { this.c_iTotalTestQuestions = _iTotalTestQuestions; } function getTotalTestQuestions() { return this.c_iTotalTestQuestions; } function StoreOptioncliked(in_OptName, in_objCompRef, in_bValue) { var _loc1_ = this; _loc1_.c_objOptName.mcSelected = in_OptName; _loc1_.c_objOptName.objCompRef = in_objCompRef; _loc1_.c_objOptName.bValue = in_bValue; } function GetOptioncliked() { return this.c_objOptName; } function storeRecord(_strFileData, fnCallback) { com.controller.UICoordinator.getInstance().c_strRecordSet = _strFileData; fnCallback.call(this,true); } function writeTestData(_strFileName, _strFileData, fnCallback) { com.controller.UICoordinator.getInstance().c_objTestXML[_strFileName] = _strFileData; fnCallback.call(this,true); } }