Skip to content

Commit 4a9dc74

Browse files
committed
still a mess
1 parent f85ab3f commit 4a9dc74

2 files changed

Lines changed: 11 additions & 12 deletions

File tree

‎v5-unity/js/opt-frontend-common.ts‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,6 @@ export abstract class AbstractBaseFrontend {
131131
}
132132
*/
133133

134-
if (params.appStateAugmenter) {
135-
this.appStateAugmenter = params.appStateAugmenter;
136-
}
137-
if (params.loadTestCases) {
138-
this.loadTestCases = params.loadTestCases;
139-
}
140-
141134
// register a generic AJAX error handler
142135
$(document).ajaxError(function(evt, jqxhr, settings, exception) {
143136
// ignore errors related to togetherjs stuff:
@@ -237,8 +230,8 @@ export abstract class AbstractBaseFrontend {
237230

238231
abstract executeCode(forceStartingInstr?: number, forceRawInputLst?: string[]) : any;
239232
abstract handleUncaughtExceptionFunc(trace: any[]) : any;
240-
appStateAugmenter(appState) { } // NOP
241-
loadTestCases(testCasesLst) { } // NOP
233+
appStateAugmenter: (appState) => {} // NOP
234+
loadTestCases: (testCasesLst) => {} // NOP
242235

243236
setFronendError(lines) {
244237
$("#frontendErrorOutput").html(lines.map(pytutor.htmlspecialchars).join('<br/>'));

‎v5-unity/js/opt-frontend.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
1414
[probably do this in the FRONTEND and not in pytutor.js]
1515
16+
- make sure the add test cases feature still works
17+
1618
- qtip doesn't work with Webpack, so experimentalPopUpSyntaxErrorSurvey
1719
DOESN'T WORK deactivate it for now
1820
- reinstate SyntaxErrorSurveyBubble later from cruft/syntax-error-bubble.js
@@ -270,9 +272,15 @@ class OptFrontend extends AbstractBaseFrontend {
270272
originFrontendJsFile: string = 'opt-frontend.js';
271273
pyInputAceEditor; // Ace editor object that contains the input code
272274

275+
appStateAugmenter;
276+
loadTestCases;
277+
273278
constructor(params) {
274279
super(params);
275280

281+
this.appStateAugmenter = optTests.appStateAugmenter;
282+
this.loadTestCases = optTests.loadTestcasesIntoPane;
283+
276284
this.initAceEditor(420);
277285
this.pyInputAceEditor.getSession().on("change", (e) => {
278286
// unfortunately, Ace doesn't detect whether a change was caused
@@ -786,7 +794,6 @@ class OptFrontend extends AbstractBaseFrontend {
786794
}
787795

788796

789-
790797
} // END class OptFrontend
791798

792799

@@ -796,8 +803,7 @@ $(document).ready(function() {
796803
TogetherjsCloseHandler: optFrontendTogetherjsCloseHandler,
797804
startSharedSession: optFrontendStartSharedSession,
798805
*/
799-
appStateAugmenter: optTests.appStateAugmenter,
800-
loadTestCases: optTests.loadTestcasesIntoPane,
806+
801807
});
802808
optFrontend.setSurveyHTML();
803809

0 commit comments

Comments
 (0)