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