~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to exercises/sample/hello.xml

  • Committer: mattgiuca
  • Date: 2008-01-29 23:52:19 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:329
Converted Console from an "app" into a "plugin". It can now be plugged in to
any app.
Added "plugins" directory in www. Added "console" plugin. This contains all of
the functionality of what was previously the console app, but modularized so
it can be imported by another app.

apps/console: Removed most of the logic (moved to plugins/console). Replaced
with a simple import of the console plugin. Should behave exactly the same.
apps/tutorial: As proof of concept, imported the console plugin. It now
appears at the bottom of the page (yet to make it have "pop up" behaviour).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<exercise name = "Hello Name">
2
 
    <desc>You need to write "Hello" and then your name.</desc>
3
 
    <partial>
4
 
<![CDATA[
5
 
print "Hello <print the contents of the variable 'name' here>"
6
 
]]>
7
 
    </partial>
8
 
    <solution>
9
 
<![CDATA[
10
 
# Sample solution, used to generate test output
11
 
greeting = "Hello"
12
 
print " ".join([greeting, name])
13
 
]]>
14
 
    </solution>
15
 
    <!-- Alternatively, <solution src="all_input_test_soln.py" /> -->
16
 
    <case name="&quot;Hello Alice&quot;">
17
 
        <!-- Specify input -->
18
 
        <var name="name" value="'Alice'" />
19
 
        <function pass="All letters are correct, ignoring case" fail="Output contains incorrect characters" default="ignore">
20
 
            <stdout>str.lower</stdout>
21
 
        </function>
22
 
        <function pass="Program contains a print statement" fail="You need to use a print statement" default="ignore">
23
 
            <code type="check">lambda x,y: 'print' in y</code>
24
 
        </function>
25
 
        <!-- Ensures that all outputs match exactly --> 
26
 
        <function pass="Exact match" fail="Incorrect characters still" default="ignore">
27
 
            <stdout type="norm">str.strip</stdout>
28
 
        </function>
29
 
    </case>
30
 
</exercise>
31