1099.1.212
by Nick Chadwick
Added a new page to display exercises. This will then be modified to |
1 |
<html xmlns="http://www.w3.org/1999/xhtml" |
1099.7.7
by William Grant
Start a trial of templating out widgets in the exercise editor. |
2 |
xmlns:py="http://genshi.edgewall.org/" |
3 |
xmlns:iw="http://www.ivle.org/2009/widgets"> |
|
1099.1.212
by Nick Chadwick
Added a new page to display exercises. This will then be modified to |
4 |
<head>
|
5 |
<title>Edit - ${exercise.name}</title> |
|
6 |
<!-- These let the javascript know which worksheet is open -->
|
|
7 |
<script type="text/javascript"> |
|
1099.1.216
by Nick Chadwick
Started adding in add and save options in the exercise edit view, to |
8 |
exercise = '${exercise.id}'; |
1099.1.212
by Nick Chadwick
Added a new page to display exercises. This will then be modified to |
9 |
</script> |
10 |
</head> |
|
11 |
<body>
|
|
1099.7.7
by William Grant
Start a trial of templating out widgets in the exercise editor. |
12 |
<!--! iw:textarea: A textarea widget wrapper.
|
13 |
Generates a textarea in a div with a label. Define iw_prefix earlier
|
|
14 |
to automatically give a prefix to the name. -->
|
|
15 |
<div py:match="iw:textarea" py:with="name=((iw_prefix + '_') or '') + str(select('@name'))"> |
|
16 |
<label for="${name}">${select('@desc')}:</label> |
|
1099.7.10
by William Grant
The root exercise widgets are now also templated out. |
17 |
<br py:if="defined('iw_label_linebreak') and iw_label_linebreak" /> |
1099.7.7
by William Grant
Start a trial of templating out widgets in the exercise editor. |
18 |
<textarea id="${name}" cols="${select('@cols')}" rows="${select('@rows')}">${select('*|text()')}</textarea> |
19 |
</div> |
|
20 |
||
1099.7.9
by William Grant
Test case addition/editing widgets are templated. |
21 |
<div py:match="iw:text" py:with="name=((iw_prefix + '_') or '') + str(select('@name'))"> |
22 |
<label for="${name}">${select('@desc')}:</label> |
|
1099.7.10
by William Grant
The root exercise widgets are now also templated out. |
23 |
<br py:if="defined('iw_label_linebreak') and iw_label_linebreak" /> |
1099.7.9
by William Grant
Test case addition/editing widgets are templated. |
24 |
<input type="text" id="${name}" value="${select('*|text()')}" /> |
25 |
</div> |
|
26 |
||
1099.7.15
by William Grant
Extract delete links into iw:delete, giving them titles and alts. |
27 |
<a py:match="iw:delete" href="javascript:${select('@action')}"><img title="Delete" alt="Delete" src="${mediapath}cross.png"/></a> |
28 |
||
1099.1.221
by Nick Chadwick
added in extra parts to the exercise edit view. Now almost all |
29 |
<h1>Edit Exercise - ${exercise.id}</h1> |
1099.1.212
by Nick Chadwick
Added a new page to display exercises. This will then be modified to |
30 |
<div id="ivle_padding"> |
1099.1.221
by Nick Chadwick
added in extra parts to the exercise edit view. Now almost all |
31 |
<h3>Exercise Values:</h3> |
1099.7.10
by William Grant
The root exercise widgets are now also templated out. |
32 |
<div py:with="iw_prefix='exercise'; iw_label_linebreak=True"> |
33 |
<iw:text name="id" desc="Identifier">${exercise.id}</iw:text> |
|
34 |
<iw:text name="name" desc="Name">${exercise.name}</iw:text> |
|
35 |
<iw:text name="num_rows" desc="Number of Rows">${exercise.num_rows}</iw:text> |
|
36 |
<iw:textarea name="desc" desc="Description (RST)" cols="80" rows="10">${exercise.description}</iw:textarea> |
|
37 |
<iw:textarea name="solution" desc="Solution" cols="80" rows="5">${exercise.solution}</iw:textarea> |
|
38 |
<iw:textarea name="partial" desc="Partial Solution" cols="80" rows="5">${exercise.partial}</iw:textarea> |
|
39 |
<iw:textarea name="include" desc="Included Code" cols="80" rows="5">${exercise.include}</iw:textarea> |
|
1099.7.11
by William Grant
Turn all of the exercise editor's submit inputs into buttons, drop some |
40 |
<input type="button" value="Save" onclick="edit_exercise()" /> |
1099.7.10
by William Grant
The root exercise widgets are now also templated out. |
41 |
</div> |
42 |
||
1099.7.19
by William Grant
Box in the contents of suites. |
43 |
<ul class="test_suites"> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
44 |
<py:for each="test_suite in exercise.test_suites"> |
45 |
<li>
|
|
1099.7.4
by William Grant
Wrap some exercise admin heading HTML to be a bit less unreadable. |
46 |
<h3>
|
47 |
<a id="suite_header_${test_suite.suiteid}" |
|
1099.7.34
by William Grant
Put the suite description in quotes. |
48 |
onclick="tog('suite_data_${test_suite.suiteid}')">Suite ${test_suite.seq_no + 1}: “${test_suite.description}”</a> |
1099.7.15
by William Grant
Extract delete links into iw:delete, giving them titles and alts. |
49 |
<iw:delete action="delete_suite('${test_suite.suiteid}')" /> |
1099.7.4
by William Grant
Wrap some exercise admin heading HTML to be a bit less unreadable. |
50 |
</h3> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
51 |
|
52 |
<div class="testsuite" id="suite_data_${test_suite.suiteid}"> |
|
1099.7.8
by William Grant
Suite editing widgets are templated. |
53 |
<div class="test_suite_vals" |
54 |
py:with="iw_prefix='test_suite_%d' % test_suite.suiteid"> |
|
55 |
<iw:textarea name="description" desc="Description" cols="80" rows="1">${test_suite.description}</iw:textarea> |
|
56 |
<iw:textarea name="function" desc="Function" cols="80" rows="1">${test_suite.function}</iw:textarea> |
|
57 |
<iw:textarea name="stdin" desc="Stdin" cols="80" rows="4">${test_suite.stdin}</iw:textarea> |
|
1099.7.11
by William Grant
Turn all of the exercise editor's submit inputs into buttons, drop some |
58 |
<input type="button" value="Save Suite" onclick="edit_suite('${test_suite.suiteid}')" /> |
1099.1.214
by Nick Chadwick
The skeleton for editing an exercise has now been created. The next |
59 |
</div> |
1099.1.212
by Nick Chadwick
Added a new page to display exercises. This will then be modified to |
60 |
|
1099.7.20
by William Grant
Show variables and test cases by default. |
61 |
<h4>Variables</h4> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
62 |
<div class="test_variables" id="variables_${test_suite.suiteid}"> |
1099.7.27
by William Grant
Turn variable lists into real <ul>s rather than <br>-separated <span>s. |
63 |
<ul>
|
64 |
<li py:for="variable in test_suite.variables"> |
|
1099.7.15
by William Grant
Extract delete links into iw:delete, giving them titles and alts. |
65 |
<iw:delete action="delete_var('${variable.varid}', '${test_suite.suiteid}')" /> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
66 |
<label for="var_type_${variable.varid}">Type:</label> |
67 |
<select name="Variable Type" id="var_type_${variable.varid}"> |
|
68 |
<py:for each="var_type in var_types"> |
|
1099.1.217
by Nick Chadwick
working on making the exercise editor complete |
69 |
<option py:if="var_type == variable.var_type" selected="selected" value="${var_type}">${var_type}</option> |
70 |
<option py:if="var_type != variable.var_type" value="${var_type}">${var_type}</option> |
|
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
71 |
</py:for> |
72 |
</select> |
|
73 |
<label for="var_name_${variable.varid}">Var Name:</label> |
|
74 |
<input type="text" id="var_name_${variable.varid}" value="${variable.var_name}" /> |
|
75 |
<label for="var_val_${variable.varid}">Var Value:</label> |
|
76 |
<input type="text" id="var_val_${variable.varid}" value="${variable.var_value}"/> |
|
77 |
<label for="var_argno_${variable.varid}">Arg Num:</label> |
|
78 |
<input size="5" type="text" id="var_argno_${variable.varid}" value="${variable.arg_no}" /> |
|
1099.7.12
by William Grant
Merge from trunk. |
79 |
<input type="button" value="Save Variable" onclick="edit_var('${variable.varid}', '${test_suite.suiteid}')" /> |
1099.7.27
by William Grant
Turn variable lists into real <ul>s rather than <br>-separated <span>s. |
80 |
</li> |
81 |
</ul> |
|
1099.7.36
by William Grant
Retitle the buttons to add parts and variables. |
82 |
<a onclick="tog('add_variable_${test_suite.suiteid}')">New variable</a> |
1099.1.217
by Nick Chadwick
working on making the exercise editor complete |
83 |
<div class="add_variable" id="add_variable_${test_suite.suiteid}"> |
84 |
<label for="new_var_type_${test_suite.suiteid}">Type:</label> |
|
85 |
<select name="Variable Type" id="new_var_type_${test_suite.suiteid}"> |
|
86 |
<py:for each="var_type in var_types"> |
|
87 |
<option value="${var_type}">${var_type}</option> |
|
88 |
</py:for> |
|
89 |
</select> |
|
90 |
<label for="new_var_name_${test_suite.suiteid}">Var Name:</label> |
|
91 |
<input type="text" id="new_var_name_${test_suite.suiteid}" /> |
|
92 |
<label for="new_var_val_${test_suite.suiteid}">Var Value:</label> |
|
93 |
<input type="text" id="new_var_val_${test_suite.suiteid}" /> |
|
94 |
<label for="new_var_argno_${test_suite.suiteid}">Arg Num:</label> |
|
95 |
<input size="5" type="text" id="new_var_argno_${test_suite.suiteid}" /> |
|
1099.7.11
by William Grant
Turn all of the exercise editor's submit inputs into buttons, drop some |
96 |
<input type="button" value="Add Variable" onclick="add_var('${test_suite.suiteid}')" /> |
1099.1.217
by Nick Chadwick
working on making the exercise editor complete |
97 |
</div> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
98 |
</div> |
1099.7.4
by William Grant
Wrap some exercise admin heading HTML to be a bit less unreadable. |
99 |
|
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
100 |
<div class="test_cases" id="test_cases_${test_suite.suiteid}"> |
101 |
<ul>
|
|
102 |
<py:for each="test_case in test_suite.test_cases"> |
|
103 |
<li>
|
|
1099.7.4
by William Grant
Wrap some exercise admin heading HTML to be a bit less unreadable. |
104 |
<h5>
|
105 |
<a onclick="tog('test_case_${test_case.testid}_${test_suite.suiteid}')" |
|
1099.7.33
by William Grant
Include the test case pass message in the test case heading. |
106 |
id="case_header_${test_case.testid}">Test Case ${test_case.seq_no + 1}: “${test_case.passmsg}”</a> |
1099.7.15
by William Grant
Extract delete links into iw:delete, giving them titles and alts. |
107 |
<iw:delete action="delete_testcase('${test_case.testid}','${test_suite.suiteid}')" /> |
1099.7.4
by William Grant
Wrap some exercise admin heading HTML to be a bit less unreadable. |
108 |
</h5> |
1099.7.9
by William Grant
Test case addition/editing widgets are templated. |
109 |
<div py:with="iw_prefix='test_case_%d_%d' % (test_case.testid, test_suite.suiteid)" |
110 |
class="test_case" id="${iw_prefix}"> |
|
111 |
<iw:text name="pass" desc="Pass Message">${test_case.passmsg}</iw:text> |
|
112 |
<iw:text name="fail" desc="Fail Message">${test_case.failmsg}</iw:text> |
|
113 |
<iw:text name="default" desc="Default Mode">${test_case.test_default}</iw:text> |
|
1099.7.11
by William Grant
Turn all of the exercise editor's submit inputs into buttons, drop some |
114 |
<input type="button" onclick="edit_test_case('${test_case.testid}','${test_suite.suiteid}')" value="Save Case" /> |
1099.7.9
by William Grant
Test case addition/editing widgets are templated. |
115 |
|
1099.6.1
by Nick Chadwick
Exercise-ui is now able to create an entire exercise. |
116 |
<h5>Test Case Parts</h5> |
1099.7.26
by William Grant
Reclass the test case part container, unhide it, and fix padding. |
117 |
<ul class="test_case_parts" id="test_case_parts_${test_case.testid}_${test_suite.suiteid}"> |
1099.7.14
by William Grant
Template out bits of the TestCasePart editor. |
118 |
<li py:for="test_part in test_case.parts" |
119 |
py:with="iw_prefix='test_part_%d' % test_part.partid"> |
|
120 |
<label for="test_part_${test_part.partid}_part_type">Part Type:</label> |
|
121 |
<select name="Part Type" id="test_part_${test_part.partid}_part_type"> |
|
1099.1.217
by Nick Chadwick
working on making the exercise editor complete |
122 |
<py:for each="part_type in part_types"> |
123 |
<option py:if="part_type==test_part.part_type" selected="selected" value="${part_type}">${part_type}</option> |
|
124 |
<option py:if="part_type!=test_part.part_type" value="${part_type}">${part_type}</option> |
|
125 |
</py:for> |
|
126 |
</select> |
|
1099.7.14
by William Grant
Template out bits of the TestCasePart editor. |
127 |
<label for="test_part_${test_part.partid}_test_type">Test Type</label> |
128 |
<select name="Test Type" id="test_part_${test_part.partid}_test_type"> |
|
1099.1.217
by Nick Chadwick
working on making the exercise editor complete |
129 |
<py:for each="test_type in test_types"> |
130 |
<option py:if="test_type==test_part.test_type" selected="selected" value="${test_type}">${test_type}</option> |
|
131 |
<option py:if="test_type!=test_part.test_type" value="${test_type}">${test_type}</option> |
|
132 |
</py:for> |
|
133 |
</select> |
|
1099.7.40
by William Grant
Move the test case part delete button to the end. |
134 |
<iw:delete action="delete_testpart('${test_part.partid}','${test_case.testid}','${test_suite.suiteid}')" /> |
1099.7.14
by William Grant
Template out bits of the TestCasePart editor. |
135 |
<iw:textarea name="data" desc="Test" rows="2" cols="80">${test_part.data}</iw:textarea> |
136 |
<iw:text name="file" desc="Filename">${test_part.filename}</iw:text> |
|
1099.7.11
by William Grant
Turn all of the exercise editor's submit inputs into buttons, drop some |
137 |
<input type="button" value="Save Part" onclick="edit_test_part('${test_part.partid}', '${test_case.testid}', ${test_suite.suiteid})" /> |
1099.7.13
by William Grant
Move test case parts into <li>s, and indent their content. |
138 |
</li> |
1099.7.38
by William Grant
Template bits of the test case part addition form. |
139 |
<li py:with="iw_prefix='test_part_new'"> |
1099.7.37
by William Grant
Move the new test case part form into the list. |
140 |
<a onclick="tog('new_test_part_${test_case.testid}')">New test case part</a> |
141 |
<div class="add_new_part" id="new_test_part_${test_case.testid}"> |
|
1099.7.38
by William Grant
Template bits of the test case part addition form. |
142 |
<label for="test_part_new_part_type_${test_case.testid}">Part Type:</label> |
143 |
<select name="Part Type" id="test_part_new_part_type_${test_case.testid}"> |
|
1099.7.37
by William Grant
Move the new test case part form into the list. |
144 |
<py:for each="part_type in part_types"> |
145 |
<option value="${part_type}">${part_type}</option> |
|
146 |
</py:for> |
|
147 |
</select> |
|
1099.7.38
by William Grant
Template bits of the test case part addition form. |
148 |
<label for="test_part_new_test_type_${test_case.testid}">Test Type:</label> |
149 |
<select name="Test Type" id="test_part_new_test_type_${test_case.testid}"> |
|
1099.7.37
by William Grant
Move the new test case part form into the list. |
150 |
<py:for each="test_type in test_types"> |
151 |
<option value="${test_type}">${test_type}</option> |
|
152 |
</py:for> |
|
153 |
</select> |
|
1099.7.38
by William Grant
Template bits of the test case part addition form. |
154 |
<iw:textarea name="data" desc="Test" rows="2" cols="80" /> |
155 |
<iw:text name="file" desc="Filename" /> |
|
1099.7.37
by William Grant
Move the new test case part form into the list. |
156 |
<input type="button" value="Create Part" onclick="add_test_part('${test_case.testid}', '${test_suite.suiteid}')" id="new_test_part_save_${test_case.testid}" /> |
157 |
</div> |
|
158 |
</li> |
|
1099.7.13
by William Grant
Move test case parts into <li>s, and indent their content. |
159 |
</ul> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
160 |
</div> |
161 |
</li> |
|
162 |
</py:for> |
|
1099.7.31
by William Grant
Also fade new test cases. |
163 |
<li class="new"> |
1099.7.32
by William Grant
Turn the test case addition form into something rather more like the edit form. |
164 |
<h5><a onclick="tog('new_test_case_${test_suite.suiteid}')">New test case</a></h5> |
1099.7.9
by William Grant
Test case addition/editing widgets are templated. |
165 |
<div py:with="iw_prefix='new_test_case_%d' % (test_suite.suiteid)" |
1099.7.32
by William Grant
Turn the test case addition form into something rather more like the edit form. |
166 |
class="test_case" id="${iw_prefix}"> |
1099.7.16
by William Grant
Redo the new test case stuff to show and hide well. |
167 |
<iw:text name="pass" desc="Pass Message" /> |
168 |
<iw:text name="fail" desc="Fail Message" /> |
|
169 |
<iw:text name="default" desc="Default Mode" /> |
|
170 |
<input type="button" value="Create Case" onclick="add_test_case('${test_suite.suiteid}')" /> |
|
1099.1.221
by Nick Chadwick
added in extra parts to the exercise edit view. Now almost all |
171 |
</div> |
172 |
</li> |
|
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
173 |
</ul> |
174 |
</div> |
|
175 |
||
176 |
</div> |
|
177 |
</li> |
|
178 |
</py:for> |
|
1099.7.29
by William Grant
Redo the suite addition form in a manner much more like the suite edit form. |
179 |
<li class="new"> |
180 |
<h3><a onclick="tog('suite_data_new')">New test suite</a></h3> |
|
181 |
<div class="testsuite" id="suite_data_new"> |
|
182 |
<div class="test_suite_vals" py:with="iw_prefix='new_test_suite'"> |
|
1099.7.7
by William Grant
Start a trial of templating out widgets in the exercise editor. |
183 |
<iw:textarea name="description" desc="Description" cols="80" rows="1" /> |
184 |
<iw:textarea name="function" desc="Function" cols="80" rows="1" /> |
|
185 |
<iw:textarea name="stdin" desc="Stdin" cols="80" rows="4" /> |
|
1099.7.11
by William Grant
Turn all of the exercise editor's submit inputs into buttons, drop some |
186 |
<input type="button" value="Create Suite" onclick="add_suite()" /> |
1099.7.2
by William Grant
Move the test suite creation stuff into the suite <ul>. |
187 |
</div> |
1099.7.29
by William Grant
Redo the suite addition form in a manner much more like the suite edit form. |
188 |
</div> |
1099.7.2
by William Grant
Move the test suite creation stuff into the suite <ul>. |
189 |
</li> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
190 |
</ul> |
1099.1.228
by Nick Chadwick
Merged from trunk. |
191 |
|
192 |
<p><a href="/+exercises">Back To Exercise Listing</a></p> |
|
193 |
||
1099.1.212
by Nick Chadwick
Added a new page to display exercises. This will then be modified to |
194 |
</div> |
1099.1.213
by Nick Chadwick
Modifief exercise view, so that exercises can now be viewed in an |
195 |
|
1099.1.212
by Nick Chadwick
Added a new page to display exercises. This will then be modified to |
196 |
</body> |
197 |
</html> |