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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2009-12-15 01:49:45 UTC
  • Revision ID: me@williamgrant.id.au-20091215014945-mmqy3lmim5c4dp4j
Redo the exercise test part type (check/norm) selection, with radio buttons. Also add an exact match option, as yet unfunctional.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
      <input type="text" id="${name}" value="${select('*|text()')}" />
25
25
    </div>
26
26
 
 
27
    <div py:match="iw:radio" py:with="name=((iw_prefix + '_') or '') + str(select('@name')); id=name + '_' + str(select('@value'))">
 
28
      <input type="radio" name="${name}" id="${id}" value="${str(select('@value'))}"
 
29
             py:attrs="{'checked': 'checked'} if str(select('@current')) == str(select('@value')) else {}" />
 
30
      <label for="${id}">${select('@desc')}</label>
 
31
    </div>
 
32
 
27
33
    <a py:match="iw:delete" href="javascript:${select('@action')}"><img title="Delete" alt="Delete" src="${mediapath}cross.png"/></a>
28
34
 
29
35
    <h1>Edit ${exercise.name}</h1>
116
122
                        <ul class="test_case_parts" id="test_case_parts_${test_case.testid}_${test_suite.suiteid}">
117
123
                          <li py:for="test_part in test_case.parts"
118
124
                              py:with="iw_prefix='test_part_%d' % test_part.partid">
119
 
                            <label for="test_part_${test_part.partid}_part_type">Test</label>
 
125
                            <iw:delete action="delete_testpart('${test_part.partid}','${test_case.testid}','${test_suite.suiteid}')" />
 
126
                            <label for="test_part_${test_part.partid}_part_type">Test the solution and attempt</label>
120
127
                            <select name="Part Type" id="test_part_${test_part.partid}_part_type">
121
128
                              <py:for each="part_type in part_types">
122
129
                                <option py:if="part_type==test_part.part_type" selected="selected" value="${part_type}">${part_types[part_type]}</option>
123
130
                                <option py:if="part_type!=test_part.part_type" value="${part_type}">${part_types[part_type]}</option>
124
131
                              </py:for>
125
132
                            </select>
126
 
                            <label for="test_part_${test_part.partid}_test_type">using the following</label>
127
 
                            <select name="Test Type" id="test_part_${test_part.partid}_test_type">
128
 
                              <py:for each="test_type in test_types">
129
 
                                <option py:if="test_type==test_part.test_type" selected="selected" value="${test_type}">${test_types[test_type]}</option>
130
 
                                <option py:if="test_type!=test_part.test_type" value="${test_type}">${test_types[test_type]}</option>
131
 
                              </py:for>
132
 
                            </select>
133
 
                            function:
134
 
                            <iw:delete action="delete_testpart('${test_part.partid}','${test_case.testid}','${test_suite.suiteid}')" />
 
133
                            <div py:with="iw_prefix='test_part_%d' % test_part.partid">
 
134
                              <iw:radio name="test_type" desc="for an exact match, with no normalisation" value="match" current="${test_part.test_type}" />
 
135
                              <iw:radio name="test_type" desc="for an exact match, after passing each through the following normalisation function" value="norm" current="${test_part.test_type}" />
 
136
                              <iw:radio name="test_type" desc="using the following comparison function" value="check" current="${test_part.test_type}" />
 
137
                            </div>
135
138
                            <textarea id="test_part_${test_part.partid}_data" cols="80" rows="2">${test_part.data}</textarea>
136
139
                            <br />
137
140
                            <input type="button" value="Save Part" onclick="edit_test_part('${test_part.partid}', '${test_case.testid}', ${test_suite.suiteid})" />
139
142
                          <li py:with="iw_prefix='test_part_new'">
140
143
                            <a onclick="tog('new_test_part_${test_case.testid}')">New test case part</a>
141
144
                            <div class="add_new_part" id="new_test_part_${test_case.testid}">
142
 
                              <label for="test_part_new_part_type_${test_case.testid}">Test</label>
 
145
                              <label for="test_part_new_part_type_${test_case.testid}">Test the solution and attempt</label>
143
146
                              <select name="Part Type" id="test_part_new_part_type_${test_case.testid}">
144
147
                                <py:for each="part_type in part_types">
145
148
                                  <option value="${part_type}">${part_types[part_type]}</option>
146
149
                                </py:for>
147
150
                              </select>
148
 
                              <label for="test_part_new_test_type_${test_case.testid}">using the following</label>
149
 
                              <select name="Test Type" id="test_part_new_test_type_${test_case.testid}">
150
 
                                <py:for each="test_type in test_types">
151
 
                                  <option value="${test_type}">${test_types[test_type]}</option>
152
 
                                </py:for>
153
 
                              </select>
154
 
                              function:
155
 
                              <br />
 
151
                              <div py:with="iw_prefix='test_part_new_%d' % test_case.testid">
 
152
                                <iw:radio name="test_type" desc="for an exact match, with no normalisation" value="match" />
 
153
                                <iw:radio name="test_type" desc="for an exact match, after passing each through the following normalisation function" value="norm" />
 
154
                                <iw:radio name="test_type" desc="using the following comparison function" value="check" />
 
155
                              </div>
156
156
                              <textarea id="test_part_new_data_${test_case.testid}" cols="80" rows="2"></textarea>
157
157
                              <br />
158
158
                              <input type="button" value="Create Part" onclick="add_test_part('${test_case.testid}', '${test_suite.suiteid}')" id="new_test_part_save_${test_case.testid}" />