EduBlocks icon indicating copy to clipboard operation
EduBlocks copied to clipboard

Allow POST-ing a Python snippet from other tools

Open aivarannamaa opened this issue 4 years ago • 3 comments

Congratulations on new release! EduBlocks is looking really strong and useful!

I learned about plans to support Python => Blocks conversion in the future.

Once this feature gets completed, it would be really cool if it were possible to post a Python snippet from another tool (eg. Thonny) to EduBlocks, such that the user would be able to see the logical structure of her code.

I imagine Thonny making a POST request to EduBlocks and receiving an URL for the blocks, which could be opened automatically in user's browser. I would integrate such feature in Thonny right away.

aivarannamaa avatar Jun 01 '20 14:06 aivarannamaa

Hi @aivarannamaa !

I'll keep that in mind.

One way I could do it is to allow you to generate a URL where the Python code is URLified at the end and EduBlocks takes that and converts it into blocks on page load.

The Python to Blocks is simply just an idea at this point so it'll be a while before it's working. However, I'll keep this issue open and let you know when I have something to show you!

JoshuaLowe1002 avatar Jun 01 '20 14:06 JoshuaLowe1002

I was worrying about URL length limit, but now when I looked it up, it seems promising approach indeed!

aivarannamaa avatar Jun 01 '20 14:06 aivarannamaa

It should be fine, EduBlocks runs the Python code through Trinket and they use this exact method and even on really long programs I've never had an issue

JoshuaLowe1002 avatar Jun 01 '20 14:06 JoshuaLowe1002