Skip to content

Commit c40da97

Browse files
committed
added curLineNumber and prevLineNumber to log
1 parent aa0a2a9 commit c40da97

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎v3/js/opt-frontend-common.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,9 @@ function executePythonCode(pythonSourceCode,
12791279

12801280
// debounce to compress a bit ... 250ms feels "right"
12811281
$.doTimeout('updateOutputLogEvent', 250, function() {
1282-
logEvent({type: 'updateOutput', step: args.myViz.curInstr});
1282+
logEvent({type: 'updateOutput', step: args.myViz.curInstr,
1283+
curline: args.myViz.curLineNumber,
1284+
prevline: args.myViz.prevLineNumber});
12831285
});
12841286

12851287
// 2014-05-25: implemented more detailed tracing for surveys

‎v3/js/pytutor.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,12 +1847,20 @@ ExecutionVisualizer.prototype.updateOutputFull = function(smoothTransition) {
18471847
scrollCodeOutputToLine(curEntry.line);
18481848
}
18491849

1850+
// add these fields to myViz
1851+
myViz.curLineNumber = curLineNumber;
1852+
myViz.prevLineNumber = prevLineNumber;
1853+
18501854
} // end of highlightCodeLine
18511855

18521856

18531857
// render code output:
18541858
if (curEntry.line) {
18551859
highlightCodeLine();
1860+
} else {
1861+
// reset
1862+
myViz.curLineNumber = undefined;
1863+
myViz.prevLineNumber = undefined;
18561864
}
18571865

18581866
// render stdout:

0 commit comments

Comments
 (0)