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

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