Tutorials index

Blockly Coding Tasks

Recommended Practice:
It is not necessary to understand how to create functions to answer these tasks. Your code needs to form a mini-program inside the function block provided. However, there are a few things that you do need to know:

e.g.
Function Example

The Execute Block
The Execute block is made especially for these challenges and performs these tasks:

  1. When the Run button is pressed, Execute acts like a Print block
  2. When the task is part of a challenge that is in Review mode and the Run button is pressed, Execute gives output in the same way as the Print block and also activates the grader.
  3. When the task is part of a llive challenge and the Run button is pressed, Execute gives output in the same way as the Print block and also stores the user's answer for later grading.

The grader works by trying input/output pairs to work out whether to mark the tasks as correct or incorrect. The test data, given in the task, forms one such input/output pair but there are also hidden input/output pairs entered into the system by the task author. To be marked as correct, a solution has to have all input/output pairs evaluate correctly. In other words your function has to work as asked for, not just work with the test data.

<< Back | Next >>

Coding tasks - Intro
Recommended practice
Functions, Procedures and Subroutines

Example 1
Example 2
Example 3
Example 4

Tutorials index



Did you know the UK Bebras Challenge is run by the Raspberry Pi Foundation? Discover free teaching resources, tools, and expert support for computing education at raspberrypi.org.