• No se han encontrado resultados

Algorithm design

In document Transforming Education Through Technology (página 166-172)

Miracles in Education through innovation: An Empirical Analysis for Pakistan

B. Estimation of Science and Technology Development Index

3. The representation of computational thinking on applications created by App Inventor

3.1 Algorithm design

Fresh Food is an application used for family’s food management, a life type application.

What it does is abstracting repetitive work to an algorithm so that users can be liberated from repetitive work.

The author came to this app’s idea from her experience: The food in her family refrigerator was often ignored even when the expiration date passed. She did a survey and found that the problem occurred in most families she surveyed.

In ordinary food management, people use a notebook to record the foods' information, such as expiration date, and check the notebook every day to see if there is any expired food can be thrown away. The author wants to make it simpler so she creates this application, which is an implement and extension of the notebook.

This application abstracts the ordinary food-manage steps into an algorithm. With this application, users only need to concentrate on the input, the foods' information, and the application will do the rest, such as reminding users of the foods' expiration.

Figure 2. Survey form 3.2 Abstraction and Data Management

Review Master is an educational application. In its development, abstraction and data management are essential.

The authors are two students from middle school. They were preparing for the high school entrance examination in a strained state. When they saw some students holding a bunch of review books in subway, they came to the idea that they could create a mobile app for reviewing knowledge anytime and anywhere.

Based on the rich features of App Inventor and their learning experience, the authors built this app for both teachers and students. Teachers could use the app to publish exam tasks, and students could do the exam, review what they had done, take notes, share and so on.

1) Abstract: the app is divided into two module pieces at the top level: teacher module and student module. Teacher module is divided into sub-modules of publishing exam and reviewing students’ statistics; Student module is divided into doing exam, adding exam, and reviewing wrong-answer record. All these modules are divided based on the

“Screen” component of App Inventor.

Figure 3. Module division

In each sub-module (or Screen), the logic is divided into logic-components using abstraction and modularity and some of these components can be reused using combination and recombination. Take the module of adding exam as example, there are two methods to add exam: Text and Image.

Figure 4. Add text question or add image question

The logic of the two methods is similar: obtaining the exam data first and storing the data. They are only different in the first part where one obtains the data using text input and the other one using image. So the authors abstracted the logic into two components:

obtaining and storing. The storing component was reused and when combining different obtaining components with the storing component, app could offer multi-features for users. For example, if they want features of adding exam using voice or video, they just need to add a voice-obtaining component or video-obtaining component.

Figure 5. The logic of Add text question

Figure 7. Question data storage

2) Data Management: In the student module, app is based on data: adding exam is adding data, doing exam is querying data, and removing exam is deleting data. If we use a data structure to abstract all these data operations, the user wanting to manage data only need to understand the interface instead of the details. TinyDB is such a data structure and app could use it to do all operations about exam data.

Figure 8. Use TinyDB for data management 3.3 Algorithm design and Debugging

Labyrinth is a game created by a male high school student, who wanted to play a labyrinth game in a novel way. Algorithm design and debugging are realized in its development.

Different from traditional labyrinth games, this game shows only the current labyrinth information around the player, and the player needs to use these partial data to move in the right direction until finding the exit.

Figure 9. Scene 1, player is in the center of the screen

Figure 10. Player moves one more right step from scene 1

1) Algorithm: The logic of this game is difficult to design since it needs to judge the current state when the player moves one step: hitting the wall, moving, or reaching the exit. When getting the right state, the game needs to refresh the photos to the screen.

The photo below shows how the game deals with this logic.

Figure 11. Press the ButtonA, that is turning left and move a step forward The author divided the process into several parts and each part deals with a particular logic. It is useful to understand the thinking and debugging clearly.

The logic is showed in the following figure:

Figure 12. The logic of button-pressed event

2) Debugging: Since the logic of this game is a little complex, when an error occurs, such as a player not being able to move forward even when hitting the wall, it’s quite difficult to find the code errors in the entire app. The author needs to shrink the range according to the current information such as position, direction and others.

In document Transforming Education Through Technology (página 166-172)