HKICO 2019-2020 Mock Final Blocky
HKICO 2019-2020 Mock Final Blocky
COMPUTATIONAL OLYMPIAD
FINAL ROUND 2019 - 2020
Blockly
Time allowed: 90 minutes
Mock Paper
Instructions to Contestants:
1. Each contestant should have ONE Question-Answer Book which CANNOT be
taken away.
2. There are a total of 24 questions in this Question-Answer Book. Two points for
correct answers. No points for incorrect answers. ONE penalty point will be
deducted for incorrect answers.
3. All answers should be written on ANSWER SHEET.
4. During the contest, NO calculators can be used for Scratch and Blockly but
calculators can be used for Python.
5. All figures in the paper are not necessarily drawn to scale.
6. This Question-Answer Book will be collected at the end of the contest.
Multiple Choice Questions (1st ~24th) (Two points for correct answers. No points for incorrect
answers. ONE penalty point will be deducted for incorrect answers.)
1. Which of the following is/are most preferred when defining custom blocks?
I) YAML
II) Json
III) Protocol
IV) Javascript
V) Numbers
A. I & III
B. II & IV
C. I, II, III, IV
D. I, II, III, IV, V
E. None of the Above
2. Which of the following scripts is necessarily to be imported if the user wants to export the blockly
program as Javascript?
A. blockly_to_javascript.blockly
B. javascript_compressed.js
C. javascript_compressed.map
D. blockly.js.map
E. None of the Above
The toolbox is the side menu from whence the user may create new blocks. The structure of the
toolbox is specified with XML, which may be either a tree of nodes, or a string representation. This
XML is passed to Blockly when it is injected into the page.
3. Which of the following could be filled in place of <!-- missing line 1 --> as a toolbox block
definition?
A. <block type="controls_if"></block>
B. <!-- --><!-- -->
C. <toolbox>sample toolbox definition</toolbox>
D. Any of the above
E. None of the above
4. <!-- missing line 2 --> should be an empty category with name “Functions”. Which of the
following is the correct definition?
A. <xml id="toolbox" style="name: Functions">
B. <category name="Math" colour="320">...</category>
C. <category name="Functions" colour="50"></category>
D. <block type="Functions">
E. None of the above
5. Which of the following is NOT a valid property for custom block definition?
A. "output"
B. "message0"
C. "tooltips"
D. "helpUrl"
E. None of the above
6. It is possible to define a grid in a Blockly workspace. Which of the following is not a valid
property for defining grid in the Blockly configuration?
A. spacing
B. length
C. colour
D. size
E. snap
7. Which of the following is not a default Blockly workspace change event type?
A. Blockly.Events.BLOCK_CREATE
B. Blockly.Events.BLOCK_DELETE
C. Blockly.Events.BLOCK_MOVE
D. Blockly.Events.BLOCK_CHANGE
E. None of the above
8. You can set the block HSV color value by setting Blockly.HSV_SATURATION. What is the lower
and upper range of this value?
A. 0 to 1.0
B. 0 to 360
All answers should be written on the ANSWER SHEET.
C. −360 to 360
D. −1.0 to 1.0
E. None of the above
A. 0
B. 1
C. 2
D. 3
E. None of the above
A. 11111
B. “1111”
C. 511111
D. 5555
E. None of the above
11. Which of the following Javascript code is generated by the Blockly program below?
A.
B.
All answers should be written on the ANSWER SHEET.
C.
D.
E. None of the above
A. true
B. False
C. 0
D. “”
E. None of the above
A. 1
B. 4
C. 64
D. 100
E. None of the above
15. What is the expected output of the following program (assume it is running with Javascript)?
A. 1
B. 10
C. 11
D. 12
E. None of the above
16. What is the expected output of the following program (assume it is running with Javascript)?
A. 100, 50, 0
B. FF7F00
C. 100500000
D. 100500
E. None of the above
A. [ 321, 321 ]
B. #080503#080503
C. 321321
D. 030201030201
E. None of the above
All answers should be written on the ANSWER SHEET.
18. Blockly supports multilingualism (use of different localized languages), which of the following
languages is not supported?
A. Arabic
B. All Right-To-Left languages
C. Latin
D. Chinese
E. None of the above
A. 14
B. 20
C. 24
D. 9
E. None of the above
A. true
B. false
C. None
D. undefined
E. None of the above
23. The following block is greyed out, what is the error message?
A. None
B. true
C. false
D. [""]
E. None of the above
~ End of Paper ~