[virtualcommons-svn] SF.net SVN: virtualcommons:[265] mentalmodels/trunk
Status: Beta
Brought to you by:
alllee
From: <kj...@us...> - 2009-08-19 21:05:42
|
Revision: 265 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=265&view=rev Author: kjonas Date: 2009-08-19 21:05:30 +0000 (Wed, 19 Aug 2009) Log Message: ----------- Student.as contains GameCode core updated to have GameCode field; sends students as objects, not parameters StartGame edited to send request to server StartGame (edited).html included as a sample of an html file with full-url so you can see the embedded flex Modified Paths: -------------- mentalmodels/trunk/flex/src/StartGame.mxml mentalmodels/trunk/flex/src/actionscript/Student.as mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf mentalmodels/trunk/src/main/webapp/StartGame.swf mentalmodels/trunk/src/main/webapp/test.swf Added Paths: ----------- mentalmodels/trunk/src/main/webapp/StartGame (edited).html Modified: mentalmodels/trunk/flex/src/StartGame.mxml =================================================================== --- mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/StartGame.mxml 2009-08-19 21:05:30 UTC (rev 265) @@ -57,6 +57,13 @@ var gameObject:Game = new Game(); gameObject.money = stpMoney.value; gameObject.description = txtDescription.text; + gameObject.numberOfRounds = 2; + gameObject.maxDays = 30; + gameObject.maxFishHarvest = 100; + gameObject.timestamp = new Date(); + gameObject.title = "test Game Title"; + + startupService.createGame(gameObject); } public function start():void { @@ -91,4 +98,3 @@ </mx:Script> </mx:Application> - Modified: mentalmodels/trunk/flex/src/actionscript/Student.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/Student.as 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/actionscript/Student.as 2009-08-19 21:05:30 UTC (rev 265) @@ -10,11 +10,12 @@ public var id:int; public var group:int; public var studentNo:int; - public var birthYear:int; - public var major:String; - public var semester:String; + public var birthYear:int; + public var major:String; + public var semester:String; public var timestamp:Date; public var gender:String; + public var gameCode:String; /** * input: Modified: mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/custom/FisheryExperimentCore.mxml 2009-08-19 21:05:30 UTC (rev 265) @@ -246,7 +246,7 @@ for(var k:int=0;k<tempDBObjects.length;k++) { (tempDBObjects.getItemAt(k) as StudentStrategy).student = studentObject; - (tempDBObjects.getItemAt(k) as StudentStrategy).roundConfig = roundObject; + (tempDBObjects.getItemAt(k) as StudentStrategy).round = roundObject; } answeringService.saveStrategy(tempDBObjects); @@ -413,15 +413,20 @@ if(obj is SocioDemographicPage) { - var Id:uint = 0; if( (SocioDemographicPage)(obj).accept() ) { obj.visible = false; expiredContent.addChild(obj); - var info:SocioDemographicPage = SocioDemographicPage(obj); - Id = startupService.createStudent(info.getYear(), info.getSemester(), info.getGender(),info.getMajor()); + var newStudent:actionscript.Student = new Student(); + newStudent.birthYear = ((obj as SocioDemographicPage).getYear() as int); + newStudent.gender = (obj as SocioDemographicPage).getGender(); + newStudent.major = (obj as SocioDemographicPage).getMajor(); + newStudent.semester = (obj as SocioDemographicPage).getSemester(); + newStudent.gameCode = (obj as SocioDemographicPage).getGameCode(); + startupService.createStudent(newStudent); + currentState = "wait"; btnBack.enabled = btnForward.enabled = btnReset.enabled = true; Modified: mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml 2009-08-19 17:37:51 UTC (rev 264) +++ mentalmodels/trunk/flex/src/custom/SocioDemographicPage.mxml 2009-08-19 21:05:30 UTC (rev 265) @@ -23,6 +23,10 @@ { return cbxSemester.selectedItem as String; } + public function getGameCode():String + { + return txtGameCode.text; + } public function accept():Boolean { @@ -129,6 +133,11 @@ <mx:ComboBox id="cbxSemester" selectedIndex="0" dataProvider="{new ArrayCollection(['Freshman','Sophomore','Junior','Senior','Graduate/Other'])}"/> <!--<mx:TextInput id="txtSemester" width="75" maxChars="6"/>--> </mx:HBox> + + <mx:HBox> + <mx:Label text="Game Code:" fontWeight="bold" width="100" textAlign="right"/> + <mx:TextInput id="txtGameCode" width="120" maxChars="10"/> + </mx:HBox> </mx:VBox> </mx:VBox> Modified: mentalmodels/trunk/src/main/webapp/FisheryExperimentShell.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/InitialiseDatabase.swf =================================================================== (Binary files differ) Added: mentalmodels/trunk/src/main/webapp/StartGame (edited).html =================================================================== --- mentalmodels/trunk/src/main/webapp/StartGame (edited).html (rev 0) +++ mentalmodels/trunk/src/main/webapp/StartGame (edited).html 2009-08-19 21:05:30 UTC (rev 265) @@ -0,0 +1,139 @@ +<!-- saved from url=(0014)about:internet --> +<html lang="en"> + +<!-- +Smart developers always View Source. + +This application was built using Adobe Flex, an open source framework +for building rich Internet applications that get delivered via the +Flash Player or to desktops via Adobe AIR. + +Learn more about Flex at http://flex.org +// --> + +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + +<!-- BEGIN Browser History required section --> +<link rel="stylesheet" type="text/css" href="history/history.css" /> +<!-- END Browser History required section --> + +<title></title> +<script src="AC_OETags.js" language="javascript"></script> + +<!-- BEGIN Browser History required section --> +<script src="history/history.js" language="javascript"></script> +<!-- END Browser History required section --> + +<style> +body { margin: 0px; overflow:hidden } +</style> + +<script language="JavaScript"> + window.onbeforeunload = confirmExit; + function confirmExit() + { + return "If you are connected to the server, you will be disconnected if the page closes. Students in the experiment will be removed if the window closes."; + } +</script> + +<script language="JavaScript" type="text/javascript"> +<!-- +// ----------------------------------------------------------------------------- +// Globals +// Major version of Flash required +var requiredMajorVersion = 9; +// Minor version of Flash required +var requiredMinorVersion = 0; +// Minor version of Flash required +var requiredRevision = 124; +// ----------------------------------------------------------------------------- +// --> +</script> +</head> + +<body scroll="no"> + + + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="StartGame" width="100%" height="100%" + codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> + <param name="movie" value="StartGame.swf" /> + <PARAM NAME=FlashVars VALUE="ip=test${clientIP}"> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="http://127.0.0.1:8080/mme/StartGame.swf" quality="high" bgcolor="#869ca7" + width="100%" height="100%" name="StartGame" align="middle" + play="true" + loop="false" + quality="high" + allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.adobe.com/go/getflashplayer"> + </embed> + </object> +</body> +</html> + AC_FL_RunContent( + "src", "playerProductInstall", + "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+'&ip=test'+clientIP+"", + "width", "100%", + "height", "100%", + "align", "middle", + "id", "StartGame", + "quality", "high", + "bgcolor", "#869ca7", + "name", "StartGame", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer" + ); +} else if (hasRequestedVersion) { + // if we've detected an acceptable version + // embed the Flash Content SWF when all tests are passed + AC_FL_RunContent( + "src", "http://127.0.0.1:8080/mme/StartGame", + "width", "100%", + "height", "100%", + "align", "middle", + "valign", "middle", + "id", "StartGame", + "quality", "high", + "bgcolor", "#869ca7", + "name", "StartGame", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer", + "FlashVars", "ip=test"+clientIP+"" + ); +} else { // flash is too old or we can't detect the plugin + var alternateContent = 'Alternate HTML content should be placed here. ' + + 'This content requires the Adobe Flash Player. ' + + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; + document.write(alternateContent); // insert non-flash content + } +// --> +</script> +<noscript> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="StartGame" width="100%" height="100%" + codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> + <param name="movie" value="StartGame.swf" /> + <PARAM NAME=FlashVars VALUE="ip=test${clientIP}"> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="http://127.0.0.1:8080/mme/StartGame.swf" quality="high" bgcolor="#869ca7" + width="100%" height="100%" name="StartGame" align="middle" + play="true" + loop="false" + quality="high" + allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.adobe.com/go/getflashplayer"> + </embed> + </object> +</noscript> +</body> +</html> Modified: mentalmodels/trunk/src/main/webapp/StartGame.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/test.swf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |