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

« back to all changes in this revision

Viewing changes to www/apps/tutorial/__init__.py

  • Committer: stevenbird
  • Date: 2008-02-19 09:11:38 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:511
README-examples:
* documented new functionality for testing exercises

tutorial/__init__.py:
* support for specifying explicit number of rows for a problem textarea

Show diffs side-by-side

added added

removed removed

Lines of Context:
293
293
        # TODO: Nicer error message, to help authors
294
294
        req.throw_error(req.HTTP_INTERNAL_SERVER_ERROR)
295
295
    problemname = problemdom.getAttribute("name")
 
296
    rows = problemdom.getAttribute("rows")
 
297
    if not rows:
 
298
        rows = "12"
296
299
    # Look for some other fields we need, which are elements:
297
300
    # - desc
298
301
    # - partial
309
312
    req.write("<p><b>Exercise:</b> %s</p>\n" % problemname)
310
313
    if problemdesc is not None:
311
314
        req.write("<div>%s</div>\n" % problemdesc)
312
 
    req.write('<textarea class="problembox" cols="80" rows="12">%s</textarea>'
313
 
            % problempartial)
 
315
    req.write('<textarea class="problembox" cols="80" rows="%s">%s</textarea>'
 
316
            % (rows, problempartial))
314
317
    filename = cgi.escape(cjson.encode(problemsrc), quote=True)
315
318
    req.write("""\n<div class="problembuttons">
316
319
  <input type="button" value="Run"