<taskModel xmlns="http://ce.org/cea-2018" about="urn:cetask.wpi.edu:projects:ZeppelinTime">
<!--Overall game goal-->
<task id="Game"/>
<!--Game structure-->
<subtasks id="GameTasks" goal="Game" ordered="true">
<step name="Zeppelin" task="Zeppelin"/>
<step name="Airlock" task="Airlock"/>
<step name="EmpireStateBuilding" task="EmpireStateBuilding"/>
</subtasks>
<!--Rooms-->
<task id="Zeppelin"/>
<task id="Airlock"/>
<task id="EmpireStateBuilding"/>
<!--Puzzles in Zeppelin-->
<subtasks id="ZeppelinTasks" goal="Zeppelin" ordered="true">
<step name="Name" task="Name"/>
<step name="ResetHintsName" task="ResetHints"/>
<step name="Recognizer" task="Recognizer"/>
<step name="ResetHintsRecognizer" task="ResetHints"/>
<step name="OpenCargoBayDoor" task="OpenCargoBayDoor"/>
<step name="ResetHintsOpenCargoBayDoor" task="ResetHints"/>
</subtasks>
<!--Puzzles in Airlock-->
<subtasks id="AirlockTasks" goal="Airlock" ordered="true">
<step name="EqualizePressure" task="EqualizePressure"/>
<step name="ResetHintsEqualizePressure" task="ResetHints"/>
<step name="OpenAirlockDoor" task="OpenAirlockDoor"/>
<step name="ResetHintsOpenAirlockDoor" task="ResetHints"/>
</subtasks>
<!--Puzzles in EmpireStateBuilding-->
<subtasks id="EmpireStateBuildingTasks" goal="EmpireStateBuilding" ordered="true">
<step name="MakeKey" task="MakeKey"/>
<step name="ResetHintsMakeKey" task="ResetHints"/>
<step name="OpenDrawer" task="OpenDrawer"/>
<step name="ResetHintsOpenDrawer" task="ResetHints"/>
<step name="DuplicateDocuments" task="DuplicateDocuments"/>
<step name="ResetHintsDuplicateDocuments" task="ResetHints"/>
<step name="MakeKeyCard" task="MakeKeyCard"/>
<step name="ResetHintsMakeKeyCard" task="ResetHints"/>
</subtasks>
<!--All puzzles-->
<task id="Name">
<postcondition> spyName != null </postcondition>
</task>
<subtasks id="UserDoesName" goal="Name" ordered="false">
<step name="NameHint1" task="NameHint1"/>
<step name="NameHint2" task="NameHint2"/>
<step name="NameHint3" task="NameHint3"/>
<step name="NameHintDie" task="NameHintDie"/>
<step name="UserName" task="UserName"/>
</subtasks>
<!--Hints for Name-->
<task id="NameHint1">
<precondition>isHint(1)</precondition>
<script>printHint("To create a variable, the general setup is &lt;variable type&gt; &lt;variable name&gt; = &lt;value&gt;;\n"); hintGiven();</script>
</task>
<task id="NameHint2">
<precondition>isHint(2)</precondition>
<script>printHint("Your name consists of a series of characters (letters).  A series of characters is called a string.\n"); hintGiven();</script>
</task>
<task id="NameHint3">
<precondition>isHint(3)</precondition>
<script>printHint("Here is an example of creating a variable: var great_name = \"Robert); DROP TABLE Students;--\"\n"); hintGiven();</script>
</task>
<task id="NameHintDie">
<precondition>isHint(4)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserName">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Enter your name.  variable name: spyName</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Cargo Bay</b><br/><img src=\"http://farm1.static.flickr.com/14/17658656_32281b4d64.jpg?v=0\"/><br/>Fun for the whole family!<br/><br/>spyName = " + spyName + "</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> spyName != null </postcondition>
</task>
<subtasks id="SystemDoesName" goal="Name" ordered="false">
<step name="SystemName" task="SystemName"/>
<step name="UserNameAgain" task="UserNameAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 3</applicable>
</subtasks>
<task id="SystemName">
<precondition>isHint(4)</precondition>
<script>printHint("Fine, I'll give you a name. See how you like it: spyName = \"Helpless\""); setCmd("spyName = \"Helpless\"");</script>
</task>
<task id="UserNameAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Enter your name.  variable name: spyName</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Cargo Bay</b><br/><img src=\"http://farm1.static.flickr.com/14/17658656_32281b4d64.jpg?v=0\"/><br/>Fun for the whole family!<br/><br/>spyName = " + spyName + "</html>" ]]></dc:description>
<precondition>hintsRequestedGT(3) &amp;&amp; cmdIsSet();</precondition>
<postcondition> spyName != null </postcondition>
</task>
<task id="Recognizer">
<postcondition> authorizedPerson == spyName </postcondition>
</task>
<subtasks id="UserDoesRecognizer" goal="Recognizer" ordered="false">
<step name="RecognizerHint1" task="RecognizerHint1"/>
<step name="RecognizerHint2" task="RecognizerHint2"/>
<step name="RecognizerHintDie" task="RecognizerHintDie"/>
<step name="UserRecognizer" task="UserRecognizer"/>
</subtasks>
<!--Hints for Recognizer-->
<task id="RecognizerHint1">
<precondition>isHint(1)</precondition>
<script>printHint("To change the value of a variable type &lt;variable_name&gt; = &lt;value&gt;;\n"); hintGiven();</script>
</task>
<task id="RecognizerHint2">
<precondition>isHint(2)</precondition>
<script>printHint("There's a certain variable here that specifies what person is authorized to pass. Currently, you shall not pass.\n"); hintGiven();</script>
</task>
<task id="RecognizerHintDie">
<precondition>isHint(3)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserRecognizer">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Get the recognizer to recognize you.  Variable to reset: authorizedPerson.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Cargo Bay</b><br/><img src=\"http://farm1.static.flickr.com/14/17658656_32281b4d64.jpg?v=0\"/><br/>Fool the recognizer!<br/><br/>Authorized person: " + authorizedPerson + "<br/>Your name: " + spyName + "</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> authorizedPerson == spyName </postcondition>
</task>
<subtasks id="SystemDoesRecognizer" goal="Recognizer" ordered="false">
<step name="SystemRecognizer" task="SystemRecognizer"/>
<step name="UserRecognizerAgain" task="UserRecognizerAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 2</applicable>
</subtasks>
<task id="SystemRecognizer">
<precondition>isHint(3)</precondition>
<script>printHint("I'm telling the recognizer to let you through: authorizedPerson = spyName"); setCmd("authorizedPerson = spyName");</script>
</task>
<task id="UserRecognizerAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Get the recognizer to recognize you.  Variable to reset: authorizedPerson.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Cargo Bay</b><br/><img src=\"http://farm1.static.flickr.com/14/17658656_32281b4d64.jpg?v=0\"/><br/>Fool the recognizer!<br/><br/>Authorized person: " + authorizedPerson + "<br/>Your name: " + spyName + "</html>" ]]></dc:description>
<precondition>hintsRequestedGT(2) &amp;&amp; cmdIsSet();</precondition>
<postcondition> authorizedPerson == spyName </postcondition>
</task>
<task id="OpenCargoBayDoor">
<postcondition> handleRotation == 42 </postcondition>
</task>
<subtasks id="UserDoesOpenCargoBayDoor" goal="OpenCargoBayDoor" ordered="false">
<step name="OpenCargoBayDoorHint1" task="OpenCargoBayDoorHint1"/>
<step name="OpenCargoBayDoorHint2" task="OpenCargoBayDoorHint2"/>
<step name="OpenCargoBayDoorHint3" task="OpenCargoBayDoorHint3"/>
<step name="OpenCargoBayDoorHintDie" task="OpenCargoBayDoorHintDie"/>
<step name="UserOpenCargoBayDoor" task="UserOpenCargoBayDoor"/>
</subtasks>
<!--Hints for OpenCargoBayDoor-->
<task id="OpenCargoBayDoorHint1">
<precondition>isHint(1)</precondition>
<script>printHint("Remember: To create a variable, the general setup is &lt;variable type&gt; &lt;variable name&gt; = &lt;value&gt;; To set your name you entered \"spyName = &lt;spyName&gt;;\"\n"); hintGiven();</script>
</task>
<task id="OpenCargoBayDoorHint2">
<precondition>isHint(2)</precondition>
<script>printHint("We want to set the knob to having been turned a certain number of degrees.  It can be any rational number of degrees. In programming, we tend to call rational numbers 'floats'.\n"); hintGiven();</script>
</task>
<task id="OpenCargoBayDoorHint3">
<precondition>isHint(3)</precondition>
<script>printHint("Here is an example of creating a float variable: var pi = 3.14\n"); hintGiven();</script>
</task>
<task id="OpenCargoBayDoorHintDie">
<precondition>isHint(4)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserOpenCargoBayDoor">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Open the door.  Variable to reset: handleRotation</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Cargo Bay</b><br/><img src=\"http://farm1.static.flickr.com/14/17658656_32281b4d64.jpg?v=0\"/><br/>Open the door.<br/><br/>Handle rotation: " + handleRotation + "&#0186;</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> handleRotation == 42 </postcondition>
</task>
<subtasks id="SystemDoesOpenCargoBayDoor" goal="OpenCargoBayDoor" ordered="false">
<step name="SystemOpenCargoBayDoor" task="SystemOpenCargoBayDoor"/>
<step name="UserOpenCargoBayDoorAgain" task="UserOpenCargoBayDoorAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 3</applicable>
</subtasks>
<task id="SystemOpenCargoBayDoor">
<precondition>isHint(4)</precondition>
<script>printHint("The door handle needs to be at a 42 degree angle. Like this: handleRotation = 42"); setCmd("handleRotation = 42");</script>
</task>
<task id="UserOpenCargoBayDoorAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Open the door.  Variable to reset: handleRotation</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Cargo Bay</b><br/><img src=\"http://farm1.static.flickr.com/14/17658656_32281b4d64.jpg?v=0\"/><br/>Open the door.<br/><br/>Handle rotation: " + handleRotation + "&#0186;</html>" ]]></dc:description>
<precondition>hintsRequestedGT(3) &amp;&amp; cmdIsSet();</precondition>
<postcondition> handleRotation == 42 </postcondition>
</task>
<task id="EqualizePressure">
<postcondition> airlockPressure == zeppelinPressure </postcondition>
</task>
<subtasks id="UserDoesEqualizePressure" goal="EqualizePressure" ordered="false">
<step name="EqualizePressureHint1" task="EqualizePressureHint1"/>
<step name="EqualizePressureHint2" task="EqualizePressureHint2"/>
<step name="EqualizePressureHint3" task="EqualizePressureHint3"/>
<step name="EqualizePressureHintDie" task="EqualizePressureHintDie"/>
<step name="UserEqualizePressure" task="UserEqualizePressure"/>
</subtasks>
<!--Hints for EqualizePressure-->
<task id="EqualizePressureHint1">
<precondition>isHint(1)</precondition>
<script>printHint("Variables are useful, but we also need procedural structure. In programming, we use \"control structures\" to control the flow of execution.\n"); hintGiven();</script>
</task>
<task id="EqualizePressureHint2">
<precondition>isHint(2)</precondition>
<script>printHint("Looks like a loop of some kind would be useful here. Maybe you should try a 'while' loop.\n"); hintGiven();</script>
</task>
<task id="EqualizePressureHint3">
<precondition>isHint(3)</precondition>
<script>printHint("The syntax of a 'while' loop is like this: while( &lt;condition&gt; ) { &lt;operations to perform&gt; };\n"); hintGiven();</script>
</task>
<task id="EqualizePressureHintDie">
<precondition>isHint(4)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserEqualizePressure">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Equalize the air pressure.  Variable names: airlockPressure, zeppelinPressure</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Airlock</b><br/><img src=\"http://farm3.static.flickr.com/2323/2189027815_9ffe8dfb4a.jpg?v=0\"/><br/>Equalize the air pressure.<br/><br/>Zeppelin pressure: " + zeppelinPressure + "<br/>Airlock pressure: " + airlockPressure + "</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> airlockPressure == zeppelinPressure </postcondition>
</task>
<subtasks id="SystemDoesEqualizePressure" goal="EqualizePressure" ordered="false">
<step name="SystemEqualizePressure" task="SystemEqualizePressure"/>
<step name="UserEqualizePressureAgain" task="UserEqualizePressureAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 3</applicable>
</subtasks>
<task id="SystemEqualizePressure">
<precondition>isHint(4)</precondition>
<script>printHint("I'm not going in there without air! Do it this way: while(airlockPressure &lt; zeppelinPressure) { airlockPressure += 1.0 }"); setCmd("while(airlockPressure &lt; zeppelinPressure) { airlockPressure += 1.0 }");</script>
</task>
<task id="UserEqualizePressureAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Equalize the air pressure.  Variable names: airlockPressure, zeppelinPressure</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Airlock</b><br/><img src=\"http://farm3.static.flickr.com/2323/2189027815_9ffe8dfb4a.jpg?v=0\"/><br/>Equalize the air pressure.<br/><br/>Zeppelin pressure: " + zeppelinPressure + "<br/>Airlock pressure: " + airlockPressure + "</html>" ]]></dc:description>
<precondition>hintsRequestedGT(3) &amp;&amp; cmdIsSet();</precondition>
<postcondition> airlockPressure == zeppelinPressure </postcondition>
</task>
<task id="OpenAirlockDoor">
<postcondition> airlockPressure == zeppelinPressure &amp;&amp; airlockCombo[0] == 1 &amp;&amp; airlockCombo[1] == 9 &amp;&amp; airlockCombo[2] == 4 &amp;&amp; airlockCombo[3] == 1 </postcondition>
</task>
<subtasks id="UserDoesOpenAirlockDoor" goal="OpenAirlockDoor" ordered="false">
<step name="OpenAirlockDoorHint1" task="OpenAirlockDoorHint1"/>
<step name="OpenAirlockDoorHint2" task="OpenAirlockDoorHint2"/>
<step name="OpenAirlockDoorHint3" task="OpenAirlockDoorHint3"/>
<step name="OpenAirlockDoorHintDie" task="OpenAirlockDoorHintDie"/>
<step name="UserOpenAirlockDoor" task="UserOpenAirlockDoor"/>
</subtasks>
<!--Hints for OpenAirlockDoor-->
<task id="OpenAirlockDoorHint1">
<precondition>isHint(1)</precondition>
<script>printHint("And what if we want to store things in a list, for instance? We could use an array, and then access each value by its index in the array.\n"); hintGiven();</script>
</task>
<task id="OpenAirlockDoorHint2">
<precondition>isHint(2)</precondition>
<script>printHint("In most languages arrays use indexes, so the numbering starts from zero.\n"); hintGiven();</script>
</task>
<task id="OpenAirlockDoorHint3">
<precondition>isHint(3)</precondition>
<script>printHint("The first item in an array named 'arr' would be arr[0]. Likewise, the second would be arr[1], and so on. Mainly just pretend that you're a pirate. Savvy?\n"); hintGiven();</script>
</task>
<task id="OpenAirlockDoorHintDie">
<precondition>isHint(4)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserOpenAirlockDoor">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Open the door.  Array name: airlockCombo</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Airlock</b><br/><img src=\"http://farm3.static.flickr.com/2323/2189027815_9ffe8dfb4a.jpg?v=0\"/><br/>Unlock the door.<br/><br/>Current lock combination: " + airlockCombo[0] + "" + airlockCombo[1] + "" + airlockCombo[2] + "" + airlockCombo[3] + "</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> airlockPressure == zeppelinPressure &amp;&amp; airlockCombo[0] == 1 &amp;&amp; airlockCombo[1] == 9 &amp;&amp; airlockCombo[2] == 4 &amp;&amp; airlockCombo[3] == 1 </postcondition>
</task>
<subtasks id="SystemDoesOpenAirlockDoor" goal="OpenAirlockDoor" ordered="false">
<step name="SystemOpenAirlockDoor" task="SystemOpenAirlockDoor"/>
<step name="UserOpenAirlockDoorAgain" task="UserOpenAirlockDoorAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 3</applicable>
</subtasks>
<task id="SystemOpenAirlockDoor">
<precondition>isHint(4)</precondition>
<script>printHint("Just because I know everything . . . oh hey, look: airlockCombo[0] = 1; airlockCombo[1] = 9; airlockCombo[2] = 4; airlockCombo[3] = 1;"); setCmd("airlockCombo = new Array(1,9,4,1)");</script>
</task>
<task id="UserOpenAirlockDoorAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Open the door.  Array name: airlockCombo</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Airlock</b><br/><img src=\"http://farm3.static.flickr.com/2323/2189027815_9ffe8dfb4a.jpg?v=0\"/><br/>Unlock the door.<br/><br/>Current lock combination: " + airlockCombo[0] + "" + airlockCombo[1] + "" + airlockCombo[2] + "" + airlockCombo[3] + "</html>" ]]></dc:description>
<precondition>hintsRequestedGT(3) &amp;&amp; cmdIsSet();</precondition>
<postcondition> airlockPressure == zeppelinPressure &amp;&amp; airlockCombo[0] == 1 &amp;&amp; airlockCombo[1] == 9 &amp;&amp; airlockCombo[2] == 4 &amp;&amp; airlockCombo[3] == 1 </postcondition>
</task>
<task id="MakeKey">
<postcondition> madeKey &gt; 1 </postcondition>
</task>
<subtasks id="UserDoesMakeKey" goal="MakeKey" ordered="false">
<step name="MakeKeyHint1" task="MakeKeyHint1"/>
<step name="MakeKeyHint2" task="MakeKeyHint2"/>
<step name="MakeKeyHintDie" task="MakeKeyHintDie"/>
<step name="UserMakeKey" task="UserMakeKey"/>
</subtasks>
<!--Hints for MakeKey-->
<task id="MakeKeyHint1">
<precondition>isHint(1)</precondition>
<script>printHint("Remember creating an instance of a variable?  We said String name = \"" + spyName + "\".  Creating an instance of an object is much like that: var &lt;variableName&gt; = new &lt;object Type&gt;()\n"); hintGiven();</script>
</task>
<task id="MakeKeyHint2">
<precondition>isHint(2)</precondition>
<script>printHint("If I wanted to create an instance of a object of type Season called fireflySeason2 I would type Season fireflySeason2 = new Season()\n"); hintGiven();</script>
</task>
<task id="MakeKeyHintDie">
<precondition>isHint(3)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserMakeKey">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Make a key.  Call it myKey.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><img src=\"http://l.yimg.com/g/images/spaceball.gif\"/><br/>You need a key to get in.</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> madeKey &gt; 1 </postcondition>
</task>
<subtasks id="SystemDoesMakeKey" goal="MakeKey" ordered="false">
<step name="SystemMakeKey" task="SystemMakeKey"/>
<step name="UserMakeKeyAgain" task="UserMakeKeyAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 2</applicable>
</subtasks>
<task id="SystemMakeKey">
<precondition>isHint(3)</precondition>
<script>printHint("I see. Never send a human to do a machine's job. Creating a key by typing: var myKey = new Key();"); setCmd("var dummyKey = new Key();");</script>
</task>
<task id="UserMakeKeyAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Make a key.  Call it myKey.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><img src=\"http://l.yimg.com/g/images/spaceball.gif\"/><br/>You need a key to get in.</html>" ]]></dc:description>
<precondition>hintsRequestedGT(2) &amp;&amp; cmdIsSet();</precondition>
<postcondition> madeKey &gt; 1 </postcondition>
</task>
<task id="OpenDrawer">
<postcondition> officeDrawer.isOpen() </postcondition>
</task>
<subtasks id="UserDoesOpenDrawer" goal="OpenDrawer" ordered="false">
<step name="OpenDrawerHint1" task="OpenDrawerHint1"/>
<step name="OpenDrawerHint2" task="OpenDrawerHint2"/>
<step name="OpenDrawerHint3" task="OpenDrawerHint3"/>
<step name="OpenDrawerHint4" task="OpenDrawerHint4"/>
<step name="OpenDrawerHintDie" task="OpenDrawerHintDie"/>
<step name="UserOpenDrawer" task="UserOpenDrawer"/>
</subtasks>
<!--Hints for OpenDrawer-->
<task id="OpenDrawerHint1">
<precondition>isHint(1)</precondition>
<script>printHint("Objects do stuff.  To tell the object to do something, the general structure is &lt;variableOfProperObjectType&gt;.&lt;method&gt;\n"); hintGiven();</script>
</task>
<task id="OpenDrawerHint2">
<precondition>isHint(2)</precondition>
<script>printHint("If I wanted you to answer on your own, I would say you.answer()\n"); hintGiven();</script>
</task>
<task id="OpenDrawerHint3">
<precondition>isHint(3)</precondition>
<script>printHint("Occasionally, the method has a variable passed into it.  In this case, we want to pass the method open the key that we are using to open the drawer.\n"); hintGiven();</script>
</task>
<task id="OpenDrawerHint4">
<precondition>isHint(4)</precondition>
<script>printHint("The form for passing a method a variable parameter is &lt;method&gt;(&lt;parameter&gt;). For example if I wanted you to answer a specific question I'd type you.answer(question1).\n"); hintGiven();</script>
</task>
<task id="OpenDrawerHintDie">
<precondition>isHint(5)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserOpenDrawer">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Open the drawer variable names: officeDrawer, myKey.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><img src=\"http://www.lfstyl.com/storage/KNF-DESK-4PIECE.jpg\"/><br/>Must be in the drawer...</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> officeDrawer.isOpen() </postcondition>
</task>
<subtasks id="SystemDoesOpenDrawer" goal="OpenDrawer" ordered="false">
<step name="SystemOpenDrawer" task="SystemOpenDrawer"/>
<step name="UserOpenDrawerAgain" task="UserOpenDrawerAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 4</applicable>
</subtasks>
<task id="SystemOpenDrawer">
<precondition>isHint(5)</precondition>
<script>printHint("Deus Ex Machina. Opening the Drawer by typing drawer.open(myKey)"); setCmd("var myKey = new Key(); myKey.cut(0); officeDrawer.open(myKey);");</script>
</task>
<task id="UserOpenDrawerAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Open the drawer variable names: officeDrawer, myKey.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><img src=\"http://www.lfstyl.com/storage/KNF-DESK-4PIECE.jpg\"/><br/>Must be in the drawer...</html>" ]]></dc:description>
<precondition>hintsRequestedGT(4) &amp;&amp; cmdIsSet();</precondition>
<postcondition> officeDrawer.isOpen() </postcondition>
</task>
<task id="DuplicateDocuments">
<postcondition> clonedDocuments == true </postcondition>
</task>
<subtasks id="UserDoesDuplicateDocuments" goal="DuplicateDocuments" ordered="false">
<step name="DuplicateDocumentsHint1" task="DuplicateDocumentsHint1"/>
<step name="DuplicateDocumentsHint2" task="DuplicateDocumentsHint2"/>
<step name="DuplicateDocumentsHint3" task="DuplicateDocumentsHint3"/>
<step name="DuplicateDocumentsHint4" task="DuplicateDocumentsHint4"/>
<step name="DuplicateDocumentsHintDie" task="DuplicateDocumentsHintDie"/>
<step name="UserDuplicateDocuments" task="UserDuplicateDocuments"/>
</subtasks>
<!--Hints for DuplicateDocuments-->
<task id="DuplicateDocumentsHint1">
<precondition>isHint(1)</precondition>
<script>printHint("Lets break the task down into steps.  1)Create a variable  2)Get the documents from the drawer 3)clone these documents\n"); hintGiven();</script>
</task>
<task id="DuplicateDocumentsHint2">
<precondition>isHint(2)</precondition>
<script>printHint("Like all Java objects, the documents have method clone(), which creates an exact copy\n"); hintGiven();</script>
</task>
<task id="DuplicateDocumentsHint3">
<precondition>isHint(3)</precondition>
<script>printHint("These documents are private variables, and thus can't be taken directly.  Luckily, type drawer has the method get Documents() which returns the documents\n"); hintGiven();</script>
</task>
<task id="DuplicateDocumentsHint4">
<precondition>isHint(4)</precondition>
<script>printHint("officeDrawer.getDocuments().clone() will get you a clone of the documents.  Without setting this to a variable saved in your program, you won't actually be able to do anything with these documents, however.  Remember to save the cloned documents to a variable of the same type.\n"); hintGiven();</script>
</task>
<task id="DuplicateDocumentsHintDie">
<precondition>isHint(5)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserDuplicateDocuments">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Duplicate the documents.  Variable name: officeDrawer</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><img src=\"http://www.lfstyl.com/storage/KNF-DESK-4PIECE.jpg\"/><br/>Now to make a copy...</html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> clonedDocuments == true </postcondition>
</task>
<subtasks id="SystemDoesDuplicateDocuments" goal="DuplicateDocuments" ordered="false">
<step name="SystemDuplicateDocuments" task="SystemDuplicateDocuments"/>
<step name="UserDuplicateDocumentsAgain" task="UserDuplicateDocumentsAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 4</applicable>
</subtasks>
<task id="SystemDuplicateDocuments">
<precondition>isHint(5)</precondition>
<script>printHint("[dripping sarcasm] I love doing your work. I'll type mDocs = drawer.getDocuments().clone()"); setCmd("clonedDocuments = true;");</script>
</task>
<task id="UserDuplicateDocumentsAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Duplicate the documents.  Variable name: officeDrawer</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><img src=\"http://www.lfstyl.com/storage/KNF-DESK-4PIECE.jpg\"/><br/>Now to make a copy...</html>" ]]></dc:description>
<precondition>hintsRequestedGT(4) &amp;&amp; cmdIsSet();</precondition>
<postcondition> clonedDocuments == true </postcondition>
</task>
<task id="MakeKeyCard">
<postcondition> madeKeyCard &gt; 0 </postcondition>
</task>
<subtasks id="UserDoesMakeKeyCard" goal="MakeKeyCard" ordered="false">
<step name="MakeKeyCardHint1" task="MakeKeyCardHint1"/>
<step name="MakeKeyCardHint2" task="MakeKeyCardHint2"/>
<step name="MakeKeyCardHintDie" task="MakeKeyCardHintDie"/>
<step name="UserMakeKeyCard" task="UserMakeKeyCard"/>
</subtasks>
<!--Hints for MakeKeyCard-->
<task id="MakeKeyCardHint1">
<precondition>isHint(1)</precondition>
<script>printHint("We need something that does everything a key does, but it also needs an electronic bar code.  When a class definition has the word \"extends\" &lt;class2&gt; it inherits everything from class 2, then does more.  Class KeyCard extends class Key.\n"); hintGiven();</script>
</task>
<task id="MakeKeyCardHint2">
<precondition>isHint(2)</precondition>
<script>printHint("Class Poodle extends Class Dog. If I have a variable declared in the line Dog myDog;  I can set that dog to an instance of poodle by saying myDog = new Poodle();\n"); hintGiven();</script>
</task>
<task id="MakeKeyCardHintDie">
<precondition>isHint(3)</precondition>
<script>$this.success = false;</script>
</task>
<task id="UserMakeKeyCard">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Make a key card (which is not just a key, its of class KeyCard).  You have the variable declared as Key keyOut.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><br/></html>" ]]></dc:description>
<precondition>hintsGiven() == Packages.zep.HintSingleton.GetInstance().getNumHintsRequested()</precondition>
<postcondition> madeKeyCard &gt; 0 </postcondition>
</task>
<subtasks id="SystemDoesMakeKeyCard" goal="MakeKeyCard" ordered="false">
<step name="SystemMakeKeyCard" task="SystemMakeKeyCard"/>
<step name="UserMakeKeyCardAgain" task="UserMakeKeyCardAgain"/>
<applicable>Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; 2</applicable>
</subtasks>
<task id="SystemMakeKeyCard">
<precondition>isHint(3)</precondition>
<script>printHint("We will commence enhancing the truth in... all right, it's just easier to give you the truth. Solving this problem is as simple as getMeOutOfHere = new KeyCard();"); setCmd("new KeyCard();");</script>
</task>
<task id="UserMakeKeyCardAgain">
<dc:title xmlns:dc="http://purl.org/dc/elements/1.1">Make a key card (which is not just a key, its of class KeyCard).  You have the variable declared as Key keyOut.</dc:title>
<dc:description xmlns:dc="http://purl.org/dc/elements/1.1"><![CDATA[ "<html><b>Empire State Building</b><br/><br/></html>" ]]></dc:description>
<precondition>hintsRequestedGT(2) &amp;&amp; cmdIsSet();</precondition>
<postcondition> madeKeyCard &gt; 0 </postcondition>
</task>
<!--Hint reset-->
<task id="ResetHints">
<script>resetHints();</script>
</task>
<!--Initialization script-->
<script init="true">
		var spyName = null;
	    var authorizedPerson = "Hat guy";
	    var handleRotation = 0;
	    var madeKey = 0;
	    var madeKeyCard = 0;
	    var clonedDocuments = false;
	
	    var airlockPressure = 0;
	    var zeppelinPressure = 30;
	    var airlockCombo = new Array(4);
	    airlockCombo[0] = 0;
	    airlockCombo[1] = 0;
	    airlockCombo[2] = 0;
	    airlockCombo[3] = 0;
	    
	    function Drawer(lockCombo) {
	    	this.drawerOpen = undefined;
	    	this.lockCombo = lockCombo;
	    }
	    
	    function open(key) {
	    	if(this.lockCombo == key.combo) { this.drawerOpen = true; }
	    }
	    
	    function close() {
	    	this.drawerOpen = false;
	    }
	    
	    function isOpen() {
	    	return this.drawerOpen == true;
	    }
	    
	    Drawer.prototype.open = open;
	    Drawer.prototype.close = close;
	    Drawer.prototype.isOpen = isOpen;
	    
	    var officeDrawer = new Drawer(0);
	    
	    function Key() {
	    	combo = 0;
	    	lookEverybodyIMadeAKey();
	    }
	    
	    function lookEverybodyIMadeAKey() {
	    	madeKey = madeKey + 1;
	    }
	    
	    function cut(combo) {
	    	this.combo = combo;
	    }
	    
	    Key.prototype.cut = cut;
	    
	    KeyCard.prototype = new Key();
	    function KeyCard() {
	    	lookEverybodyIMadeAKeyCard();
	    }
	    
	    function lookEverybodyIMadeAKeyCard() {
	    	madeKeyCard = madeKeyCard + 1;
	    }
	    
	    function Documents() {
	    }
	    
	    function clone() {
	    	documentsCloned = true;
	    }
	    
	    Documents.prototype.clone = clone;
	
		
		function hintsRequestedGT(num) {
	    	return Packages.zep.HintSingleton.GetInstance().getNumHintsRequested() &gt; num;
	    }
	    
	    function hintsGiven() {
	    	return Packages.zep.HintSingleton.GetInstance().getNumHintsGiven();
	    }
	    
	    function hintGiven() {
	    	Packages.zep.HintSingleton.GetInstance().hintGiven();
	    }
	    
	    function resetHints() {
	    	Packages.zep.HintSingleton.GetInstance().reset();
	    }
	    
	    function isHint(num) {
	    	return hintsRequestedGT(num - 1) &amp;&amp; hintsGiven() == num - 1;
	    }
	    
	    function printHint(text) {
	    	Packages.zep.HintSingleton.GetInstance().setHint(text);
	    }
	    
	    function setCmd(text) {
	    	Packages.zep.HintSingleton.GetInstance().setCommand(text);
	    }
	    
	    function cmdIsSet() {
	    	return Packages.zep.HintSingleton.GetInstance().getCommand() != null;
	    }
	</script>
</taskModel>
