Skip to content

Integrate 1920 Source Format, Add Prepend Editor, Add Autograding Tab #527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dcb7b96
Merge pull request #1 from source-academy/master
geshuming Feb 19, 2019
29e76d0
Merge pull request #4 from source-academy/master
geshuming Mar 29, 2019
7d58318
Added new fields to IQuestion
geshuming Apr 8, 2019
bd21865
added autograder tab for assessmentWorkspace
geshuming Apr 9, 2019
4c5f458
Merge pull request #5 from source-academy/master
geshuming Apr 10, 2019
3cffcdf
yarn format
geshuming Apr 10, 2019
082bf88
Merge pull request #6 from source-academy/master
geshuming Apr 10, 2019
a26a1be
Merge pull request #7 from source-academy/master
geshuming Apr 11, 2019
5f83854
Merge branch 'master' into integrate-new-xml-format
geshuming Apr 11, 2019
4b24f5a
Merge remote-tracking branch 'upstream/master'
geshuming Apr 14, 2019
fd31f4b
Resolved merge conflicts
geshuming Apr 14, 2019
481b5c4
Merge branch 'master' of https://github.com/source-academy/cadet-fron…
geshuming Apr 15, 2019
ea931ce
Resolved merge conflicts
geshuming Apr 15, 2019
d108c96
Merge branch 'master' into integrate-new-xml-format
geshuming Apr 16, 2019
c2031ef
Merge branch 'master' of https://github.com/source-academy/cadet-fron…
geshuming Apr 17, 2019
8c1ab77
Merged 'master' from source-academy/cadet-frontend
geshuming Apr 17, 2019
21d3cbd
Resolved merge conflicts with Mission Control
geshuming Apr 17, 2019
0235d82
Merge branch 'integrate-new-xml-format' of https://github.com/geshumi…
geshuming Apr 17, 2019
64c12d7
Merge branch 'master' into integrate-new-xml-format
geshuming Apr 18, 2019
72f16a6
Separated each code segments with newlines
geshuming May 16, 2019
58f0d51
Added read-only AceEditor for tasks with Prepend
geshuming May 16, 2019
b010bd4
Merge branch 'master' into integrate-new-xml-format
geshuming May 16, 2019
0b687f6
Resolved merge conflicts
geshuming May 16, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions README.md.orig

This file was deleted.

43 changes: 31 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/actions/actionTypes.ts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const BEGIN_INTERRUPT_EXECUTION = 'BEGIN_INTERRUPT_EXECUTION';
export const END_INTERRUPT_EXECUTION = 'END_INTERRUPT_EXECUTION';
export const EVAL_INTERPRETER_ERROR = 'EVAL_INTERPRETER_ERROR';
export const EVAL_INTERPRETER_SUCCESS = 'EVAL_INTERPRETER_SUCCESS';
export const EVAL_TESTCASE_SUCCESS = 'EVAL_TESTCASE_SUCCESS';
export const HANDLE_CONSOLE_LOG = 'HANDLE_CONSOLE_LOG';
export const BEGIN_DEBUG_PAUSE = 'BEGIN_DEBUG_PAUSE';
export const END_DEBUG_PAUSE = 'END_DEBUG_PAUSE';
Expand All @@ -31,6 +32,7 @@ export const BEGIN_CLEAR_CONTEXT = 'BEGIN_CLEAR_CONTEXT';
export const BROWSE_REPL_HISTORY_DOWN = 'BROWSE_REPL_HISTORY_DOWN';
export const BROWSE_REPL_HISTORY_UP = 'BROWSE_REPL_HISTORY_UP';
export const CHANGE_ACTIVE_TAB = 'CHANGE_ACTIVE_TAB';
export const CHANGE_EDITOR_HEIGHT = 'CHANGE_EDITOR_HEIGHT';
export const CHANGE_EDITOR_WIDTH = 'CHANGE_EDITOR_WIDTH';
export const CHANGE_PLAYGROUND_EXTERNAL = 'CHANGE_PLAYGROUND_EXTERNAL';
export const CHANGE_SIDE_CONTENT_HEIGHT = 'CHANGE_SIDE_CONTENT_HEIGHT';
Expand All @@ -41,6 +43,7 @@ export const END_CLEAR_CONTEXT = 'END_CLEAR_CONTEXT';
export const ENSURE_LIBRARIES_LOADED = 'ENSURE_LIBRARIES_LOADED';
export const EVAL_EDITOR = 'EVAL_EDITOR';
export const EVAL_REPL = 'EVAL_REPL';
export const EVAL_TESTCASE = 'EVAL_TESTCASE';
export const INVALID_EDITOR_SESSION_ID = 'INVALID_EDITOR_SESSION_ID';
export const PLAYGROUND_EXTERNAL_SELECT = 'PLAYGROUND_EXTERNAL_SELECT ';
export const RESET_WORKSPACE = 'RESET_WORKSPACE';
Expand Down
9 changes: 9 additions & 0 deletions src/actions/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ export const evalInterpreterSuccess = (value: Value, workspaceLocation: Workspac
payload: { type: 'result', value, workspaceLocation }
});

export const evalTestcaseSuccess = (
value: Value,
workspaceLocation: WorkspaceLocation,
index: number
) => ({
type: actionTypes.EVAL_TESTCASE_SUCCESS,
payload: { type: 'result', value, workspaceLocation, index }
});

