Skip to content

Commit 5812721

Browse files
NhatMinh0208RichDom2185martin-henzsayomaki
authored
Rename to CS1101S terms (#2744)
* rename "ec-evaluator" to "cse-machine" * bumping js-slang * rename Agenda to Control * rename Agenda to Control (2) * Replace "an" with "a" article Also reorganized imports. --------- Co-authored-by: Richard Dominick <[email protected]> Co-authored-by: Martin Henz <[email protected]> Co-authored-by: sayomaki <[email protected]>
1 parent 71ecf58 commit 5812721

24 files changed

+300
-296
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"flexboxgrid": "^6.3.1",
4949
"flexboxgrid-helpers": "^1.1.3",
5050
"hastscript": "^9.0.0",
51-
"js-slang": "^1.0.37",
51+
"js-slang": "^1.0.38",
5252
"js-yaml": "^4.1.0",
5353
"konva": "^9.2.0",
5454
"lodash": "^4.17.21",

public/externalLibs/inspector/inspector.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929
}
3030
}
3131

32-
function highlightCleanForAgenda() {
32+
function highlightCleanForControl() {
3333
var gutterCells = document.getElementsByClassName('ace_gutter-cell');
3434
var aceLines = document.getElementsByClassName('ace_line');
3535
if (gutterCells != undefined) {
3636
for (cell of gutterCells) {
37-
cell.classList.remove('ace_gutter-cell_hi_agenda');
37+
cell.classList.remove('ace_gutter-cell_hi_control');
3838
}
3939
}
4040
if (aceLines != undefined) {
4141
for (line of aceLines) {
42-
line.classList.remove('ace_line_hi_agenda');
42+
line.classList.remove('ace_line_hi_control');
4343
}
4444
}
4545
}
4646

47-
function highlightLineForAgenda(number) {
47+
function highlightLineForControl(number) {
4848
if (number == undefined) return;
4949
var gutterCells = document.getElementsByClassName('ace_gutter-cell');
5050
var aceLines = document.getElementsByClassName('ace_line');
@@ -61,16 +61,16 @@
6161
}
6262
}
6363

64-
gutterCells[number].classList.add('ace_gutter-cell_hi_agenda');
65-
aceLines[number].classList.add('ace_line_hi_agenda');
64+
gutterCells[number].classList.add('ace_gutter-cell_hi_control');
65+
aceLines[number].classList.add('ace_line_hi_control');
6666
}
6767
}
6868

6969
exports.Inspector = {
7070
highlightLine,
7171
highlightClean,
72-
highlightCleanForAgenda,
73-
highlightLineForAgenda
72+
highlightCleanForControl,
73+
highlightLineForControl
7474
};
7575
setTimeout(() => {}, 1000);
7676
})(window);

src/commons/application/types/InterpreterTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export const END_DEBUG_PAUSE = 'END_DEBUG_PAUSE';
1010
export const DEBUG_RESUME = 'DEBUG_RESUME';
1111
export const DEBUG_RESET = 'DEBUG_RESET';
1212
export const UPDATE_EDITOR_HIGHLIGHTED_LINES = 'UPDATE_EDITOR_HIGHLIGHTED_LINES';
13-
export const UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA = 'UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA';
13+
export const UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL = 'UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL';

src/commons/mocks/ContextMocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function mockRuntimeContext(): Context {
3434
range: [0, 1]
3535
}
3636
],
37-
agenda: null,
37+
control: null,
3838
stash: null,
3939
envStepsTotal: 0,
4040
breakpointSteps: []

src/commons/sagas/WorkspaceSaga.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
DEBUG_RESET,
4242
DEBUG_RESUME,
4343
UPDATE_EDITOR_HIGHLIGHTED_LINES,
44-
UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA
44+
UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL
4545
} from '../application/types/InterpreterTypes';
4646
import { Library, Testcase, TestcaseType, TestcaseTypes } from '../assessment/AssessmentTypes';
4747
import { Documentation } from '../documentation/Documentation';
@@ -55,9 +55,9 @@ import {
5555
getRestoreExtraMethodsString,
5656
getStoreExtraMethodsString,
5757
highlightClean,
58-
highlightCleanForAgenda,
58+
highlightCleanForControl,
5959
highlightLine,
60-
highlightLineForAgenda,
60+
highlightLineForControl,
6161
makeElevatedContext,
6262
visualizeEnv
6363
} from '../utils/JsSlangHelper';
@@ -388,16 +388,16 @@ export default function* WorkspaceSaga(): SagaIterator {
388388
);
389389

390390
yield takeEvery(
391-
UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA,
391+
UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL,
392392
function* (action: ReturnType<typeof actions.setEditorHighlightedLines>) {
393393
const newHighlightedLines = action.payload.newHighlightedLines;
394394
if (newHighlightedLines.length === 0) {
395-
highlightCleanForAgenda();
395+
highlightCleanForControl();
396396
} else {
397397
try {
398398
newHighlightedLines.forEach(([startRow, endRow]: [number, number]) => {
399399
for (let row = startRow; row <= endRow; row++) {
400-
highlightLineForAgenda(row);
400+
highlightLineForControl(row);
401401
}
402402
});
403403
} catch (e) {
@@ -1093,7 +1093,7 @@ export function* evalCode(
10931093
: -1;
10941094
const envActiveAndCorrectChapter = context.chapter >= 3 && envIsActive;
10951095
if (envActiveAndCorrectChapter) {
1096-
context.executionMethod = 'ec-evaluator';
1096+
context.executionMethod = 'cse-machine';
10971097
}
10981098

10991099
const isFolderModeEnabled: boolean = yield select(
@@ -1284,15 +1284,15 @@ export function* evalCode(
12841284

12851285
// The first time the code is executed using the explicit control evaluator,
12861286
// the total number of steps and the breakpoints are updated in the Environment Visualiser slider.
1287-
if (context.executionMethod === 'ec-evaluator' && needUpdateEnv) {
1287+
if (context.executionMethod === 'cse-machine' && needUpdateEnv) {
12881288
yield put(actions.updateEnvStepsTotal(context.runtime.envStepsTotal, workspaceLocation));
12891289
// `needUpdateEnv` implies `correctWorkspace`, which satisfies the type constraint.
12901290
// But TS can't infer that yet, so we need a typecast here.
12911291
yield put(actions.toggleUpdateEnv(false, workspaceLocation as any));
12921292
yield put(actions.updateBreakpointSteps(context.runtime.breakpointSteps, workspaceLocation));
12931293
}
12941294
// Stop the home icon from flashing for an error if it is doing so since the evaluation is successful
1295-
if (context.executionMethod === 'ec-evaluator' || context.executionMethod === 'interpreter') {
1295+
if (context.executionMethod === 'cse-machine' || context.executionMethod === 'interpreter') {
12961296
const introIcon = document.getElementById(SideContentType.introduction + '-icon');
12971297
introIcon && introIcon.classList.remove('side-content-tab-alert-error');
12981298
}

src/commons/sideContent/SideContentEnvVisualizer.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Layout } from 'src/features/envVisualizer/EnvVisualizerLayout';
2020
import { OverallState } from '../application/ApplicationTypes';
2121
import { HighlightedLines } from '../editor/EditorTypes';
2222
import Constants, { Links } from '../utils/Constants';
23-
import { setEditorHighlightedLinesAgenda, updateEnvSteps } from '../workspace/WorkspaceActions';
23+
import { setEditorHighlightedLinesControl, updateEnvSteps } from '../workspace/WorkspaceActions';
2424
import { evalEditor } from '../workspace/WorkspaceActions';
2525
import { WorkspaceLocation } from '../workspace/WorkspaceTypes';
2626

@@ -85,8 +85,8 @@ class SideContentEnvVisualizer extends React.Component<EnvVisualizerProps, State
8585
// This comment is copied over from workspace saga
8686
props.setEditorHighlightedLines(props.workspaceLocation, 0, segments);
8787
},
88-
isAgendaEmpty => {
89-
this.setState({ stepLimitExceeded: !isAgendaEmpty && this.state.lastStep });
88+
isControlEmpty => {
89+
this.setState({ stepLimitExceeded: !isControlEmpty && this.state.lastStep });
9090
}
9191
);
9292
}
@@ -201,34 +201,34 @@ class SideContentEnvVisualizer extends React.Component<EnvVisualizerProps, State
201201
<AnchorButton
202202
onMouseUp={() => {
203203
if (this.state.visualization && EnvVisualizer.getCompactLayout()) {
204-
EnvVisualizer.toggleAgendaStash();
204+
EnvVisualizer.toggleControlStash();
205205
EnvVisualizer.redraw();
206206
}
207207
}}
208208
icon="layers"
209209
disabled={!this.state.visualization || !EnvVisualizer.getCompactLayout()}
210210
>
211211
<Checkbox
212-
checked={EnvVisualizer.getAgendaStash()}
212+
checked={EnvVisualizer.getControlStash()}
213213
disabled={!EnvVisualizer.getCompactLayout()}
214214
style={{ margin: 0 }}
215215
/>
216216
</AnchorButton>
217217
</Tooltip2>
218-
<Tooltip2 content="Truncate Agenda" compact>
218+
<Tooltip2 content="Truncate Control" compact>
219219
<AnchorButton
220220
onMouseUp={() => {
221-
if (this.state.visualization && EnvVisualizer.getAgendaStash()) {
221+
if (this.state.visualization && EnvVisualizer.getControlStash()) {
222222
EnvVisualizer.toggleStackTruncated();
223223
EnvVisualizer.redraw();
224224
}
225225
}}
226226
icon="minimize"
227-
disabled={!this.state.visualization || !EnvVisualizer.getAgendaStash()}
227+
disabled={!this.state.visualization || !EnvVisualizer.getControlStash()}
228228
>
229229
<Checkbox
230230
checked={EnvVisualizer.getStackTruncated()}
231-
disabled={!EnvVisualizer.getAgendaStash()}
231+
disabled={!EnvVisualizer.getControlStash()}
232232
style={{ margin: 0 }}
233233
/>
234234
</AnchorButton>
@@ -475,7 +475,7 @@ const mapDispatchToProps: MapDispatchToProps<DispatchProps, {}> = (dispatch: Dis
475475
workspaceLocation: WorkspaceLocation,
476476
editorTabIndex: number,
477477
newHighlightedLines: HighlightedLines[]
478-
) => setEditorHighlightedLinesAgenda(workspaceLocation, editorTabIndex, newHighlightedLines)
478+
) => setEditorHighlightedLinesControl(workspaceLocation, editorTabIndex, newHighlightedLines)
479479
},
480480
dispatch
481481
);

src/commons/utils/JsSlangHelper.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ export function highlightLine(line: number) {
114114
}
115115
}
116116

117-
export function highlightCleanForAgenda() {
117+
export function highlightCleanForControl() {
118118
if ((window as any).Inspector) {
119-
(window as any).Inspector.highlightCleanForAgenda();
119+
(window as any).Inspector.highlightCleanForControl();
120120
} else {
121121
throw new Error('Inspector not loaded');
122122
}
123123
}
124124

125-
export function highlightLineForAgenda(line: number) {
125+
export function highlightLineForControl(line: number) {
126126
if ((window as any).Inspector) {
127-
(window as any).Inspector.highlightLineForAgenda(line);
127+
(window as any).Inspector.highlightLineForControl(line);
128128
} else {
129129
throw new Error('Inspector not loaded');
130130
}

src/commons/workspace/WorkspaceActions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { SALanguage } from '../application/ApplicationTypes';
77
import { ExternalLibraryName } from '../application/types/ExternalTypes';
88
import {
99
UPDATE_EDITOR_HIGHLIGHTED_LINES,
10-
UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA
10+
UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL
1111
} from '../application/types/InterpreterTypes';
1212
import { Library } from '../assessment/AssessmentTypes';
1313
import { HighlightedLines, Position } from '../editor/EditorTypes';
@@ -217,12 +217,12 @@ export const setEditorHighlightedLines = (
217217
newHighlightedLines
218218
});
219219

220-
export const setEditorHighlightedLinesAgenda = (
220+
export const setEditorHighlightedLinesControl = (
221221
workspaceLocation: WorkspaceLocation,
222222
editorTabIndex: number,
223223
newHighlightedLines: HighlightedLines[]
224224
) =>
225-
action(UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA, {
225+
action(UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL, {
226226
workspaceLocation,
227227
editorTabIndex,
228228
newHighlightedLines

src/commons/workspace/WorkspaceReducer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
EVAL_TESTCASE_SUCCESS,
2525
HANDLE_CONSOLE_LOG,
2626
UPDATE_EDITOR_HIGHLIGHTED_LINES,
27-
UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA
27+
UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL
2828
} from '../application/types/InterpreterTypes';
2929
import { Testcase } from '../assessment/AssessmentTypes';
3030
import { SET_EDITOR_SESSION_ID, SET_SHAREDB_CONNECTED } from '../collabEditing/CollabEditingTypes';
@@ -757,7 +757,7 @@ export const WorkspaceReducer: Reducer<WorkspaceManagerState> = (
757757
}
758758
};
759759
}
760-
case UPDATE_EDITOR_HIGHLIGHTED_LINES_AGENDA: {
760+
case UPDATE_EDITOR_HIGHLIGHTED_LINES_CONTROL: {
761761
const { editorTabIndex, newHighlightedLines } = action.payload;
762762

763763
if (editorTabIndex < 0) {

0 commit comments

Comments
 (0)