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

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/exercise.html

Add an XHTMLUnauthorizedView which redirects unauthenticated users to the
login page if a page raises an Unauthorized. Alter UserSettingsView to raise
one in the right cases, for testing.

Show diffs side-by-side

added added

removed removed

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