@@ -1673,7 +1673,7 @@ export default {
1673
1673
.appendField (new Blockly.FieldImage (" /static/images/blocks/musical_note.png" , 30 , 30 , { alt: " note" , flipRtl: " FALSE" }))
1674
1674
.appendField (" NOTA " )
1675
1675
.appendField (new Blockly.FieldDropdown ([[" DO " ," C2" ], [" RE " ," D2" ], [" MI " ," E2" ], [" FA " ," F2" ], [" SOL " ," G2" ], [" LA " ," A3" ], [" SI " ," B3" ], [" DO+ " ," C3" ], [" RE+ " ," D3" ], [" PAUSA" ," PAUSE" ]]), " NAME" );
1676
- this .setInputsInlin (true );
1676
+ this .setInputsInline (true );
1677
1677
this .setPreviousStatement (true , null );
1678
1678
this .setNextStatement (true , null );
1679
1679
this .setColour (345 );
@@ -1685,28 +1685,29 @@ export default {
1685
1685
1686
1686
Blockly .Python [' coderbot_music_note_basic' ] = function (block ) {
1687
1687
var dropdown_name = block .getFieldValue (' NAME' );
1688
- // TODO: Assemble Python into code variable.
1689
- var code = ' get_music().play_note()\n ' ;
1688
+ var code = ' get_music().play_note("' + dropdown_name+ ' ")\n ' ;
1690
1689
return code;
1691
1690
};
1692
1691
1693
1692
1694
1693
Blockly .Blocks [' coderbot_animal_verse_basic' ] = {
1695
1694
init : function () {
1696
1695
this .appendDummyInput ()
1697
- .appendField (new Blockly.FieldImage (" /static/images/blocks/animal.png" , 15 , 15 , { alt: " *" , flipRtl: " FALSE" }))
1696
+ .appendField (new Blockly.FieldImage (" /static/images/blocks/animal.png" , 30 , 30 , { alt: " *" , flipRtl: " FALSE" }))
1698
1697
.appendField (" Verso del" )
1699
1698
.appendField (new Blockly.FieldDropdown ([[" Gatto" ," cat" ], [" Cane" ," dog" ]]), " Verso del" );
1699
+ this .setInputsInline (true );
1700
+ this .setPreviousStatement (true , null );
1701
+ this .setNextStatement (true , null );
1700
1702
this .setColour (290 );
1701
1703
this .setTooltip (" Verso animale" );
1702
1704
this .setHelpUrl (" " );
1703
1705
}
1704
1706
};
1705
1707
1706
- Blockly .Python [' coderbot_animal_verse_basic' ] = function (block ) {
1708
+ Blockly .Python [' coderbot_animal_verse_basic' ] = function (block ) {
1707
1709
var dropdown_animal = block .getFieldValue (' Verso del' );
1708
- // TODO: Assemble Python into code variable.
1709
- var code = ' get_music().play_animal(dropdown_animal)\n ' ;
1710
+ var code = ' get_music().play_animal("' + dropdown_animal+ ' ")\n ' ;
1710
1711
return code;
1711
1712
};
1712
1713
0 commit comments