home *** CD-ROM | disk | FTP | other *** search
/ FCE Gold Plus / GOLD.iso / pc / shell.swf / scripts / __Packages / com / screen / Result.as < prev    next >
Text File  |  2007-10-16  |  7KB  |  180 lines

  1. class com.screen.Result
  2. {
  3.    function Result(_objRef)
  4.    {
  5.       this.c_objRef = _objRef;
  6.    }
  7.    function init(_objScreenData, _objSourceRef)
  8.    {
  9.       var _loc1_ = this;
  10.       _loc1_.c_objScreenData = _objScreenData;
  11.       _loc1_.c_objSourceRef = _objSourceRef;
  12.       _loc1_.c_strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
  13.       _level101.gotoAndStop("RESULT");
  14.       _loc1_.loadScreen();
  15.    }
  16.    function loadScreen()
  17.    {
  18.       var _loc1_ = this;
  19.       _loc1_.c_objRef.attachMovie("mc_result","result",_loc1_.iResultLevel);
  20.       _loc1_.c_mcRes = _loc1_.c_objRef.result;
  21.       var _loc3_ = _loc1_.c_objScreenData.result;
  22.       _loc1_.c_mcRes._x = 173.5;
  23.       _loc1_.c_mcRes._y = 155.5;
  24.       trace("RR1 -  : " + _loc3_.timeLable.data);
  25.       _loc1_.c_mcRes.timeLable.htmlText = _loc3_.timeLable.data;
  26.       _loc1_.c_mcRes.timeTaken.text = _loc1_.strTimeTaken;
  27.       _loc1_.objTF = new TextFormat();
  28.       _loc1_.objTF.font = "Verdana";
  29.       _loc1_.objTF.size = 12;
  30.       _loc1_.objTF.bold = true;
  31.       _loc1_.objTF.color = "0x524D84";
  32.       _loc1_.objSF = new TextFormat();
  33.       _loc1_.objSF.font = "Verdana";
  34.       _loc1_.objSF.size = 15;
  35.       _loc1_.objSF.bold = true;
  36.       _loc1_.objSF.color = "0x000000";
  37.       _loc1_.objSF.align = "center";
  38.       var _loc2_ = 104;
  39.       _loc1_.c_mcRes.createTextField("txt1",1,_loc2_,105,10,15);
  40.       _loc1_.c_mcRes.txt1.wordWrap = "left";
  41.       _loc1_.c_mcRes.txt1.autoSize = true;
  42.       _loc1_.c_mcRes.txt1.selectable = false;
  43.       _loc1_.c_mcRes.txt1.html = true;
  44.       trace("RR3.0 -  : " + _loc3_.resultLable.txt1.data);
  45.       _loc1_.c_mcRes.txt1.htmlText = _loc3_.resultLable.txt1.data;
  46.       trace("RR3 - c_mcRes.txt1.htmlText : " + _loc1_.c_mcRes.txt1);
  47.       _loc1_.c_mcRes.txt1.setTextFormat(_loc1_.objTF);
  48.       if(_loc1_.c_strEnvironment == "Linux")
  49.       {
  50.          trace(">> Linux Font Embedding CASE 3");
  51.          _loc1_.c_mcRes.txt1.embedFonts = true;
  52.       }
  53.       _loc2_ = _loc2_ + _loc1_.c_mcRes.txt1._width + 2;
  54.       _loc1_.c_mcRes.createTextField("c_txt",2,_loc2_,103,34,24);
  55.       _loc1_.c_mcRes.c_txt.border = true;
  56.       _loc1_.c_mcRes.c_txt.background = true;
  57.       _loc1_.c_mcRes.c_txt.selectable = false;
  58.       if(_loc1_.c_strEnvironment == "Linux")
  59.       {
  60.          _loc1_.c_mcRes.c_txt.embedFonts = true;
  61.       }
  62.       _loc1_.c_mcRes.c_txt.text = _loc1_.iCorrQue;
  63.       trace("RR4 - c_mcRes.c_txt.text : " + _loc1_.c_mcRes.c_txt.text);
  64.       _loc1_.c_mcRes.c_txt.setTextFormat(_loc1_.objSF);
  65.       _loc2_ += 37;
  66.       _loc1_.c_mcRes.createTextField("txt2",3,_loc2_,105,10,25);
  67.       _loc1_.c_mcRes.txt2.html = true;
  68.       _loc1_.c_mcRes.txt2.wordWrap = "left";
  69.       _loc1_.c_mcRes.txt2.autoSize = true;
  70.       _loc1_.c_mcRes.txt2.selectable = false;
  71.       if(_loc1_.c_strEnvironment == "Linux")
  72.       {
  73.          trace(">> Linux Font Embedding CASE 5");
  74.          _loc1_.c_mcRes.txt2.embedFonts = true;
  75.       }
  76.       trace("RR5.0 - : " + _loc3_.resultLable.txt2.data);
  77.       _loc1_.c_mcRes.txt2.htmlText = _loc3_.resultLable.txt2.data;
  78.       trace("RR5 - : " + _loc1_.c_mcRes.txt2.htmlText);
  79.       _loc1_.c_mcRes.txt2.setTextFormat(_loc1_.objTF);
  80.       _loc2_ = _loc2_ + _loc1_.c_mcRes.txt2._width + 2;
  81.       _loc1_.c_mcRes.createTextField("t_txt",4,_loc2_,103,34,24);
  82.       _loc1_.c_mcRes.t_txt.border = true;
  83.       _loc1_.c_mcRes.t_txt.background = true;
  84.       _loc1_.c_mcRes.t_txt.selectable = false;
  85.       if(_loc1_.c_strEnvironment == "Linux")
  86.       {
  87.          _loc1_.c_mcRes.t_txt.embedFonts = true;
  88.       }
  89.       _loc1_.c_mcRes.t_txt.text = _loc1_.iTotalQue;
  90.       trace("RR6 - : " + _loc1_.c_mcRes.t_txt.text);
  91.       _loc1_.c_mcRes.t_txt.setTextFormat(_loc1_.objSF);
  92.       _loc2_ += 27;
  93.       _loc1_.c_mcRes.createTextField("txt3",5,_loc2_,105,10,25);
  94.       _loc1_.c_mcRes.txt3.wordWrap = "left";
  95.       _loc1_.c_mcRes.txt3.autoSize = true;
  96.       _loc1_.c_mcRes.txt3.selectable = false;
  97.       if(_loc1_.c_strEnvironment == "Linux")
  98.       {
  99.          _loc1_.c_mcRes.txt3.embedFonts = true;
  100.       }
  101.       _loc1_.c_mcRes.txt3.html = true;
  102.       _loc1_.c_mcRes.txt3.htmlText = _loc3_.resultLable.txt3.data;
  103.       trace("RR7 - : " + _loc1_.c_mcRes.txt3.htmlText);
  104.       _loc1_.c_mcRes.txt3.setTextFormat(_loc1_.objTF);
  105.       _loc1_.c_mcRes.testMenu.objRef = _loc1_;
  106.       _loc1_.c_mcRes.testMenu.onRelease = function()
  107.       {
  108.          this.objRef.testMenu();
  109.       };
  110.    }
  111.    function populateResult(_objData, _strSkillName)
  112.    {
  113.       var _loc1_ = this;
  114.       var _loc3_ = "";
  115.       var objGradeTxtFormat = new TextFormat();
  116.       var _strHeader;
  117.       _loc1_.c_mcRes.c_txt.text = _objData.iscore;
  118.       _loc1_.c_mcRes.c_txt.setTextFormat(_loc1_.objSF);
  119.       _loc1_.c_mcRes.t_txt.text = _objData.iTotalNumberQuestions;
  120.       _loc1_.c_mcRes.t_txt.setTextFormat(_loc1_.objSF);
  121.       if(_strSkillName == "reading" || _strSkillName == "writing")
  122.       {
  123.          _strHeader = "reading test finished";
  124.       }
  125.       else if(_strSkillName == "listening")
  126.       {
  127.          _strHeader = _strSkillName + " test finished";
  128.       }
  129.       if(_strSkillName == "use of english")
  130.       {
  131.          _strHeader = _strSkillName + " test finished";
  132.       }
  133.       _loc1_.c_mcRes.header.text = _strHeader.toUpperCase();
  134.       var _loc2_ = 100 * _objData.iscore / _loc1_.c_mcRes.t_txt.text;
  135.       if(_loc2_ >= 80)
  136.       {
  137.          _loc3_ = "<font color=\'#009900\'>PASS</font>";
  138.       }
  139.       else if(_loc2_ <= 79 && _loc2_ >= 75)
  140.       {
  141.          _loc3_ = "<font color=\'#009900\'>PASS</font>";
  142.       }
  143.       else if(_loc2_ <= 74 && _loc2_ >= 60)
  144.       {
  145.          _loc3_ = "<font color=\'#009900\'>PASS</font>";
  146.       }
  147.       else if(_loc2_ <= 59 && _loc2_ >= 55)
  148.       {
  149.          _loc3_ = "<font color=\'#FF0000\'>NARROW FAIL</font>";
  150.       }
  151.       else if(_loc2_ <= 54)
  152.       {
  153.          _loc3_ = "<font color=\'#FF0000\'>FAIL</font>";
  154.       }
  155.       if(_strSkillName == "writing")
  156.       {
  157.          _strHeader = "Writing Test FINISHED";
  158.          _loc3_ = "The writing section is not marked.\nYou can view sample answers by selecting \'Review results\' from the Test Menu.";
  159.          _loc1_.c_mcRes.header.text = _strHeader;
  160.          objGradeTxtFormat.size = 12;
  161.          objGradeTxtFormat.bold = false;
  162.          _loc1_.c_mcRes.txt_GradeBand.setNewTextFormat(objGradeTxtFormat);
  163.          _loc1_.c_mcRes.txt_GradeBand.autoSize = true;
  164.          _loc1_.c_mcRes.txt_GradeBand.text = _loc3_;
  165.          _loc1_.c_mcRes.txt1._visible = false;
  166.          _loc1_.c_mcRes.txt2._visible = false;
  167.          _loc1_.c_mcRes.c_txt._visible = false;
  168.          _loc1_.c_mcRes.t_txt._visible = false;
  169.       }
  170.       else
  171.       {
  172.          _loc1_.c_mcRes.txt_GradeBand.html = true;
  173.          objGradeTxtFormat.bold = true;
  174.          _loc1_.c_mcRes.txt_GradeBand.setTextFormat(objGradeTxtFormat);
  175.          _loc1_.c_mcRes.txt_GradeBand.htmlText = "<p align=\'center\'><b>" + _loc3_ + "</b></p>";
  176.       }
  177.       _loc1_.c_mcRes.timeTaken.text = _objData.iTimeTaken;
  178.    }
  179. }
  180.