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

« back to all changes in this revision

Viewing changes to doc/man/tour.rst

  • Committer: Matt Giuca
  • Date: 2010-02-18 00:02:51 UTC
  • Revision ID: matt.giuca@gmail.com-20100218000251-l2cjpuazey4zeddw
Updated sample data: Added a new exercise 'hello'. This is a gentler
introduction to the testing framework, and also uses a new feature - regexes
for testing approximately correct solutions.

The worksheet now contains both exercises.

Updated docs: sample and tour.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
one worksheet, Worksheet Basics. Clicking this takes you to the worksheet,
107
107
where students are challenged by Python questions.
108
108
 
109
 
After reading the worksheet, attempt the simple programming question, which is
110
 
to write a factorial program.
111
 
 
112
 
A sample solution follows::
 
109
After reading the worksheet, attempt the first simple programming question,
 
110
which is to write the Hello world program.
 
111
 
 
112
First, click Submit without writing any code, and note that the system
 
113
automatically runs a test case, which fails. Now change the code to be "almost
 
114
right" (for example, write "Hello world" instead of "Hello, world!"), and
 
115
press Submit again. It will tell you that you almost got it right. In this
 
116
way, the IVLE test framework can show users that they're on the right track.
 
117
If you get it exactly right and click Submit a third time, you will pass the
 
118
test.
 
119
 
 
120
Note that you can also click "Run", and it will execute your solution in the
 
121
Python console. This doesn't cost you an "attempt", nor does it run the test
 
122
cases. It just lets you test it out for yourself before making an official
 
123
submission.
 
124
 
 
125
Back on the subject page, you will notice that the exercise appears complete,
 
126
and you have been awarded a mark.
 
127
 
 
128
A sample solution to the second exercise follows::
113
129
 
114
130
 def fac(n):
115
131
     if n == 0:
121
137
     f = int(raw_input())
122
138
     print fac(f)
123
139
 
124
 
First, click Submit, and note that the system automatically runs some test
125
 
cases, all of which fail. Now paste the solution to :func:`fac` (but not
126
 
:func:`main`). Clicking Submit again shows some test cases pass, but not all.
127
 
Finally, paste the solution to :func:`main`, and click Submit again. This
128
 
time, you will pass the test.
129
 
 
130
 
Note that you can also click "Run", and it will execute your solution in the
131
 
Python console. This doesn't cost you an "attempt", nor does it run the test
132
 
cases. It just lets you test it out for yourself before making an official
133
 
submission.
134
 
 
135
 
Back on the subject page, you will notice that the exercise appears complete,
136
 
and you have been awarded some marks.
137
 
 
138
140
A lecturer's view
139
141
=================
140
142