export const evalInterpreterError = (
errors: SourceError[],
workspaceLocation: WorkspaceLocation
Expand Down
13 changes: 13 additions & 0 deletions src/actions/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ export const changePlaygroundExternal: ActionCreator<actionTypes.IAction> = (
payload: { newExternal }
});

export const changeEditorHeight: ActionCreator<actionTypes.IAction> = (
height: number,
workspaceLocation: WorkspaceLocation
) => ({
type: actionTypes.CHANGE_EDITOR_HEIGHT,
payload: { height, workspaceLocation }
});

export const changeEditorWidth: ActionCreator<actionTypes.IAction> = (
widthChange: string,
workspaceLocation: WorkspaceLocation
Expand Down Expand Up @@ -161,6 +169,11 @@ export const evalRepl = (workspaceLocation: WorkspaceLocation) => ({
payload: { workspaceLocation }
});

export const evalTestcase = (workspaceLocation: WorkspaceLocation, testcaseId: number) => ({
type: actionTypes.EVAL_TESTCASE,
payload: { workspaceLocation, testcaseId }
});

export const invalidEditorSessionId = () => ({
type: actionTypes.INVALID_EDITOR_SESSION_ID
});
Expand Down
6 changes: 6 additions & 0 deletions src/components/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface IStateProps {
activeTab: number;
editorSessionId: string;
editorValue: string;
editorHeight?: number;
editorWidth: string;
breakpoints: string[];
highlightedLines: number[][];
Expand All @@ -59,6 +60,7 @@ export interface IDispatchProps {
handleChangeActiveTab: (activeTab: number) => void;
handleChapterSelect: (chapter: number) => void;
handleEditorEval: () => void;
handleEditorHeightChange: (height: number) => void;
handleEditorValueChange: (val: string) => void;
handleEditorWidthChange: (widthChange: number) => void;
handleEditorUpdateBreakpoints: (breakpoints: string[]) => void;
Expand Down Expand Up @@ -130,6 +132,8 @@ class Playground extends React.Component<IPlaygroundProps, PlaygroundState> {
websocketStatus: this.props.websocketStatus
},
editorProps: {
editorPrepend: '',
editorPrependLines: 0,
editorValue: this.props.editorValue,
editorSessionId: this.props.editorSessionId,
handleEditorEval: this.props.handleEditorEval,
Expand All @@ -140,7 +144,9 @@ class Playground extends React.Component<IPlaygroundProps, PlaygroundState> {
handleEditorUpdateBreakpoints: this.props.handleEditorUpdateBreakpoints,
handleSetWebsocketStatus: this.props.handleSetWebsocketStatus
},
editorHeight: this.props.editorHeight,
editorWidth: this.props.editorWidth,
handleEditorHeightChange: this.props.handleEditorHeightChange,
handleEditorWidthChange: this.props.handleEditorWidthChange,
handleSideContentHeightChange: this.props.handleSideContentHeightChange,
replProps: {
Expand Down
1 change: 1 addition & 0 deletions src/components/__tests__/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const baseProps = {
handleChangeActiveTab: (n: number) => {},
handleChapterSelect: (chapter: number) => {},
handleEditorEval: () => {},
handleEditorHeightChange: (height: number) => {},
handleEditorValueChange: () => {},
handleEditorWidthChange: (widthChange: number) => {},
handleEditorUpdateBreakpoints: (breakpoints: string[]) => {},
Expand Down
4 changes: 2 additions & 2 deletions src/components/__tests__/__snapshots__/Playground.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

exports[`Playground renders correctly 1`] = `
"<HotKeys className=\\"Playground pt-dark\\" keyMap={{...}} handlers={{...}}>
<Workspace controlBarProps={{...}} editorProps={{...}} editorWidth=\\"50%\\" handleEditorWidthChange={[Function: handleEditorWidthChange]} handleSideContentHeightChange={[Function: handleSideContentHeightChange]} replProps={{...}} sideContentHeight={40} sideContentProps={{...}} />
<Workspace controlBarProps={{...}} editorProps={{...}} editorHeight={[undefined]} editorWidth=\\"50%\\" handleEditorHeightChange={[Function: handleEditorHeightChange]} handleEditorWidthChange={[Function: handleEditorWidthChange]} handleSideContentHeightChange={[Function: handleSideContentHeightChange]} replProps={{...}} sideContentHeight={40} sideContentProps={{...}} />
</HotKeys>"
`;

exports[`Playground with link renders correctly 1`] = `
"<HotKeys className=\\"Playground pt-dark\\" keyMap={{...}} handlers={{...}}>
<Workspace controlBarProps={{...}} editorProps={{...}} editorWidth=\\"50%\\" handleEditorWidthChange={[Function: handleEditorWidthChange]} handleSideContentHeightChange={[Function: handleSideContentHeightChange]} replProps={{...}} sideContentHeight={40} sideContentProps={{...}} />
<Workspace controlBarProps={{...}} editorProps={{...}} editorHeight={[undefined]} editorWidth=\\"50%\\" handleEditorHeightChange={[Function: handleEditorHeightChange]} handleEditorWidthChange={[Function: handleEditorWidthChange]} handleSideContentHeightChange={[Function: handleSideContentHeightChange]} replProps={{...}} sideContentHeight={40} sideContentProps={{...}} />
</HotKeys>"
`;
Loading