Skip to content

Commit 85e0414

Browse files
pgbovinemmmicedcoffee
authored andcommitted
bleh
1 parent 369b4c6 commit 85e0414

File tree

4 files changed

+40
-13
lines changed

4 files changed

+40
-13
lines changed

v3/css/matrixtutor.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@
88
font-size: 12pt;
99
border: 1px solid #ddd;
1010
}
11+
12+
#gradingPane {
13+
margin-top: 20px;
14+
margin-bottom: 20px;
15+
16+
max-width: 700px;
17+
/* center align */
18+
margin-left: auto;
19+
margin-right: auto;
20+
}
21+

v3/js/matrixtutor.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ var preseededCurInstr = null; // if you passed in a 'curInstr=<number>' in the U
4343

4444
var myVisualizer = null; // singleton ExecutionVisualizer instance
4545

46+
var VIZ_LABEL = "Run and Visualize Code";
47+
4648

4749
function enterEditMode() {
4850
$.bbq.pushState({ mode: 'edit' }, 2 /* completely override other hash strings to keep URL clean */);
@@ -58,7 +60,7 @@ var pyTestInputCodeMirror; // CodeMirror object that contains the test code
5860

5961
$(document).ready(function() {
6062

61-
$("#embedLinkDiv").hide();
63+
$("#embedLinkDiv,#gradingPane,#pyOutputPane").hide();
6264

6365
pyInputCodeMirror = CodeMirror(document.getElementById('codeInputPane'), {
6466
mode: 'python',
@@ -88,7 +90,7 @@ $(document).ready(function() {
8890

8991
if (appMode === undefined || appMode == 'edit') {
9092
$("#pyInputPane").show();
91-
$("#pyOutputPane").hide();
93+
$("#pyOutputPane,#gradingPane").hide();
9294
$("#embedLinkDiv").hide();
9395

9496
// destroy all annotation bubbles (NB: kludgy)
@@ -98,11 +100,10 @@ $(document).ready(function() {
98100
}
99101
else if (appMode == 'display') {
100102
$("#pyInputPane").hide();
101-
$("#pyOutputPane").show();
102-
103+
$("#pyOutputPane,#gradingPane").show();
103104
$("#embedLinkDiv").show();
104105

105-
$('#executeBtn').html("Visualize Execution");
106+
$('#executeBtn').html(VIZ_LABEL);
106107
$('#executeBtn').attr('disabled', false);
107108

108109

@@ -118,7 +119,7 @@ $(document).ready(function() {
118119
}
119120
else if (appMode == 'display_no_frills') {
120121
$("#pyInputPane").hide();
121-
$("#pyOutputPane").show();
122+
$("#pyOutputPane,#gradingPane").show();
122123
$("#embedLinkDiv").show();
123124
}
124125
else {
@@ -138,7 +139,7 @@ $(document).ready(function() {
138139

139140
$('#executeBtn').html("Please wait ... processing your code");
140141
$('#executeBtn').attr('disabled', true);
141-
$("#pyOutputPane").hide();
142+
$("#pyOutputPane,#gradingPane").hide();
142143
$("#embedLinkDiv").hide();
143144

144145
var backendOptionsObj = {cumulative_mode: ($('#cumulativeModeSelector').val() == 'true'),
@@ -176,7 +177,6 @@ $(document).ready(function() {
176177
});
177178
}
178179
else {
179-
console.log('wtf?', errorLineNo, nCodeLines);
180180
// instead highlight the faulting line in pyTestInputCodeMirror
181181
errorLineNo -= nCodeLines;
182182

@@ -191,7 +191,7 @@ $(document).ready(function() {
191191
}
192192
}
193193

194-
$('#executeBtn').html("Visualize Execution");
194+
$('#executeBtn').html(VIZ_LABEL);
195195
$('#executeBtn').attr('disabled', false);
196196
}
197197
}
@@ -251,7 +251,7 @@ $(document).ready(function() {
251251
"Report a bug to philip@pgbovine.net\n\n" +
252252
"(Click the 'Generate URL' button to include a unique URL in your email bug report.)");
253253

254-
$('#executeBtn').html("Visualize Execution");
254+
$('#executeBtn').html(VIZ_LABEL);
255255
$('#executeBtn').attr('disabled', false);
256256
});
257257

v3/matrix-demo/python_comprehension-1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ def increments(L):
66
- a list where the elements in L were incremented by 1
77
Example:
88
>>> increments([1,4,6])
9-
[2,5,7]
9+
[2, 5, 7]
1010
'''
1111
pass

v3/matrixtutor.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
-->
3131

3232
<head>
33-
<title>Online Python Tutor - Visualize program execution</title>
33+
<title>Python Visualizer - Coding The Matrix</title>
3434

3535
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
3636

@@ -69,6 +69,8 @@
6969

7070
<div id="pyInputPane">
7171

72+
<h1 style="margin-bottom: 25px; font-size: 16pt;">Problem: python_comprehension-1</h1>
73+
7274
Write your solution code here (will be submitted for grading):
7375
<br/>
7476
<div id="codeInputPane"></div> <!-- populate with a CodeMirror instance -->
@@ -78,7 +80,7 @@
7880
<div id="testInputPane"></div> <!-- populate with a CodeMirror instance -->
7981

8082
<p>
81-
<button id="executeBtn" class="bigBtn" type="button">Visualize Execution</button>
83+
<button id="executeBtn" class="bigBtn" type="button">Run and Visualize Code</button>
8284
</p>
8385

8486
</div>
@@ -87,6 +89,20 @@
8789
<div id="pyOutputPane">
8890
</div>
8991

92+
<div id="gradingPane">
93+
94+
95+
<h1 style="margin-bottom: 15px; font-size: 14pt;">Problem: python_comprehension-1</h1>
96+
97+
<p>
98+
<button id="submitGradeBtn" class="bigBtn" type="button">Submit for Grading</button>
99+
</p>
100+
101+
<pre id="gradeResultsPane">
102+
</pre>
103+
104+
</div>
105+
90106
<div id="footer">
91107

92108
This version of <a href="http://pythontutor.com/">Online Python Tutor</a> supports

0 commit comments

Comments
 (0)