Skip to content

Commit d823e77

Browse files
committed
more logging action
1 parent cb50de9 commit d823e77

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,10 +1286,16 @@ function executePythonCode(pythonSourceCode,
12861286
var obj = {type: 'updateOutput', step: args.myViz.curInstr,
12871287
curline: args.myViz.curLineNumber,
12881288
prevline: args.myViz.prevLineNumber};
1289-
// optional field
1290-
if (args.myViz.curLineExceptionMsg !== undefined) {
1289+
// optional fields
1290+
if (args.myViz.curLineExceptionMsg) {
12911291
obj.exception = args.myViz.curLineExceptionMsg;
12921292
}
1293+
if (args.myViz.curLineIsReturn) {
1294+
obj.curLineIsReturn = true;
1295+
}
1296+
if (args.myViz.prevLineIsReturn) {
1297+
obj.prevLineIsReturn = true;
1298+
}
12931299
logEvent(obj);
12941300
});
12951301

@@ -1896,6 +1902,7 @@ display a brief "Thanks!" note]
18961902

18971903
// using socket.io:
18981904
function logEvent(obj) {
1905+
//console.log(obj);
18991906
if (loggingSocketIO) {
19001907
if (supports_html5_storage()) {
19011908
obj.user_uuid = localStorage.getItem('opt_uuid');

‎v3/js/pytutor.js‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,8 +1427,12 @@ ExecutionVisualizer.prototype.updateOutputFull = function(smoothTransition) {
14271427
return;
14281428
}
14291429

1430-
myViz.curLineExceptionMsg = undefined; // reset!
1431-
1430+
// reset
1431+
myViz.curLineNumber = undefined;
1432+
myViz.prevLineNumber = undefined;
1433+
myViz.curLineIsReturn = undefined;
1434+
myViz.prevLineIsReturn = undefined;
1435+
myViz.curLineExceptionMsg = undefined;
14321436

14331437
// really nitpicky!!! gets the difference in width between the code display
14341438
// and the maximum width of its enclosing div
@@ -1853,17 +1857,15 @@ ExecutionVisualizer.prototype.updateOutputFull = function(smoothTransition) {
18531857
// add these fields to myViz
18541858
myViz.curLineNumber = curLineNumber;
18551859
myViz.prevLineNumber = prevLineNumber;
1860+
myViz.curLineIsReturn = curIsReturn;
1861+
myViz.prevLineIsReturn = prevIsReturn;
18561862

18571863
} // end of highlightCodeLine
18581864

18591865

18601866
// render code output:
18611867
if (curEntry.line) {
18621868
highlightCodeLine();
1863-
} else {
1864-
// reset
1865-
myViz.curLineNumber = undefined;
1866-
myViz.prevLineNumber = undefined;
18671869
}
18681870

18691871
// render stdout:

0 commit comments

Comments
 (0)