1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/">
<head>
<title>Edit - ${exercise.name}</title>
<!-- These let the javascript know which worksheet is open -->
<script type="text/javascript">
</script>
</head>
<body>
<div id="ivle_padding">
<h1>Edit Exercise - ${exercise.id}</h1>
<h2>Exercise Values:</h2>
<label for="exercise_id">Exercise Identifier:</label>
<input class="textinput" type="text" id="exercise_id" value="${exercise.id}" title="Exercise Identifier" />
<br />
<label for="exercise_name">Exercise Name:</label>
<input class="textinput" type='text' id='exercise_name' value="${exercise.name}" title="Exercise Name" />
<br />
<label for="exercise_num_rows">Number of Rows</label>
<input size="5" type="text" id="exercise_num_rows" value="${exercise.num_rows}" title="Number of Rows" />
<br />
<label for="exercise_desc">Exercise Description (in RST):</label><br />
<textarea cols="80" rows="10" id="exercise_desc" title="Exercise Description">${exercise.description}</textarea>
<br />
<label for="exercise_partial">Exercise Partial Solution (Python):</label><br />
<textarea cols="80" rows="5" id="exercise_partial" title="Partial Solution">${exercise.partial}</textarea>
<br />
<label for="exercise_solution">Exercise Full Solution:</label><br />
<textarea cols="80" rows="5" id="exercise_solution" title="Solution">${exercise.solution}</textarea>
<br />
<h1>Exercise Test Suites</h1>
<ul>
<py:for each="test_suite in exercise.test_suites">
<li>
<a id="suite_header_${test_suite.suiteid}" onclick="show_suite('${test_suite.suiteid}')"><h2>Suite ${test_suite.seq_no + 1} - ${test_suite.description}</h2></a>
<div class="testsuite" id="suite_data_${test_suite.suiteid}">
<label for="test_suite_description_${test_suite.suiteid}">Description:</label><br />
<textarea id="test_suite_description_${test_suite.suiteid}" cols="80" rows="1">${test_suite.description}</textarea>
<br />
<label for="test_suite_function_${test_suite.suiteid}">Function:</label><br />
<textarea id="test_suite_function_${test_suite.suiteid}" title="Suite Function" cols="80" rows="1">${test_suite.function}</textarea>
<br />
<label for="test_suite_stdin_${test_suite.suiteid}">Stdin:</label><br />
<textarea id="test_suite_stdin_${test_suite.suiteid}" title="Suite Stdin" cols="80" rows="4">${test_suite.stdin}</textarea>
<br />
<a id='variables_header_${test_suite.suiteid}' onclick="show_variables('${test_suite.suiteid}')"><h3>Suite ${test_suite.seq_no + 1} - Variables</h3></a>
<div class="test_variables" id="variables_${test_suite.suiteid}">
<py:for each="variable in test_suite.variables">
<span>
<label for="var_type_${variable.varid}">Type:</label>
<select name="Variable Type" id="var_type_${variable.varid}">
<py:for each="var_type in var_types">
<option py:if="var_type == variable.var_type" selected="selected" value="var_type">${var_type}</option>
<option py:if="var_type != variable.var_type" value="var_type">${var_type}</option>
</py:for>
</select>
<label for="var_name_${variable.varid}">Var Name:</label>
<input type="text" id="var_name_${variable.varid}" value="${variable.var_name}" />
<label for="var_val_${variable.varid}">Var Value:</label>
<input type="text" id="var_val_${variable.varid}" value="${variable.var_value}"/>
<label for="var_argno_${variable.varid}">Arg Num:</label>
<input size="5" type="text" id="var_argno_${variable.varid}" value="${variable.arg_no}" />
</span>
<br />
</py:for>
</div>
<a onclick="show_cases('${test_suite.suiteid}')" id="cases_header_${test_suite.suiteid}"><h3>Suite ${test_suite.seq_no + 1} - Test Cases</h3></a>
<div class="test_cases" id="test_cases_${test_suite.suiteid}">
<ul>
<py:for each="test_case in test_suite.test_cases">
<li>
<a onclick="show_case('${test_case.testid}')" id="case_header_${test_case.testid}"><h4>Test Case ${test_case.seq_no}</h4></a>
<div class="test_case" id="test_case_${test_case.testid}">
<label for="test_case_pass_${test_case.testid}">Pass Message:</label>
<input class="textinput" type="text" id="test_case_${test_case.testid}" value="${test_case.passmsg}" />
<br />
<label for="test_case_fail_${test_case.testid}">Fail Message:</label>
<input class="textinput" type="text" id="test_case_fail_${test_case.testid}" value="${test_case.failmsg}" />
<br />
<label for="test_case_default_${test_case.test_default}">Default Mode:</label>
<input class="textinput" type="text" id="test_case_default_${test_case.test_default}" value="${test_case.test_default}" />
<h5>Test Case Parts</h5>
<py:for each="test_part in test_case.parts">
<label for="test_part_part_type_${test_part.partid}">Part Type:</label>
<select name="Part Type" id="test_part_part_type_${test_part.partid}">
<py:for each="part_type in part_types">
<option py:if="part_type==test_part.part_type" selected="selected" value="${part_type}">${part_type}</option>
<option py:if="part_type!=test_part.part_type" value="${part_type}">${part_type}</option>
</py:for>
</select>
<label for="">Test Type</label>
<select name="Test Type" id="test_part_test_type_${test_part.partid}">
<py:for each="test_type in test_types">
<option py:if="test_type==test_part.test_type" selected="selected" value="${test_type}">${test_type}</option>
<option py:if="test_type!=test_part.test_type" value="${test_type}">${test_type}</option>
</py:for>
</select>
<br />
<label for="test_part_data_${test_part.partid}">Test:</label><br />
<textarea id="test_part_data_${test_part.partid}" rows="2" cols="80">${test_part.data}</textarea>
<br />
<label for="test_part_file_${test_part.partid}">Filename:</label>
<input type="text" id="test_part_file_${test_part.partid}" value="${test_part.filename}" />
</py:for>
</div>
</li>
</py:for>
</ul>
</div>
</div>
</li>
</py:for>
</ul>
</div>
</body>
</html>
|