~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-08-18 12:15:25 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1027
Tutorial: Added new feature - previous attempt viewing. Allows users to see
    code they have previously submitted to tutorials.
    A new button ("View previous attempts") appears on each exercise box.
    This uses the getattempts and getattempt Ajax services checked in
    previously.
Note once again: Students are not (for the moment) able to see deactivated
attempts (this is a conservative approach - the ability to see deactivated
attempts can be turned on by setting HISTORY_ALLOW_INACTIVE = True in
tutorialservice).

Show diffs side-by-side

added added

removed removed

Lines of Context:
572
572
        % (exerciseid, exerciseid, filename))
573
573
    req.write("""</div>
574
574
<div class="testoutput">
575
 
</div>\n""")
 
575
</div>
 
576
""")
576
577
    # Write the "summary" - whether this problem is complete and how many
577
578
    # attempts it has taken.
578
579
    req.write("""<div class="problem_summary">
584
585
""" % (exerciseid, "complete" if complete else "incomplete",
585
586
        exerciseid, "Complete" if complete else "Incomplete",
586
587
        exerciseid, attempts))
 
588
    # Write the attempt history infrastructure
 
589
    req.write("""<div class="attempthistory">
 
590
  <p><a title="Click to view previous submissions you have made for this \
 
591
exercise" onclick="open_previous(&quot;exercise%d&quot;, %s)">View previous \
 
592
attempts</a></p>
 
593
  <div style="display: none">
 
594
    <h3>Previous attempts</h3>
 
595
    <p><a title="Close the previous attempts" \
 
596
onclick="close_previous(&quot;exercise%d&quot;)">Close attempts</a></p>
 
597
    <p>
 
598
      <select title="Select an attempt's time stamp from the list">
 
599
        <option></option>
 
600
      </select>
 
601
      <input type="button" value="View"
 
602
        onclick="select_attempt(&quot;exercise%d&quot;, %s)" />
 
603
    </p>
 
604
    <p><textarea readonly="readonly" class="exercisebox" cols="80" rows="%s"
 
605
        title="You submitted this code on a previous attempt">
 
606
       </textarea>
 
607
    </p>
 
608
  </div>
 
609
</div>
 
610
""" % (exerciseid, filename, exerciseid, exerciseid, filename, rows))
587
611
    req.write("</div>\n")
588
612
 
589
613
def update_db_worksheet(subject, worksheet, file_mtime,