Unmovable blocks moved by blocks around them?

121 views
Skip to first unread message

Natalie Freed

unread,
Feb 25, 2015, 6:24:40 PM2/25/15
to blo...@googlegroups.com
Hello!

I'm having a bit of weirdness with the moveable property on blocks and I'm wondering if this is how they are intended to work, or if my code is missing something. When I set movable to false in the XML, I can't move the block directly, but I can add blocks before or after and use those blocks to move the "unmovable" block. The functionality I'm after is for the unmovable blocks to truly be locked in place, so that a regular block can't be inserted between two unmovable blocks, and regular blocks can't make the unmovable blocks move.

My XML looks like this:

<xml id="startBlocks" style="display: none">
<block type="patternmaker_start" id="start" movable="false" x="20" y="20">
<value name="RUN" movable="false">
<block type="patternmaker_clear" movable="false">
<next>
<block type="patternmaker_goTo" movable="false"></block>
</next>
</block>
</value>
</block>
</xml>

The resulting blocks, loaded at the start, look like this:









I'd like the user to only be able to place new blocks after the "go to left shoulder" block.

Suggestions appreciated!

Natalie




Neil Fraser

unread,
Feb 25, 2015, 9:10:19 PM2/25/15
to blo...@googlegroups.com
Good catch.  I've modified the connection algorithm to refuse to make a connection between two unmovable blocks.

BTW, we have learned from experience that children aren't really fans of locked-down blocks.  Obviously they have an important role in many exercises.  But they don't allow for a sense of ownership.  Use locked-down blocks sparingly and with caution.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Natalie Freed

unread,
Feb 25, 2015, 10:43:22 PM2/25/15
to blo...@googlegroups.com, ro...@neil.fraser.name
Thank you!

I think that's good advice. I've just started testing out my app, which is a paper doll clothing pattern-maker (http://nataliefreed.github.io/paper-doll-designer/) I noticed that kids were building their designs a few blocks at a time, eg: writing some code that draws a few stripes, running that code again, deleting that code and adding another detail to the pattern with new code, then eventually getting frustrated when they couldn't undo an effect they'd just added. I'm hoping to encourage them to start building out full "recipes" to make their pattern, so they are repeatable and abstractable. I was going to try making the run code button always clear out the canvas and reset the coordinates to see if this changes anything in the way the kids think about their programs. The locked blocks idea (clear and move back to starting point) was meant to make it clear what was happening, but I think instead I will change the label on the start block to something like "reset, then run:"

Depending on how this goes, I might end up going entirely in the other direction and trying to use the JS interpreter to do something like in Scratch, where you can click on any block and it will take effect right away. Then at least they can prototype designs fast, then build up to a complete repeatable algorithm. Do you have any thoughts (from a technical or pedagogical perspective) on that approach, and/or have you seen a Blockly-based app that has tried it?

Natalie

Mark Friedman

unread,
Feb 26, 2015, 1:42:55 PM2/26/15
to blo...@googlegroups.com, Neil Fraser
On Wed, Feb 25, 2015 at 7:43 PM, Natalie Freed <eila...@gmail.com> wrote:
Thank you!

I think that's good advice. I've just started testing out my app, which is a paper doll clothing pattern-maker (http://nataliefreed.github.io/paper-doll-designer/) I noticed that kids were building their designs a few blocks at a time, eg: writing some code that draws a few stripes, running that code again, deleting that code and adding another detail to the pattern with new code, then eventually getting frustrated when they couldn't undo an effect they'd just added. I'm hoping to encourage them to start building out full "recipes" to make their pattern, so they are repeatable and abstractable. I was going to try making the run code button always clear out the canvas and reset the coordinates to see if this changes anything in the way the kids think about their programs. The locked blocks idea (clear and move back to starting point) was meant to make it clear what was happening, but I think instead I will change the label on the start block to something like "reset, then run:"

Depending on how this goes, I might end up going entirely in the other direction and trying to use the JS interpreter to do something like in Scratch, where you can click on any block and it will take effect right away. Then at least they can prototype designs fast, then build up to a complete repeatable algorithm. Do you have any thoughts (from a technical or pedagogical perspective) on that approach, and/or have you seen a Blockly-based app that has tried it?

Indeed, App Inventor has that sort of functionality (via its "Do it" feature) and we've found it to be extremely valuable both pedagogically and practically (for debugging and experimentation).

-Mark
Reply all
Reply to author
Forward
0 new messages