-
Notifications
You must be signed in to change notification settings - Fork 926
/
question.html
215 lines (140 loc) · 5.25 KB
/
question.html
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
Online Python Tutor
Copyright (C) 2010-2011 Philip J. Guo (philip@pgbovine.net)
https://github.com/pgbovine/OnlinePythonTutor/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<head>
<title>Online Python Tutor: Practice Questions</title>
<!-- jQuery 1.6.0 -->
<!-- local version for offline testing -->
<script type="text/javascript" src="jquery.min.js"></script>
<!-- online version hosted by Google -->
<!--
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
-->
<script type="text/javascript" src="hunt-mcilroy.js"></script>
<script type="text/javascript" src="jquery.ba-bbq.min.js"></script>
<script type="text/javascript" src="jquery.textarea.js"></script>
<!-- jsPlumb library for rendering connectors -->
<script type="text/javascript" src="jquery.jsPlumb-1.3.3-all-min.js "></script>
<!-- my own code -->
<script type="text/javascript" src="edu-python.js"></script>
<script type="text/javascript" src="edu-python-questions.js"></script>
<link rel="stylesheet" href="edu-python.css" type="text/css"/>
</head>
<body>
<center>
<div id="questionsHeaderPane">
<div class="questionsHeaderTitle" id="ProblemName">Please load a question ...</div>
<div class="questionsHeaderStmt" id="ProblemStatement"></div>
<div class="questionsHeaderStmt" id="HintStatement"><a href="#" id="showHintHref">Show hint</a></div>
<div class="questionsHeaderStmt" id="SolutionStatement"><a href="#" id="showSolutionHref">Show solution</a></div>
</div>
</center>
<div id="pyInputPane">
<p/>Write your solution code here:<br/>
<textarea class="codeInputPane" id="actualCodeInput" cols="60" rows="15" wrap="off">
</textarea>
<p/>Write your test code here:<br/>
<textarea class="codeInputPane" id="testCodeInput" cols="60" rows="3" wrap="off">
</textarea>
<p>
<button id="executeBtn" class="bigBtn" type="button">Visualize execution</button>
</div>
<table border="0" id="pyOutputPane">
<tr>
<td valign="top">
<center>
<div id="pyCodeOutputDiv">
Use <b>left</b> and <b>right</b> arrow keys to step through this code:
<table id="pyCodeOutput"></table>
</div>
<div id="editCodeLinkDiv">
<button id="editBtn" class="medBtn" type="button">Edit code</button>
<span style="margin-left: 7px;"/>
<button id="submitBtn" class="medBtn" type="button">Submit answer</button>
</div>
<div id="vcrControls">
<button id="jmpFirstInstr", type="button"><< First</button>
<button id="jmpStepBack", type="button">< Back</button>
<span id="curInstr">Step ? of ?</span>
<button id="jmpStepFwd", type="button">Forward ></button>
<button id="jmpLastInstr", type="button">Last >></button>
</div>
<div id="errorOutput"></div>
</center>
Program output:
<br/>
<textarea id="pyStdout" cols="50" rows="13" wrap="off" readonly></textarea>
</td>
<td valign="top">
<div id="dataViz"></div>
</td>
</tr>
</table>
<div id="pyGradingPane">
<center>
<div id="submittedSolutionDisplay">
<pre id="submittedCodePRE"></pre>
<div id="gradeSummary"></div>
</div>
<table id="gradeMatrix">
<thead>
<tr>
<td>Input</td>
<td>Result</td>
<td class="statusCell">Status</td>
<td></td>
</tr>
</thead>
<tbody id="gradeMatrixTbody">
</tbody>
</table>
</center>
</div>
<center>
<div id="footer">
<input type="checkbox" id="classicModeCheckbox"/> Use low-bandwidth mode (for older browsers)
<p><a href="tutor.html">Write Python code and visualize execution</a></p>
<p>
Solve:
<a href="question.html?two-sum">Two-sum</a> |
<a href="question.html?reverse">Reverse list</a> |
<a href="question.html?remove-dups">Remove duplicate chars</a>
<br/>Debug:
<a href="question.html?debug-ireverse">In-place reverse</a> |
<a href="question.html?debug-bsearch">Binary search</a> |
<a href="question.html?debug-mergesort">Mergesort</a>
<br/>Optimize:
<a href="question.html?optimize-sum">Greatest sum</a> |
<a href="question.html?optimize-find-dups">Find duplicates</a> |
<a href="question.html?optimize-search">List search</a>
</p>
<p/>
This application supports the core <a
href="http://www.python.org/doc/2.5/">Python 2.5</a> language, with no
module imports or file I/O. It's meant to be used as a platform for
creating programming tutorials, not for running or debugging
production code.
<p style="margin-top: 8px;"/>
Check out the <a
href="https://github.com/pgbovine/OnlinePythonTutor/">GitHub</a>
repository and send bug reports, feedback, and suggestions to philip@pgbovine.net
<p style="margin-top: 8px;"/>
Copyright © 2010-2011 <a href="http://www.stanford.edu/~pgbovine/">Philip Guo</a>. All rights reserved.
</div>
</center>
</body>
</html>