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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-01-29 05:42:01 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:325
tutorial: Added "run" button which submits the students code to the
tutorialservice for "unofficial" testing.
Currently tutorialservice:run just echoes the code back to the student.

Show diffs side-by-side

added added

removed removed

Lines of Context:
279
279
        req.write("<p>%s</p>" % problemdesc)
280
280
    req.write('<textarea class="problembox" cols="80" rows="12">%s</textarea>'
281
281
            % problempartial)
 
282
    filename = cgi.escape(cjson.encode(problemsrc), quote=True)
282
283
    req.write("""\n<div class="problembuttons">
 
284
  <input type="button" value="Run"
 
285
    onclick="runproblem(&quot;problem%d&quot;, %s)" />
283
286
  <input type="button" value="Submit"
284
287
    onclick="submitproblem(&quot;problem%d&quot;, %s)" />
285
288
</div>
 
289
<p>Output:</p>
 
290
<textarea class="runoutput" cols="80" rows="6" readonly="true">
 
291
</textarea>
286
292
<div class="testoutput">
287
293
</div>
288
 
""" % (problemid, cgi.escape(cjson.encode(problemsrc), quote=True)))
 
294
""" % (problemid, filename, problemid, filename))
289
295
    req.write("</div>\n")