home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FCE Gold Plus
/
GOLD.iso
/
pc
/
shell.swf
/
scripts
/
__Packages
/
com
/
screen
/
Result.as
< prev
next >
Wrap
Text File
|
2007-10-16
|
7KB
|
180 lines
class com.screen.Result
{
function Result(_objRef)
{
this.c_objRef = _objRef;
}
function init(_objScreenData, _objSourceRef)
{
var _loc1_ = this;
_loc1_.c_objScreenData = _objScreenData;
_loc1_.c_objSourceRef = _objSourceRef;
_loc1_.c_strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
_level101.gotoAndStop("RESULT");
_loc1_.loadScreen();
}
function loadScreen()
{
var _loc1_ = this;
_loc1_.c_objRef.attachMovie("mc_result","result",_loc1_.iResultLevel);
_loc1_.c_mcRes = _loc1_.c_objRef.result;
var _loc3_ = _loc1_.c_objScreenData.result;
_loc1_.c_mcRes._x = 173.5;
_loc1_.c_mcRes._y = 155.5;
trace("RR1 - : " + _loc3_.timeLable.data);
_loc1_.c_mcRes.timeLable.htmlText = _loc3_.timeLable.data;
_loc1_.c_mcRes.timeTaken.text = _loc1_.strTimeTaken;
_loc1_.objTF = new TextFormat();
_loc1_.objTF.font = "Verdana";
_loc1_.objTF.size = 12;
_loc1_.objTF.bold = true;
_loc1_.objTF.color = "0x524D84";
_loc1_.objSF = new TextFormat();
_loc1_.objSF.font = "Verdana";
_loc1_.objSF.size = 15;
_loc1_.objSF.bold = true;
_loc1_.objSF.color = "0x000000";
_loc1_.objSF.align = "center";
var _loc2_ = 104;
_loc1_.c_mcRes.createTextField("txt1",1,_loc2_,105,10,15);
_loc1_.c_mcRes.txt1.wordWrap = "left";
_loc1_.c_mcRes.txt1.autoSize = true;
_loc1_.c_mcRes.txt1.selectable = false;
_loc1_.c_mcRes.txt1.html = true;
trace("RR3.0 - : " + _loc3_.resultLable.txt1.data);
_loc1_.c_mcRes.txt1.htmlText = _loc3_.resultLable.txt1.data;
trace("RR3 - c_mcRes.txt1.htmlText : " + _loc1_.c_mcRes.txt1);
_loc1_.c_mcRes.txt1.setTextFormat(_loc1_.objTF);
if(_loc1_.c_strEnvironment == "Linux")
{
trace(">> Linux Font Embedding CASE 3");
_loc1_.c_mcRes.txt1.embedFonts = true;
}
_loc2_ = _loc2_ + _loc1_.c_mcRes.txt1._width + 2;
_loc1_.c_mcRes.createTextField("c_txt",2,_loc2_,103,34,24);
_loc1_.c_mcRes.c_txt.border = true;
_loc1_.c_mcRes.c_txt.background = true;
_loc1_.c_mcRes.c_txt.selectable = false;
if(_loc1_.c_strEnvironment == "Linux")
{
_loc1_.c_mcRes.c_txt.embedFonts = true;
}
_loc1_.c_mcRes.c_txt.text = _loc1_.iCorrQue;
trace("RR4 - c_mcRes.c_txt.text : " + _loc1_.c_mcRes.c_txt.text);
_loc1_.c_mcRes.c_txt.setTextFormat(_loc1_.objSF);
_loc2_ += 37;
_loc1_.c_mcRes.createTextField("txt2",3,_loc2_,105,10,25);
_loc1_.c_mcRes.txt2.html = true;
_loc1_.c_mcRes.txt2.wordWrap = "left";
_loc1_.c_mcRes.txt2.autoSize = true;
_loc1_.c_mcRes.txt2.selectable = false;
if(_loc1_.c_strEnvironment == "Linux")
{
trace(">> Linux Font Embedding CASE 5");
_loc1_.c_mcRes.txt2.embedFonts = true;
}
trace("RR5.0 - : " + _loc3_.resultLable.txt2.data);
_loc1_.c_mcRes.txt2.htmlText = _loc3_.resultLable.txt2.data;
trace("RR5 - : " + _loc1_.c_mcRes.txt2.htmlText);
_loc1_.c_mcRes.txt2.setTextFormat(_loc1_.objTF);
_loc2_ = _loc2_ + _loc1_.c_mcRes.txt2._width + 2;
_loc1_.c_mcRes.createTextField("t_txt",4,_loc2_,103,34,24);
_loc1_.c_mcRes.t_txt.border = true;
_loc1_.c_mcRes.t_txt.background = true;
_loc1_.c_mcRes.t_txt.selectable = false;
if(_loc1_.c_strEnvironment == "Linux")
{
_loc1_.c_mcRes.t_txt.embedFonts = true;
}
_loc1_.c_mcRes.t_txt.text = _loc1_.iTotalQue;
trace("RR6 - : " + _loc1_.c_mcRes.t_txt.text);
_loc1_.c_mcRes.t_txt.setTextFormat(_loc1_.objSF);
_loc2_ += 27;
_loc1_.c_mcRes.createTextField("txt3",5,_loc2_,105,10,25);
_loc1_.c_mcRes.txt3.wordWrap = "left";
_loc1_.c_mcRes.txt3.autoSize = true;
_loc1_.c_mcRes.txt3.selectable = false;
if(_loc1_.c_strEnvironment == "Linux")
{
_loc1_.c_mcRes.txt3.embedFonts = true;
}
_loc1_.c_mcRes.txt3.html = true;
_loc1_.c_mcRes.txt3.htmlText = _loc3_.resultLable.txt3.data;
trace("RR7 - : " + _loc1_.c_mcRes.txt3.htmlText);
_loc1_.c_mcRes.txt3.setTextFormat(_loc1_.objTF);
_loc1_.c_mcRes.testMenu.objRef = _loc1_;
_loc1_.c_mcRes.testMenu.onRelease = function()
{
this.objRef.testMenu();
};
}
function populateResult(_objData, _strSkillName)
{
var _loc1_ = this;
var _loc3_ = "";
var objGradeTxtFormat = new TextFormat();
var _strHeader;
_loc1_.c_mcRes.c_txt.text = _objData.iscore;
_loc1_.c_mcRes.c_txt.setTextFormat(_loc1_.objSF);
_loc1_.c_mcRes.t_txt.text = _objData.iTotalNumberQuestions;
_loc1_.c_mcRes.t_txt.setTextFormat(_loc1_.objSF);
if(_strSkillName == "reading" || _strSkillName == "writing")
{
_strHeader = "reading test finished";
}
else if(_strSkillName == "listening")
{
_strHeader = _strSkillName + " test finished";
}
if(_strSkillName == "use of english")
{
_strHeader = _strSkillName + " test finished";
}
_loc1_.c_mcRes.header.text = _strHeader.toUpperCase();
var _loc2_ = 100 * _objData.iscore / _loc1_.c_mcRes.t_txt.text;
if(_loc2_ >= 80)
{
_loc3_ = "<font color=\'#009900\'>PASS</font>";
}
else if(_loc2_ <= 79 && _loc2_ >= 75)
{
_loc3_ = "<font color=\'#009900\'>PASS</font>";
}
else if(_loc2_ <= 74 && _loc2_ >= 60)
{
_loc3_ = "<font color=\'#009900\'>PASS</font>";
}
else if(_loc2_ <= 59 && _loc2_ >= 55)
{
_loc3_ = "<font color=\'#FF0000\'>NARROW FAIL</font>";
}
else if(_loc2_ <= 54)
{
_loc3_ = "<font color=\'#FF0000\'>FAIL</font>";
}
if(_strSkillName == "writing")
{
_strHeader = "Writing Test FINISHED";
_loc3_ = "The writing section is not marked.\nYou can view sample answers by selecting \'Review results\' from the Test Menu.";
_loc1_.c_mcRes.header.text = _strHeader;
objGradeTxtFormat.size = 12;
objGradeTxtFormat.bold = false;
_loc1_.c_mcRes.txt_GradeBand.setNewTextFormat(objGradeTxtFormat);
_loc1_.c_mcRes.txt_GradeBand.autoSize = true;
_loc1_.c_mcRes.txt_GradeBand.text = _loc3_;
_loc1_.c_mcRes.txt1._visible = false;
_loc1_.c_mcRes.txt2._visible = false;
_loc1_.c_mcRes.c_txt._visible = false;
_loc1_.c_mcRes.t_txt._visible = false;
}
else
{
_loc1_.c_mcRes.txt_GradeBand.html = true;
objGradeTxtFormat.bold = true;
_loc1_.c_mcRes.txt_GradeBand.setTextFormat(objGradeTxtFormat);
_loc1_.c_mcRes.txt_GradeBand.htmlText = "<p align=\'center\'><b>" + _loc3_ + "</b></p>";
}
_loc1_.c_mcRes.timeTaken.text = _objData.iTimeTaken;
}
}