0% found this document useful (1 vote)
146 views8 pages

HKICO 2019-2020 Mock Final Blocky

The document is a mock paper for the Hong Kong International Computational Olympiad's final round for the year 2019-2020, specifically focusing on Blockly programming. It contains 24 multiple-choice questions with specific instructions regarding scoring, answer submission, and the use of calculators. Contestants are required to answer questions based on their knowledge of Blockly and related programming concepts.

Uploaded by

thuanngoc852
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
146 views8 pages

HKICO 2019-2020 Mock Final Blocky

The document is a mock paper for the Hong Kong International Computational Olympiad's final round for the year 2019-2020, specifically focusing on Blockly programming. It contains 24 multiple-choice questions with specific instructions regarding scoring, answer submission, and the use of calculators. Contestants are required to answer questions based on their knowledge of Blockly and related programming concepts.

Uploaded by

thuanngoc852
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

HONG KONG INTERNATIONAL

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.

THIS Question-Answer Book CANNOT BE TAKEN AWAY.


DO NOT turn over this Question-Answer Book without approval of the examiner.
Otherwise, contestant may be DISQUALIFIED.
All answers should be written on the ANSWER SHEET.

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

Answer question 3 to 4 with the information below.


Below is an extract from the Blockly official guide about Toolbox:

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.

Here is an example defining toolbox but with some lines missing


<xml id="toolbox" style="display: none">
<!-- missing line 1 -->
<!-- missing line 2 -->
</xml>
<script>
var workspace = Blockly.inject('blocklyDiv',
{toolbox: document.getElementById('toolbox')});
</script>
All answers should be written on the ANSWER SHEET.

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

9. What is the output of the code below?

A. 0
B. 1
C. 2
D. 3
E. None of the above

10. The output of the following program is?

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

12. The output of the following program is?

A. true
B. False
C. 0
D. “”
E. None of the above

13. What is the expected output of the following program?

A. 1
B. 4
C. 64
D. 100
E. None of the above

14. What do the following 4 blocks have in common?

A. All of them have output value


B. All of them have mutators
C. All of them create new variables
D. All of them have some input value
E. None of the above
All answers should be written on the ANSWER SHEET.

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

17. What is the expected output of the following program?

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

19. What is the value of the below blocks?

A. 14
B. 20
C. 24
D. 9
E. None of the above

20. The value of the block below is?

A. true
B. false
C. None
D. undefined
E. None of the above

21. Refer to the following block

What option can you get other than "letter #"?


A. number of letters
B. letter # total
C. first letter
D. # last letter
E. None of the above
All answers should be written on the ANSWER SHEET.

22. Which of the following is not a method in Blockly.BlockDragger?


A. dispose
B. dragBlock
C. getInsertionMarkers
D. dragBlock
E. None of the above

23. The following block is greyed out, what is the error message?

A. Error: If condition absence


B. Warning: This block may be used only within a function definition
C. Warning: no return value specified
D. Error: return type not match
E. None of the above

24. The output of the following code is?

A. None
B. true
C. false
D. [""]
E. None of the above

~ End of Paper ~

You might also like