Implement Blockly in Coderunner?

Implement Blockly in Coderunner?

por Sergi García -
Número de respuestas: 3

Hi mates.

Blockly is a code generator based on blocks https://developers.google.com/blockly/

I was trying to understand how Coderunner Plugin is made and I was playing with file "renderer.php".

I implemented easily Blockly in Coderunner as proof of concept and I think that it could be useful to be activated for questions for absolute beginners.

What do you think about?

I attach an image of my "Proof of concept" and my renderer.php file as "renderer.txt"

(It is an ugly hack writing HTML directly to $qtext and not following any convention, it was only to make this prototype ).

Regards, Sergi.



En respuesta a Sergi García

Re: Implement Blockly in Coderunner?

por Richard Lobb -

That's a fun idea!

The way to integrate Blockly into CodeRunner properly would be to use the relatively new UI plugin capability. Have you seen CodeRunner's GraphUI (see the figure below) or the TableUI? But you'd have to implement the entire Blockly UI in JavaScript, which might be a tall order. How's your JavaScript? Or ... perhaps Blockly's already in JavaScript?

Sounds like a good student project, to me.

Richard

Image of an NFA question

En respuesta a Richard Lobb

Re: Implement Blockly in Coderunner?

por Sergi García -

Hi Richard.

Blockly is completly done in Javascript.

If you find a student that want to accomplish the project in a proper way, that would be a good idea.

If you can't, I can try to help you an do it myself.

I do the proof of concept directly because I couldn't find in code where are plugins like you show (GraphUI). Is it documented? Which files are?

Regards, Sergi.

En respuesta a Sergi García

Re: Implement Blockly in Coderunner?

por Richard Lobb -

Hi Sergi

Certainly I don't have time to do this myself, at least not until the end of the year. And I wouldn't want to make it an integral part of CodeRunner as I feel it's not really where CodeRunner is targetted. But I think it would be a fun extra plugin to have available via coderunner.org.nz.

The user-level documentation of the UIs is here. The JavaScript for the existing plugins is in the amd/src folder, with the compressed versions in amd/build. All code has to conform to Moodle amd module standards. Converting existing code to that standard can be anywhere between very difficult and relatively easy, depending on how it's written. The API for my CodeRunner UI plugins is documented in the module userinterfacewrapper.js.

Have fun!

Richard