~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-03-15 05:55:20 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:698
Added Save feature to tutorial system.
tutorialservice: Added "save" action, which works the same as submit, but
    saves to the DB instead of making an attempt, and doesn't run the code.
    Factored out code to open an exercise file.
tutorial: Added Save button to exercise boxen.
tutorial.js: Added saveexercise function, which makes an Ajax request to the
    "save" action of tutorialservice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
            % (rows, exercisepartial))
357
357
    filename = cgi.escape(cjson.encode(exercisesrc), quote=True)
358
358
    req.write("""\n<div class="exercisebuttons">
 
359
  <input type="button" value="Save"
 
360
    onclick="saveexercise(&quot;exercise%d&quot;, %s)"
 
361
    title="Save your solution to this exercise" />
359
362
  <input type="button" value="Run"
360
363
    onclick="runexercise(&quot;exercise%d&quot;, %s)"
361
364
    title="Run this program in the console" />
365
368
</div>
366
369
<div class="testoutput">
367
370
</div>
368
 
""" % (exerciseid, filename, exerciseid, filename))
 
371
""" % (exerciseid, filename, exerciseid, filename, exerciseid, filename))
369
372
    req.write("</div>\n")