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

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/templates/worksheet.html

  • Committer: Matt Giuca
  • Date: 2010-02-24 12:47:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1701.
  • Revision ID: matt.giuca@gmail.com-20100224124731-r4tgywr2djomab4s
worksheet page: If the viewer has permission to edit, the list of exercises in the contents is replaced by a table showing the statistics on each exercise, including the number of students who have attempted and completed the exercise. Fixed up JavaScript so the dynamic change to a green ball still works on this modified view.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
      <!-- Display the Table Of Contents -->
21
21
      <div id="tutorial-toc">
22
22
        <h2>Contents</h2>
 
23
        <py:if test="show_exercise_stats">
 
24
        <table class="pretty_table">
 
25
          <tr><th></th><th>Exercise</th><th># completed</th>
 
26
              <th># attempted</th><th>% complete</th>
 
27
          </tr>
 
28
          <py:for each="exercise in exercises">
 
29
            <tr class="${exercise['complete']}" id="toc_li_${exercise['exid']}">
 
30
              <td><img
 
31
              src="/+media/ivle.webapp.tutorial/images/tiny/${'complete' if exercise['complete'] == 'complete' else 'incomplete'}.png" /></td>
 
32
              <td><a href="#${exercise['exid']}">${exercise.name}</a></td>
 
33
              <td py:content="exercise.stats[0]" />
 
34
              <td py:content="exercise.stats[1]" />
 
35
              <td py:if="exercise.stats[1] > 0">${int((100.0 * exercise.stats[0]) / exercise.stats[1])}%</td>
 
36
              <td py:if="exercise.stats[1] == 0">N/A</td>
 
37
            </tr>
 
38
          </py:for>
 
39
        </table>
 
40
        <p>Note: The above statistics show the completion and attempt rate on
 
41
        each exercise, for all students enrolled in the subject.</p>
 
42
        </py:if>
 
43
        <py:if test="not show_exercise_stats">
23
44
        <ul>
24
45
          <py:for each="exercise in exercises">
25
46
            <li class="${exercise['complete']}" id="toc_li_${exercise['exid']}">
29
50
            </li>
30
51
          </py:for>
31
52
        </ul>
 
53
        </py:if>
32
54
      </div>
33
55
      ${worksheetstream}
34
56
    </div>