1
<html xmlns="http://www.w3.org/1999/xhtml"
2
xmlns:py="http://genshi.edgewall.org/">
4
<title>Edit - ${exercise.name}</title>
5
<!-- These let the javascript know which worksheet is open -->
6
<script type="text/javascript">
7
exercise = '${exercise.id}';
11
<h1>Edit Exercise - ${exercise.id}</h1>
12
<div id="ivle_padding">
13
<h3>Exercise Values:</h3>
14
<label for="exercise_id">Exercise Identifier:</label>
15
<input class="textinput" type="text" id="exercise_id" value="${exercise.id}" title="Exercise Identifier" />
17
<label for="exercise_name">Exercise Name:</label>
18
<input class="textinput" type='text' id='exercise_name' value="${exercise.name}" title="Exercise Name" />
20
<label for="exercise_num_rows">Number of Rows</label>
21
<input size="5" type="text" id="exercise_num_rows" value="${exercise.num_rows}" title="Number of Rows" />
23
<label for="exercise_desc">Exercise Description (in RST):</label><br />
24
<textarea cols="80" rows="10" id="exercise_desc" title="Exercise Description">${exercise.description}</textarea>
26
<label for="exercise_partial">Exercise Partial Solution (Python):</label><br />
27
<textarea cols="80" rows="5" id="exercise_partial" title="Partial Solution">${exercise.partial}</textarea>
29
<label for="exercise_solution">Exercise Full Solution:</label><br />
30
<textarea cols="80" rows="5" id="exercise_solution" title="Solution">${exercise.solution}</textarea>
32
<label for="exercise_include">Exercise Included Code:</label><br />
33
<textarea cols="80" rows="5" id="exercise_include" title="Included Code">${exercise.include}</textarea>
35
<input type="submit" value="Save Changes" onclick="edit_exercise()" />
37
<h2>Exercise Test Suites</h2>
39
<py:for each="test_suite in exercise.test_suites">
41
<h3><a id="suite_header_${test_suite.suiteid}" onclick="tog('suite_data_${test_suite.suiteid}')">Suite ${test_suite.seq_no + 1} - ${test_suite.description}</a> <a onclick="delete_suite('${test_suite.suiteid}')"><img src="${mediapath}cross.png"/></a></h3>
43
<div class="testsuite" id="suite_data_${test_suite.suiteid}">
44
<div class="test_suite_vals">
46
<label for="test_suite_description_${test_suite.suiteid}">Description:</label> <textarea id="test_suite_description_${test_suite.suiteid}" cols="80" rows="1">${test_suite.description}</textarea>
49
<label for="test_suite_function_${test_suite.suiteid}">Function:</label> <textarea id="test_suite_function_${test_suite.suiteid}" title="Suite Function" cols="80" rows="1">${test_suite.function}</textarea>
52
<label for="test_suite_stdin_${test_suite.suiteid}">Stdin:</label> <textarea id="test_suite_stdin_${test_suite.suiteid}" title="Suite Stdin" cols="80" rows="4">${test_suite.stdin}</textarea>
55
<input type="submit" name="Save Suite" value="Save Suite" onclick="edit_suite('${test_suite.suiteid}')" />
59
<a id='variables_header_${test_suite.suiteid}' onclick="tog('variables_${test_suite.suiteid}')"><h4>Suite ${test_suite.seq_no + 1} - Variables</h4></a>
61
<div class="test_variables" id="variables_${test_suite.suiteid}">
62
<py:for each="variable in test_suite.variables">
64
<a onclick="delete_var('${variable.varid}', '${test_suite.suiteid}')"><img src="${mediapath}cross.png"/></a>
65
<label for="var_type_${variable.varid}">Type:</label>
66
<select name="Variable Type" id="var_type_${variable.varid}">
67
<py:for each="var_type in var_types">
68
<option py:if="var_type == variable.var_type" selected="selected" value="${var_type}">${var_type}</option>
69
<option py:if="var_type != variable.var_type" value="${var_type}">${var_type}</option>
72
<label for="var_name_${variable.varid}">Var Name:</label>
73
<input type="text" id="var_name_${variable.varid}" value="${variable.var_name}" />
74
<label for="var_val_${variable.varid}">Var Value:</label>
75
<input type="text" id="var_val_${variable.varid}" value="${variable.var_value}"/>
76
<label for="var_argno_${variable.varid}">Arg Num:</label>
77
<input size="5" type="text" id="var_argno_${variable.varid}" value="${variable.arg_no}" />
78
<input type="submit" value="Save" onclick="edit_var('${variable.varid}', '${test_suite.suiteid}')" />
82
<a onclick="tog('add_variable_${test_suite.suiteid}')">Add A New Variable</a>
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>
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}" />
96
<input type="submit" value="Add" onclick="add_var('${test_suite.suiteid}')" />
99
<a onclick="tog('test_cases_${test_suite.suiteid}')" id="cases_header_${test_suite.suiteid}"><h4>Suite ${test_suite.seq_no + 1} - Test Cases</h4></a>
101
<div class="test_cases" id="test_cases_${test_suite.suiteid}">
103
<py:for each="test_case in test_suite.test_cases">
105
<h5><a onclick="tog('test_case_${test_case.testid}_${test_suite.suiteid}')" id="case_header_${test_case.testid}">Test Case ${test_case.seq_no + 1}</a> <a onclick="delete_testcase('${test_case.testid}','${test_suite.suiteid}')"><img src="${mediapath}cross.png"/></a></h5>
106
<div class="test_case" id="test_case_${test_case.testid}_${test_suite.suiteid}">
107
<label for="test_case_pass_${test_case.testid}_${test_suite.suiteid}">Pass Message:</label>
108
<input class="textinput" type="text" id="test_case_pass_${test_case.testid}_${test_suite.suiteid}" value="${test_case.passmsg}" />
110
<label for="test_case_fail_${test_case.testid}_${test_suite.suiteid}">Fail Message:</label>
111
<input class="textinput" type="text" id="test_case_fail_${test_case.testid}_${test_suite.suiteid}" value="${test_case.failmsg}" />
113
<label for="test_case_default_${test_case.test_default}_${test_suite.suiteid}">Default Mode:</label>
114
<input class="textinput" type="text" id="test_case_default_${test_case.test_default}_${test_suite.suiteid}" value="${test_case.test_default}" />
116
<input type="submit" onclick="edit_test_case('${test_case.testid}','${test_suite.suiteid}')" value="Save Case" />
118
<h5>Test Case Parts</h5>
119
<div class="disabled_test_case_parts" id="test_case_parts_${test_case.testid}_${test_suite.suiteid}">
120
<py:for each="test_part in test_case.parts">
121
<a onclick="delete_testpart('${test_part.partid}','${test_case.testid}','${test_suite.suiteid}')"><img src="${mediapath}cross.png"/></a>
122
<label for="test_part_part_type_${test_part.partid}">Part Type:</label>
123
<select name="Part Type" id="test_part_part_type_${test_part.partid}">
124
<py:for each="part_type in part_types">
125
<option py:if="part_type==test_part.part_type" selected="selected" value="${part_type}">${part_type}</option>
126
<option py:if="part_type!=test_part.part_type" value="${part_type}">${part_type}</option>
129
<label for="">Test Type</label>
130
<select name="Test Type" id="test_part_test_type_${test_part.partid}">
131
<py:for each="test_type in test_types">
132
<option py:if="test_type==test_part.test_type" selected="selected" value="${test_type}">${test_type}</option>
133
<option py:if="test_type!=test_part.test_type" value="${test_type}">${test_type}</option>
137
<label for="test_part_data_${test_part.partid}">Test:</label><br />
138
<textarea id="test_part_data_${test_part.partid}" rows="2" cols="80">${test_part.data}</textarea>
140
<label for="test_part_file_${test_part.partid}">Filename:</label>
141
<input type="text" id="test_part_file_${test_part.partid}" value="${test_part.filename}" />
143
<input type="submit" value="Save Part" onclick="edit_test_part('${test_part.partid}', '${test_case.testid}', ${test_suite.suiteid})"/>
147
<a onclick="tog('new_test_part_${test_case.testid}')">Add a New part</a>
148
<div class="add_new_part" id="new_test_part_${test_case.testid}">
149
<label for="new_test_part_part_type_${test_case.testid}">Part Type:</label>
150
<select name="Part Type" id="new_test_part_part_type_${test_case.testid}">
151
<py:for each="part_type in part_types">
152
<option value="${part_type}">${part_type}</option>
156
<label>Test Type:</label>
157
<select name="Test Type" id="new_test_part_test_type_${test_case.testid}">
158
<py:for each="test_type in test_types">
159
<option value="${test_type}">${test_type}</option>
164
<textarea id="new_test_part_data_${test_case.testid}" rows="2" cols="80"></textarea>
166
<label>Filename:</label>
167
<input type="text" id="new_test_part_file_${test_case.testid}"/>
169
<input type="submit" value="Add Part" onclick="add_test_part('${test_case.testid}', '${test_suite.suiteid}')" id="new_test_part_save_${test_case.testid}" />
175
<a onclick="tog('new_test_part_${test_suite.suiteid}')"><h5>Add A New Test Case</h5></a>
176
<div class="add_new_part" id="new_test_part_${test_suite.suiteid}">
177
<label for="new_test_case_pass_${test_suite.suiteid}">Pass Message:</label>
178
<input class="textinput" type="text" id="new_test_case_pass_${test_suite.suiteid}" />
180
<label for="new_test_case_fail_${test_suite.suiteid}">Fail Message:</label>
181
<input class="textinput" type="text" id="new_test_case_fail_${test_suite.suiteid}" />
183
<label for="new_test_case_default_${test_suite.suiteid}">Default Mode:</label>
184
<input class="textinput" type="text" value="ignore" id="new_test_case_default_${test_suite.suiteid}" />
186
<input type="submit" value="Add Case" onclick="add_test_case('${test_suite.suiteid}')" />
196
<a onclick="tog('add_suite')">Add A New Test Suite</a>
198
<div id="add_suite" class="test_suite_vals">
200
<label for="new_test_suite_description">Description:</label> <textarea id="new_test_suite_description" cols="80" rows="1"></textarea>
203
<label for="new_test_suite_function">Function:</label> <textarea id="new_test_suite_function" title="Suite Function" cols="80" rows="1"></textarea>
206
<label for="new_test_suite_stdin">Stdin:</label> <textarea id="new_test_suite_stdin" title="Suite Stdin" cols="80" rows="4"></textarea>
208
<input type='submit' name='Submit' onclick='add_suite()' value="Add Suite" />
211
<p><a href="/+exercises">Back To Exercise Listing</a></p>