ITBO-Programming-part-1: Unterschied zwischen den Versionen

Aus ZUM-Unterrichten
Markierung: 2017-Quelltext-Bearbeitung
Markierung: 2017-Quelltext-Bearbeitung
Zeile 49: Zeile 49:
:'''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.
:'''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.
: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 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.
: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 [https://openclipart.org/detail/314823/match-kibrit match kibrit.svg] as a "costume" for the objects of the matchstick puzzle (e.g. on a common storage for the whole course).
:→ The students must be provided with the image file [https://openclipart.org/detail/314823/match-kibrit 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.
:'''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).
: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).


{{Box|Reflexion|* Das Zündholzrätsel ist nun bereits fertig. Sie können es anderen Personen zugänglich machen oder selbst nutzen, um das Zündholzrätsel zu lösen.
{{Box|Reflexion|* Das Zündholzrätsel ist nun bereits fertig. Sie können es anderen Personen zugänglich machen oder selbst nutzen, um das Zündholzrätsel zu lösen.

Version vom 3. August 2023, 09:47 Uhr


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


==Guidance for students (Open Document Format ODF)==

==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).

Reflexion
  • Das Zündholzrätsel ist nun bereits fertig. Sie können es anderen Personen zugänglich machen oder selbst nutzen, um das Zündholzrätsel zu lösen.

Im Mittelpunkt stehen die Objekte (in diesem Fall die Zündhölzer) mit ihren Eigenschaften (Aussehen, Grösse, Position, Lage). Dieses Programmier-Konzept heisst Objektorientierung. Allerdings agieren die Objekte in unserem Programm (noch) nicht.

Im Bearbeitungsmodus («Schau hinein») können Sie die Objekte auf der Bühne aber verschieben und drehen. Die dazu nötigen Befehle an den Computer haben die Programmierer:innen von Scratch realisiert.
Objekte und Aktionen
Bis zu diesem Zeitpunkt haben die SuS den Objekten erst Eigenschaften zugewiesen, aber noch keine Skripte (Aktionen).
Die Formulierung von Skripten wird anhand der für die Startaufstellung des Zündholzrätsels nötigen Initialisierung und einer Textausgabe eingeführt.
Die SuS müssen nun eigene Skripte «schreiben». Das entspricht wahrscheinlich dem, was sich die SuS unter «Programmieren» vorstellen. Es ist aber wichtig, dass sich die Schülerinnen und Schüler bewusst werden, dass auch die bisherigen Tätigkeiten (Objekte erzeugen, duplizieren, positionieren, usw.) und die dazu angestellten Überlegungen zum Programmieren gehören!
Um die Zündhölzer korrekt zu positionieren, müssen die SuS das Koordinatensystems der Bühne von Scratch kennen. Abbildung 11 in der Anleitung stellt dieses Koordinatensystem vor.
Die Textausgabe zur Erläuterung des Zündholzrätsels dient dazu, das Konzept der Erweiterungsblöcke von Scratch einzuführen. Die SuS benötigen den Block «Text zu Sprache».
Prozesskommunikation
Im nächsten Schritt lernen die SuS den Mechanismus des Nachrichtenaustauschs zwischen Objekten kennen. Der Nachrichtenaustausch ermöglicht hier vor allem die Synchronisation von Skripten (Prozesskommunikation).
Damit wird ersichtlich, dass Objekte in Scratch mehrere Skripte umfassen können (→ objektorientierte Programmierung, mehrere Methoden). Ein Skript wird in der Regel erst ausgeführt, wenn ein bestimmtes Ereignis eintritt, hier z.B. das Anklicken der Startflagge oder eines Objekts bzw. der Empfang einer Nachricht (→ ereignisorientierte Programmierung). Ausserdem wird ersichtlich, dass auch mehrere Skripte «gleichzeitig» ausgeführt werden können.

Reflexion
  • Die Objekte sind durch ihre Eigenschaften (z.B. Aussehen, Grösse, Position, Lage) und die ihnen zugeordneten Aktionen (Skripte) charakterisiert . Dieses Programmier-Konzept heisst Objektorientierung.
Die zunächst unabhängigen Objekte können interagieren. Die häufigste Interaktion ist die Synchronisation (ein Objekt führt eine seiner Aktionen aus, wenn ein anderes Objekt eine bestimmte Aktion abgeschlossen hat). In Scratch erfolgt die Synchronisation über ausgetauschte Nachrichten (Prozesskommunikation).


Remix
Für den Remix eines eigenen Programmes fehlt auf der betreffenden Projektseite die Schaltfläche «Remixen». Das Vorgehen ist deshalb etwas anders als beim Remix eines «fremden» Programms. Das Youtube-Video «Scratch Tutorial: How to Remix your OWN Projects» ( https://youtu.be/dLY_MnAMe6o ) zeigt, wie es geht.
Es ist vielleicht einen Versuch wert, die SuS das Programm einer anderen Schülerin oder eines anderen Schülers (einer anderen Gruppe) übernehmen zu lassen.


Bearbeitungs- und Ausführungsmodus
Die von den SuS programmierten Zündholzrätsel sind nur teilweise ausführbare Programme!
Die SuS haben immer im Bearbeitungsmodus programmiert. Sie konnten deshalb die Zundhölzer auf der Bühne beliebig verschieben und drehen (weil das eine Funktion der Scratch-Programmierumgebung ist).
Wenn ein solches Projekt veröffentlicht und von einer anderen Person genutzt werden soll, fehlt bei jedem Zündholz das Skript, das dessen Verschieben mit der Maus ermöglicht!
Im Rahmen des Moduls Programmieren ist das kein Nachteil. Aber wenn die SuS ihre Programme veröffentlichen wollen, müssen sie die fehlenden Skripte unbedingt einfügen. In der Anleitung ist dieses ″Problem″ und dessen Lösung beschrieben.

Reflexion
  • Die starke und rasche Verbreitung von Computerprogrammen hängt auch damit zusammen, dass neue Programme auf bestehenden aufbauen können. Davon profitiert vor allem auch Open Source Software.

Welche Vorteile hat Open Source Software aus Ihrer Sicht gegenüber nicht quelloffenen Programmen (z.B. LibreOffice gegenüber Microsoft Word)? Welche Nachteile sehen Sie?

Könnten Sie sich vorstellen, an einem Open Source Projekt mitzuwirken (z.B. als Übersetzer/in, Programmierer/in)?

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

Translations: Patricia Berchtel


==Discussion (on ZUMpad)== https://zumpad.zum.de/p/ITBOProgramming-unit1


INDEXIEREN


-->