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

« back to all changes in this revision

Viewing changes to www/apps/tutorial/exercise.html

  • Committer: chadnickbok
  • Date: 2009-02-02 04:00:25 UTC
  • Revision ID: svn-v4:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1189
Adding the changes from my genshi branch into trunk.

Most apps now use the Genshi templating engine, in preparation
for future changes to dispatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<html xmlns="http://www.w3.org/1999/xhtml"
 
2
      xmlns:xi="http://www.w3.org/2001/XInclude"
2
3
      xmlns:py="http://genshi.edgewall.org/" py:strip="">
3
 
  <div class="exercise" id="${exercise.id}">
4
 
    <p><b>Exercise:</b> ${exercise.name}</p>
5
 
    <py:if test="description is not None">
6
 
      <div>${description}</div>
 
4
  <div class="exercise" id="exercise${exerciseid}">
 
5
    <p><b>Exercise:</b> ${exercisename}</p>
 
6
    <py:if test="exercisedesc is not None">
 
7
      <div>${exercisedesc}</div>
7
8
    </py:if>
8
 
    <input id="input_resettext_${exercise.id}" type="hidden" value="${exercise.partial}" />
9
 
    <textarea id="textarea_${exercise.id}" class="exercisebox"
10
 
        onkeypress="return catch_textbox_input(&quot;${exercise.id}&quot;, '${exercise.id}',
 
9
    <input id="input_resettext_exercise${exerciseid}" type="hidden" value="${exercisepartial_backup}" />
 
10
    <textarea id="textarea_exercise${exerciseid}" class="exercisebox"
 
11
        onkeypress="return catch_textbox_input(&quot;exercise${exerciseid}&quot;, '${filename}',
11
12
        event.keyCode)"
12
 
        onchange="set_saved_status(&quot;${exercise.id}&quot;, '${exercise.id}',
 
13
        onchange="set_saved_status(&quot;exercise${exerciseid}&quot;, '${filename}',
13
14
        &quot;Save&quot;)"
14
 
        cols="80" rows="${exercise.num_rows}">${exercisesave}</textarea>
 
15
        cols="80" rows="${rows}">
 
16
        ${exercisepartial}
 
17
    </textarea>
15
18
    <div class="exercisebuttons">
16
 
      <py:if test="worksheet">
17
 
        <input type="button" value="Saved" disabled="disabled" id="savebutton_${exercise.id}"
18
 
            onclick="saveexercise(&quot;${exercise.id}&quot;, '${exercise.id}')"
19
 
            title="Save your solution to this exercise" />
20
 
        <input type="button" value="Reset" id="resetbutton_${exercise.id}"
21
 
            onclick="resetexercise(&quot;${exercise.id}&quot;, '${exercise.id}')"
22
 
            title="Reload the original partial solution for this exercise" />
23
 
      </py:if>
 
19
      <input type="button" value="Saved" disabled="disabled" id="savebutton_exercise${exerciseid}"
 
20
          onclick="saveexercise(&quot;exercise${exerciseid}&quot;, '${filename}')"
 
21
          title="Save your solution to this exercise" />
 
22
      <input type="button" value="Reset" id="resetbutton_exercise${exerciseid}"
 
23
          onclick="resetexercise(&quot;exercise${exerciseid}&quot;, '${filename}')"
 
24
          title="Reload the original partial solution for this exercise" />
24
25
      <input type="button" value="Run"
25
 
          onclick="runexercise(&quot;${exercise.id}&quot;, '${exercise.id}')"
 
26
          onclick="runexercise(&quot;exercise${exerciseid}&quot;, '${filename}')"
26
27
          title="Run this program in the console" />
27
28
      <input type="button" value="Submit"
28
 
              id="submitbutton_${exercise.id}"
29
 
              onclick="submitexercise(&quot;${exercise.id}&quot;, '${exercise.id}')"
 
29
              id="submitbutton_exercise${exerciseid}"
 
30
              onclick="submitexercise(&quot;exercise${exerciseid}&quot;, '${filename}')"
30
31
              title="Submit this solution for evaluation" />
31
32
    </div>
32
33
    <div class="testoutput">
33
34
    </div>
34
 
    <div py:if="worksheet" class="problem_summary">
 
35
    <div class="problem_summary">
35
36
      <ul>
36
 
        <li id="summaryli_${exercise.id}" class="${complete_class}">
37
 
          <b><span id="summarycomplete_${exercise.id}">${complete}</span>.</b>
38
 
            Attempts: <span id="summaryattempts_${exercise.id}">${attempts}</span>.
 
37
        <li id="summaryli_exercise${exerciseid}" class="${complete}">
 
38
          <b><span id="summarycomplete_exercise${exerciseid}">${complete}</span>.</b>
 
39
            Attempts: <span id="summaryattempts_exercise${exerciseid}">${attempts}</span>.
39
40
        </li>
40
41
      </ul>
41
42
    </div>
42
43
    <!-- This is filled in by javascript when the page loads -->
43
 
    <div py:if="worksheet" class="attempthistory">
 
44
    <div class="attempthistory">
44
45
      <p>
45
46
        <a title="Click to view previous submissions you have made for this exercise" 
46
 
              onclick="open_previous(&quot;${exercise.id}&quot;, '${exercise.id}')">
 
47
              onclick="open_previous(&quot;exercise${exerciseid}&quot;, '${filename}')">
47
48
          View previous attempts
48
49
        </a>
49
50
      </p>
50
51
    <div style="display: none">
51
52
      <h3>Previous attempts</h3>
52
53
        <p>
53
 
          <a title="Close the previous attempts" onclick="close_previous(&quot;${exercise.id}&quot;)">
 
54
          <a title="Close the previous attempts" onclick="close_previous(&quot;exercise${exerciseid}&quot;)">
54
55
            Close attempts
55
56
          </a>
56
57
        </p>
57
 
        <p class="attemptslist" style="display: none">
 
58
        <p>
58
59
          <select title="Select an attempt's time stamp from the list">
59
60
            <option></option>
60
61
          </select>
61
62
          <input type="button" value="View"
62
 
              onclick="select_attempt(&quot;${exercise.id}&quot;, '${exercise.id}')" />
63
 
        </p>
64
 
        <p class="noattempts" style="display: none">
65
 
          No attempts have been made for this exercise.
 
63
              onclick="select_attempt(&quot;exercise${exerciseid}&quot;, '${filename})'" />
66
64
        </p>
67
65
        <p>
68
 
          <textarea readonly="readonly" class="exercisebox" cols="80" rows="${exercise.num_rows}"
 
66
          <textarea readonly="readonly" class="exercisebox" cols="80" rows="${rows}"
69
67
              title="You submitted this code on a previous attempt">
70
68
          </textarea>
71
69
        </p>