Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/microsoft/pxt into thspar…
Browse files Browse the repository at this point in the history
…ks/eval/run_eval_in_iframe
  • Loading branch information
thsparks committed Jan 9, 2024
2 parents 8d358c0 + ecd3cb5 commit 9dbe72f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
1 change: 1 addition & 0 deletions teachertool/src/components/DebugInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface IProps {}
const DebugInput: React.FC<IProps> = ({}) => {
const [shareLink, setShareLink] = useState("https://arcade.makecode.com/S50644-45891-08403-36583");
const [rubric, setRubric] = useState("");
const [bools, setBools] = useState(true);

const evaluate = async () => {
await loadProjectMetadataAsync(shareLink);
Expand Down
11 changes: 7 additions & 4 deletions teachertool/src/components/MakecodeFrame.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
/// <reference path="../../../built/pxteditor.d.ts" />
import * as React from "react";
import { setEditorRef } from "../services/makecodeEditorService";
interface MakeCodeFrameProps {
pageSourceUrl: string;
tutorialEventHandler?: (event: pxt.editor.EditorMessageTutorialEventRequest) => void;
}

export const MakeCodeFrame: React.FC<MakeCodeFrameProps> = ({pageSourceUrl}) => {
export const MakeCodeFrame: React.FC<MakeCodeFrameProps> =
( { pageSourceUrl} ) => {

const handleIFrameRef = (el: HTMLIFrameElement | null) => {
setEditorRef(el ?? undefined);
};
}

/* eslint-disable @microsoft/sdl/react-iframe-missing-sandbox */
return <div className="makecode-frame-outer" style={{ display: "block" }}>
<iframe className={`makecode-frame`} src={pageSourceUrl} title={"title"} ref={handleIFrameRef} />
</div>
<iframe className="makecode-frame" src={pageSourceUrl} title={"title"} ref={handleIFrameRef}></iframe>
</div>
/* eslint-enable @microsoft/sdl/react-iframe-missing-sandbox */
};
2 changes: 1 addition & 1 deletion teachertool/src/services/makecodeEditorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ export async function runEvalInEditorAsync(serializedRubric: string): Promise<px
}

return undefined;
}
}
12 changes: 12 additions & 0 deletions teachertool/src/transforms/loadProjectAsync.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { stateAndDispatch } from "../state";
import * as Actions from "../state/actions";
import { postNotification } from "./postNotification";
import { makeNotification } from "../utils";
import { setHighContrastAsync } from "../services/makecodeEditorService";

export async function loadProjectAsync(projectId: string, bool: boolean) {
const { dispatch } = stateAndDispatch();
await setHighContrastAsync(bool);
postNotification(makeNotification(`project ${projectId} evaluated`, 2000));

}

0 comments on commit 9dbe72f

Please sign in to comment.