Skip to content

2. Blockly Blocks

Eleftheria edited this page Sep 11, 2022 · 13 revisions

Blockly

From a user's perspective, Blockly is an intuitive, visual way to build code1. From a developer's perspective, Blockly is a ready-made UI for creating a visual language that emits syntactically correct user-generated code. Blockly can export blocks to many programming languages. In our case we export blocks in Python, as our backend code is written in Python, is dockerized and thus contains a Python image. As a result, it is easier for us to run the Python code.

Blocks Localization

Blockly supports block definitions that can be localized to the user's language. Through the use of string tables, message strings in the JSON block definition can adapt the inputs, fields, and labels to reflect the language's vocabulary, word ordering, and direction2. In our case, we have chosen Greek, as greek students will be the first ones to use our platform. In the future, it would be essential to integrate other languages too.

Categories

The Blockly blocks are organized into categories, so that they can be found easier. The categories are : Logic - Repetition structures - Variables - Movement - Mathematics - Text - Lists - Interaction - Sensors. In the categories: Movement - Interaction - Sensors you can find all the blocks that were specifically created for our project. In the following picture you can see all the categories.

blockly

Blocks per category

In the following pictures you can see all the blocks that every category contains and the user can use them in order to build his/her Blockly code.

b_1

b_2

b_3

b_4

b_5

b_6

b_7

b_8

b_9

Clone this wiki locally