Using Blockly
App development in AppShed
App development in AppShedL5 Using Blockly
Objectives• Use the Blockly Visual Programming
editor• Use variables and if statements in a
Blockly program• Create a quiz in an app• Debug a program if there are any errors
App development in AppShedL5 Using Blockly
Creating your quiz• Add a new tab to your App • Give it a suitable icon and
call it Quiz• Decide where you want
your tab to be using the Move tool
App development in AppShedL5 Using Blockly
Blockly• Blockly is a simple programming tool which
uses puzzle pieces rather than actual programming code
App development in AppShedL5 Using Blockly
Recording the Question Screen IDs• Write down the
Screen ID found at the bottom right of the screen. Keep a record of which screen is associated with which ID.
• E.g. Question 1 = 2380904
App development in AppShedL5 Using Blockly
Recording question reponses• The Name box is used to define a variable to
record the question responses
App development in AppShedL5 Using Blockly
The OK button and Blockly Actions• Use the OK button and apply a Blockly Action
App development in AppShedL5 Using Blockly
What is a variable?• A variable is a named place in the computer's
memory where you store some data• Most commonly, variables are used to pass
this data from screen to screen
App development in AppShedL5 Using Blockly
How variables are used in this app?• This app uses a variable to hold the user’s
response to a question• The name of the variable is, for example, Q1• Q1 will hold the response, for example, ‘B’• The program will then compare the value of
Q1 with the correct answer• If they match, the next question is shown• If not, a message ‘Try again’ is shown
App development in AppShedL5 Using Blockly
If statements• If statements are used to create two possible
outcomes based on the value of a variable• In Blockly they work in the format: If, do, else
• If Q1 = “A” do NEXT QUESTION else TRY AGAIN
App development in AppShedL5 Using Blockly
Blockly instruction blocks• Try reading these instructions. What do they do?
App development in AppShedL5 Using Blockly
Blockly and JavaScript• How does Blockly relate to JavaScript code?
App development in AppShedL5 Using Blockly
The finished question screens