Programming for prospective educators (using Scratch) - unit 1

Aus ZUM-Unterrichten


| ⇠ back to main page | unit 1 | unit 2 → | unit 3 → | unit 4 → |


==Guidance for students==


==Handout for teachers==


Objectives
  • The students will get to know the Scratch programming environment and how to use it in order to create and manage their own programming projects.
  • They will learn the basic elements of the Scratch programming language and use them to "write" their first simple programs.
  • The students will reflect on their experiences with programming.
  • They will also learn (without too many theoretical considerations) basic concepts of "professional" programming (object and event orientation, process communication).


Introduction

The prior knowledge of the students at a ‹Specialised Upper Secondary School› regarding the programming course will be very different and will continue to change in the course of the coming years. Depending on the situation in the class, the teacher has to either guide or accompany more.
In any case, it is recommended to form teams of two in order to promote discussion and reflection. If the heterogeneity in a class is very high, perhaps the students with experience in programming can take over the guidance of teams; perhaps the tasks of unit 1 can be formulated more openly for the students with corresponding previous knowledge (e.g. instead of the given match puzzle, a self-designed memory or puzzle).


Setting up the personal programming environment

The students should create an account on scratch.mit.edu ("Join Scratch"). To confirm the creation of the account, they need a valid e-mail address. Students who are not yet of full age should ideally use an e-mail address without a real name or other information that could be used to identify them. Students who have reached the age of majority and especially prospective teachers are freer to choose their e-mail address. In any case, they should create a teacher account so that they have all the possibilities later (e.g. to share the programs).
It may happen that individual students refuse to create an account for personal reasons. Even without creating an account, they can complete the programming course. They have to save their Scratch projects locally on their computers and load them again from there. In this case, Scratch does not save automatically while they are working!
The students may also install Scratch on their personal devices if required (with the exception of mobile Apple devices, i.e. iPhone and iPad).


Getting to know Scratch and creating a first program yourself

The sample program:  a matchstick puzzle


MatchStickPuzzle.png
The first program is based on the idea that a certain problem can be solved by using a program on the computer to represent a selected part of reality (forming a model). In the case of our first program, these are matches that can be laid out on a surface, moved and rotated.
The explanations in the instructions for part 1 of the "programming" course should help the students to make such a program with Scratch themselves, step by step. The teacher observes and helps if necessary.

The components of the Scratch programming environment

Stage: The students should first get to know the stage and its design possibilities.
Objects (characters): In Scratch, the characters (sprites) play roles on the stage. The characters have properties (e.g. size, position) and scripts describe their (re)actions on events such as clicking the start flag.
From a theoretical point of view, this concept corresponds to object- and event-oriented programming. The characters are the objects; the objects are described by their properties (constants, variables) and (re)actions (methods). However, the students should get to know the characters as objects without too many theoretical considerations.
Objects can be duplicated in the programming environment, this simplifies the creation of multiple similar objects.
Objects can also be created dynamically while the program is running. The command in question is called "Create Clone of ...". However, we do not use the dynamic creation (cloning) of objects in the programming course.
→ The students must be provided with the image file match kibrit.svg as a "costume" for the objects of the matchstick puzzle (e.g. on a common storage for the whole course).
Save, describe and publish the program: Those students who created an account can save and edit their programs as projects. This includes a description of the program for users, which is especially necessary when the program is published.
The program description should also show that programming is not only communication with the computer, but also communication with people (who use or further develop the program).

Reflection
  • The matchstick puzzle is now ready. You can share it with others or use it yourself to solve it.
  • The focus is on the objects (in this case the matches) with their properties (appearance, size, position, location). This programming concept is called object orientation. However, the objects do not (yet) act in our program.
  • In the editing mode ("See Inside"), however, you can move and rotate the objects on the stage. The necessary commands to the computer have been realised by the Scratch programmers.


Objects and actions
Up to this point, the students have only assigned properties to the objects, but not yet scripts (actions).
The formulation of scripts is introduced with the initialisation necessary for the set-up of the matchstick puzzle and a text output.
The students now have to "write" their own scripts. This probably corresponds to what the students imagine by "programming". However, it is important that the students realise that the previous activities (creating objects, duplicating, positioning, etc.) and the considerations made about them are also part of programming!
To position the matches correctly, the students need to know the coordinate system of the Scratch stage. Figure 11 in the instructions introduces this coordinate system.
The text output explaining the matchstick puzzle is used to introduce the concept of Scratch extension blocks. The students need the "Text to Speech" block.
Process communication
With the next step, the students learn about the mechanism of message exchange between objects. Here, message exchange primarily allows the synchronisation of scripts (process communication).
This shows that objects in Scratch can comprise several scripts (→ object-oriented programming, several methods). As a rule, a script is only executed when a certain event occurs, here e.g. clicking on the start flag or an object or receiving a message (→ event-oriented programming). It is also evident that several scripts can be executed "simultaneously".

Reflection
  • A program comprises objects (in the example program these are the matches and the character chosen for the text output).
  • The objects are characterised by their properties (e.g. appearance, size, position, location) and the actions (scripts) assigned to them. This programming concept is called object orientation.
  • The initially independent objects can interact. The most common interaction is synchronisation (an object performs one of its actions when another object has completed a certain action). In Scratch, synchronisation takes place via exchanged messages (process communication).


Remix
For the remix of one′s own program, the button "Remix" is missing on the respective project page. The procedure is therefore somewhat different from remixing a "foreign" program. The Youtube video «Scratch Tutorial: How to Remix your OWN Projects» (https://youtu.be/dLY_MnAMe6o) shows how to do it.
It might be worth a try to let the students take over the program of another student (of another group).


Editing and execution mode
The matchstick puzzles programmed by the students are only partially executable programs!
The students always programmed in edit mode. They could therefore move and rotate the matchsticks on the stage as they wished (because this is a function of the Scratch programming environment).
If such a project is to be published and used by another person, the script that enables its moving with the mouse is missing for each match!
In the context of the programming course this is not a disadvantage. But if the students want to publish their programs, they absolutely have to insert the missing scripts. The instructions describe this ″problem″ and its solution.


Reflection
  • The strong and rapid spread of computer programs is in part due to the fact that new programs can build on existing ones. Open source software, in particular, benefits from this.
  • According to you, what are the advantages of open source software compared to non-open source programs (e.g. the text processing program LibreOffice Writer compared to Microsoft Office Word)? What disadvantages do you see?
  • Could you imagine participating in an open source project (e.g. as a translator or a programmer?)

Musterlösungen

Zündholzrätsel Variante 2: https://scratch.mit.edu/projects/671650074

Zündholzrätsel Variante 3: https://scratch.mit.edu/projects/671651532

Authors: Bruno Wenk, Dieter Burkhard

Translation: Patricia Berchtel