Skip to content

Commit 0e5a075

Browse files
committed
fix python code
1 parent fb409bb commit 0e5a075

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/Activity.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -628,14 +628,15 @@ export default {
628628
runProgram() {
629629
// POST /program/save
630630
console.info("Starting program");
631-
var code = '';
631+
var python_code = '';
632632
if(this.$data.activity.editor == 'code') {
633-
code = this.$data.code;
633+
python_code = this.$data.code;
634634
} else if (this.$data.activity.editor == 'blockly') {
635-
code = this.$refs.workspace.getProgramCode();
635+
let {code, dom_code} = this.$refs.workspace.getProgramData();
636+
python_code = code;
636637
}
637638
const programName = this.programName != '' ? this.programName : 'untitled';
638-
this.$coderbot.runProgram(programName, code).then(() => {
639+
this.$coderbot.runProgram(programName, python_code).then(() => {
639640
this.runtimeDialog = true;
640641
setTimeout(() => {
641642
this.updateExecStatus();

0 commit comments

Comments
 (0)