Fractions to Decimals

I created a Scratch lesson for my 7th grade math class this week. It is a starter project but I wanted the students to have a bit of practice with Scratch before we do a more complex math modeling project in November.

(First a bit of background – I’m student teaching middle school this fall and should have a 5-8 Math teacher certificate by the end of the year.  I’ll be back at my elementary computer lab position after that and I’ll run my code clubs in the winter.  I’m still leading Creative Coders Club at the local public library once a month.)

Screen Shot 2018-10-14 at 7.06.42 PM

The 7th graders have been learning about expressions with variables, integers and rational numbers. For this introductory project I had them create a fraction to decimal converter. Have the user give two integers and use division to give back the decimal.

Screen Shot 2018-10-14 at 7.04.17 PM

Basic code for project (with spelling errors).

I set up a Scratch teacher account with classes for the each section of 7th grade math then put the class invites into our Google Classroom.  This worked well since we were using Chromebooks.  I’m not sure how students who already have a Scratch account would be able to join our Scratch class, but the students seemed okay with making accounts.  I gave a few suggestions on setting up account names.  The only hiccup we had was when they went back to log in a second time, many went through the class invitation again and then couldn’t log in without setting up a second account. (I hope there is a way to remove those extra accounts.)  Adding a direct link to Scratch in our Google Classroom and giving clearer instructions alleviated this problem.

I set up a studio for each class but I gave them the exact same name.  This confused me later when adding projects to the studio I couldn’t tell which went with which class. Luckily you can easily change studio names.

Rational Number Period 1

Rational Number Period 4

After the first day of working on the project, I decided that I needed more formal assessment of this project so I adapted a rubric from the Scratch Ed one here and set up some test cases for the students to use to test their projects.  Testing is an important part of programming.

Students seems engaged and excited to be working in Scratch. I’m pleased with the turnout of completed projects and quality of the work.  There are some missing instructions and spelling issues but even I spelled denominator wrong in my example and a student had to point this out to me. A number of students came in during study hall to work on their projects.  One student who was new to Scratch and our school just had the biggest smile when he learned about the color and whirl effect options.

Screen Shot 2018-10-14 at 7.06.07 PM

New coder excited about Scratch

And one of our struggling students went above and beyond with her project.

Screen Shot 2018-10-14 at 7.05.16 PM

Excellent project

One issue I inadvertently avoided was the fact that Scratch will round decimals to two places in say blocks unless they are inside join blocks.  The Scratch Wiki mention of the Offline Decimal Trick  is the only reference I found in support of this feature.  Fortunately my directions were for student to use the join block to join “The answer is ” and the answer.  This allowed the students to see all of the interesting repeating decimals and weird rounding that appears from converting rational numbers into decimals. I didn’t notice this happenstance until I was helping some students finish at the last minute and we took a short cut for the last line and just put the answer in a say block. It took me a while to figure out what was going on.

Screen Shot 2018-10-14 at 7.03.23 PM

Without the join block, decimals are rounded to 2 places.

Here is the lesson I designed: Decimal Scratch Project If your students are really new to Scratch it might be advantageous to print the first page in color so the students can see where to find the blocks. (I guess I’ll have to update this when 3.0 is released.)

I wondered if any student would try to divide by zero.   Scratch will return the answer “Infinity” in this case which could lead to an interesting math discussion.

Advertisements

BeetleBlocks Tower

My math students are coding a tower in BeetleBlocks.  This is a project that I have wanted to do since a 4th grader last year designed a tower in BeetleBlocks. He called it the Sears Tower.

Sears Tower

4th grader designed  Sears Tower

I set up the engineering project with the following constraints:

Engineering Task: Use the Shapes menu blocks cube and cuboid to build a tower.

Constraints: 1) You must use at least 5 Shapes blocks. 2) Each shape must stack on top and be smaller than the shape below (no overhanging blocks) 3) The total height must be 100 mm or less (but greater than 80mm) 4) the base must be 35mm x 35mm

When I introduced the project I said we would use the Engineering Design Process  (Ask, Imagine, Plan, Create, Improve).  I explained the constraints and let them ask questions. They would need a written plan of their design with a bit of pseudocode* before I would let them on the computers.

(*I used the word pseudocode and one student thought I said Sudoku.)

Drawing from the Center

Next, I explained a bit about how the beetle draws the shapes from the center.  This is the big concept for this project.  They would calculate the center height, move the beetle, draw the cuboid, move to the center of the next cuboid, etc.   I modeled an example of a plan and pseudocode on graph paper:

OLYMPUS DIGITAL CAMERA

Pseudocode on the left, block tower start on the right, z height line in the middle.

One thing I learned was drawing the model in 3d wasn’t necessary, in fact, it was probably confusing.   The students’ models were easier for all of us to understand if they drew them in 2d and just concentrated on z height and moving the beetle to the center of the next cuboid.

We spent the rest of the class period working on their plans. One student was going to use a repeat block and make a tower of all the same blocks, so I had to change the constraints to specify 5 *different* cuboids.  A number of students were stuck on the calculations from the center.  I suggested they move to the center, draw, move to the top, move to the next center, draw, etc, breaking the problem up into smaller parts.

The next time we met I reviewed BeetleBlocks coding and suggested they use Wireframe to see inside and the beetle at the center of their block.  BeetleBlocks also displays Position (the 3-d coordinates) of the beetle, so they know the z-height.

Screen Shot 2018-05-28 at 9.36.18 AM

Partially coded tower and wireframe displaying beetle at the center of the upper cuboid.

If they were happy with their paper plan they could go right to BeetleBlocks. About half the class finished their coding by the end of the class and I’m busy printing towers on our little Printrbot Play.  Another thing to note is that the minimum size of the cuboids should be 3 mm for ease of printing.

A few of them will need improving before theirs will be printed.  I noticed a few cases where the blocks were nested not stacked on top of each other.  This tells me the student is not coding z-height correctly, which is the concept I am trying to teach, beyond calculating centers of cuboids.

Screen Shot 2018-05-28 at 9.47.36 AM

Nested blocks showing me the student hasn’t coded z-height correctly.

Set versus Move (Change)

There are two different ways to code the beetle to change z height.  One way to set the beetle to a specific z coordinate and the other is to move or change z by a certain amount.  These are two different perspectives to use and I let them choose which way makes more sense to them.  Set versus change statements can be confusing when programming and cause unexpected results.  Here we can look at the model using the wireframe setting and see what is happening.

One student is making a pyramid of blocks, each block 1 mm smaller (width, length) and 2 mm in height than the previous.  He is hard coding each block.  I’m going to suggest he use a repeat block and a variable.

Screen Shot 2018-05-28 at 9.53.41 AM

Code suggestions on the left for the pyramid making tower code on the right.

This project is turning out well and I’m learning a lot along with the students. I can print each one in less than 2 hours by setting the infill to 10% and cranking up the speed.

I’m surprised no one has created a double tower or thought to rotate on the z-axis to give the tower a bit of twist.  Dare I suggest these things?

Your Name in BeetleBlocks

In December my school’s PTO approved my grant for a 3D printer. Yes!  Now we can print 3D artifacts using BeetleBlocks.  My idea for the 4th graders’ first project is to design a 3D model of their name using BeetleBlocks code.

20161210_141806

School name printed by school printer using Beetleblocks code

I started with one of my math enrichment groups first. They were my small group test of the idea. This group has played with BeetleBlocks but most recently had been making math games in Scratch.

It only takes about 5 blocks of code to write your name and make a cuboid to keep all the letters together.  It takes a little bit more time to make decisions about the size of the text, the size of the cuboid and where you want to put the block that keeps the letters together.

screen-shot-2016-12-28-at-6-54-32-am

basic code stub for project

I gave them the constraints that their name had to fit on the BeetleBlocks grid (20 by 20 ) but they could have their name with the support cuboid behind or below.

Screen Shot 2016-12-28 at 7.25.50 AM.png

Name on grid with support cuboid below

The technically difficult part was getting the STL files saved where I could access them and that only had to do with the way our computers are networked.

20161216_204842

3D print of name with cuboid behind

The students were really excited about everything and just wanted to sit around the printer and watch it print.

20161216_142746

I was able to print three names at a time. I would have been able to print all nine students names in the time allowed, but I got cocky and changed filament in the middle and that caused a jam that I was not able to resolved before the end of the day.

20161216_213419

3D prints in MakerGeek’s Crystal blue PLA 

You have to understand that the printer arrived at school on Monday and we were printing this project on Friday. On Monday, the 4th graders voted on the filament color for their grade (Crystal blue, by the way) and on Friday, during the middle of printing, the filament arrived!

Based on this experience, I made a one page handout 3d-model-your-name-in-beetleblocks for the next time.  The next group to try this will be the rest of the students in this class.  These first nine will be my experts and help the rest of their class code and export their models.  My goal is to have all three 4th grade classes code and print a 3D model of their name.  Then I’ll try it with the 3rd graders.

The only curious thing I’ve found with BeetleBlocks is the rotational changes that I have to either code up front or adjust in Cura (printer software) to get the correct orientation for printing.

screen-shot-2016-12-11-at-8-36-21-pm

Strangely, when I save the model on the left, it will import into Cura with correct orientation for printing.

 

Details about our 3D printer:  The grant was for a $400 Printrbot Play.  It is a small printer with a small print bed size – 100 x 100 x 120 mm.   The Play received a few nods from MakeMagazine and 3Dprint.com 3D printer guides. I also have 2 years of experience with Printrbot printers – we have a personal Printrbot Simple at home.

20161216_141121.jpg

If Math Games, Then Hour of Code

Computer Science Education Week is upon us and my first batch of 4th grade Scratch math games are shared.  More will be completed tomorrow.  3rd graders have also been working on math games within my Scratch teacher account. I need to post those on our school website, too.screen-shot-2016-12-04-at-7-39-55-pm

I’ve been noticing a subtle misconception showing up with how my student are using the ask and answer blocks in their math quiz games.  When introducing the ask and answer block, I state that the two blocks work together. I talk about how the ask and wait is a Sensing block and is waiting for the user to type something and that something is held by the answer block.  I specifically say that these blocks come in a pair because I’ve had other issues with students type “answer” in the operator instead of using the answer block.

screen-shot-2016-12-04-at-7-26-27-pm

 

This year, I guess, the students have more complicated scenarios with multiple Sprites in play.  They set up one Sprite to ask the question.

screen-shot-2016-12-04-at-8-20-58-pm

and another Sprite to face the consequences of a right or wrong answer.

screen-shot-2016-12-04-at-6-57-26-pm

The logic seems okay unless you realize that other Sprite is not waiting for the input.  That is subtle for them to understand.

I realize that the answer block is a global variable and can be separated from the ask block. The code below works on a separate Sprite from the one asking.

screen-shot-2016-12-04-at-8-08-30-pm

However, my solution for the students was to create two broadcast messages: “correct” and “incorrect”. The broadcast event block is a powerful tool and a good block to get to know. Fourth grade teams were able to work on separate Sprites and code the ask/answer decisions in one and the receive broadcast events in the other and put them together to make cool projects.

screen-shot-2016-12-04-at-7-38-18-pm

 

Then, of course, there is what happens when you show a certain 4th grader how to make random math fact variables:

screen-shot-2016-12-04-at-6-54-49-pm

Yikes! I’m not sure how Scratch does it, but I love the fail soft aspects that make this a super awesome programming platform for kids.

More about Hour of Code as the week progresses.  I’m really looking forward to the week’s events.

Scratch Teacher Accounts

I’m testing out the new Scratch Teacher Account option with the 3rd grade math class that I am working with.

screen-shot-2016-11-08-at-9-32-07-pm

The class is using Chromebooks so using Scratch 2.0 offline editor was not an option this time. Luckily I knew that Scratch was offering teacher accounts – I was there when they announced it at the Scratch@MIT Conference 2016.

It wasn’t difficult to set up my teacher account. After I was approved, I had to come up with 20 student account names. I wanted ones that had an easy pattern, were easy to spell, remember and would not identify the students in any way.  I chose a “color-Sprite name” pattern, for example “bluegobo”.

Once I had all 20 accounts set up in my class, I printed out the account names, cut them apart, put them in a jar and had the students draw a random one out.  I have recorded their names & account names together in case someone forgets, and for grading.

After we got logged into the Chromebooks and into their accounts, we started with some of the lessons I did last year with 3rd graders (see 3rd Grade Scratch Game Makers).  I introduced drawing their initial with glides on the coordinate grid earlier than last year and they struggled with both their unfamiliarity with the program and with coordinate grids. I was somewhat disappointed with how the lesson went. I did more troubleshooting than I expected. After the hour lesson as over, I thought I would be able to see their projects but I realize now that I can only see projects they share.  I didn’t think we got far enough in the coordinate grid project to have time to talk about sharing their projects.

I missed a week, but their math teacher had them work in their Scratch accounts even with me not there. She had them create a Halloween scene and said she was impressed that they were able log in and to make the Sprites move around.  I’m impressed that she had them do Scratch without me. But it was a perfect segue into our Trick or Treat lesson on decisions in programming.

This time I remembered to save enough time for them to share and show their projects.

I know some of them didn’t feel they had enough time. But everyone enjoyed seeing their project playing out on the front board.

Note: no one noticed (that I heard) that what you type in has to exactly equal the answer for the “if” part to work.

 

3rd Grade Scratch Game Makers

Screen Shot 2015-12-20 at 9.31.58 PM

The 3rd graders that have been learning Scratch really came through during Computer Science Education Week and produced 11 goofy and wonderful little math games.  Last week we took the time to reflect and give feedback.  I am really impressed with their coding and want to jot down the lessons that occurred so I can repeat this again if I get the chance.

Here’s the list of lessons:

1. Intro to Scratch (Sprite, Stage, events, move, looks) -the basics introduced, time given to explore.

2. Etch-a-sketch (more events, pen)

3. Trick or Treat (if-then-else, ask-answer)

4. Draw Your Initial (coordinate system, glide, pen)   -for this lesson I had in mind to teach the Scratch coordinate system where (0,0) is the center of the screen.  I had them pick a Sprite of their choice and code it to glide around in the shape of their first (or last) initial.  I modeled gliding in a square while they followed first.Screen Shot 2015-12-20 at 9.04.32 PM

I handed out half sheets with the scratch grid on it so they could draw out their initial, figure out the coordinates then add the glide blocks.  Pen down and repeats were added at the end for extra flair.

5. Math game design outline (design sheet)

6. Math game coding (Pair programming)

7. Sharing and giving feedback

My expectation was that they’d code one math questions with two different outcomes like the Trick of Treat lesson.Screen Shot 2015-12-20 at 9.32.12 PM

Only this time they were working in pairs and had to come up with their own theme and math question.  They worked on it for almost two math sessions and then I put them up on the Scratch website.

Screen Shot 2015-12-20 at 10.01.57 PM.png

 

Last week they got to play all the games and give each other feedback. One student thought they were going to get to rate the games and he declared he always gives bad ratings to online games.  Instead I handed out sheets for them to give each game “2 stars and a wish” (This is something I came across in a FutureLearn MOOC on Teaching Computing)

20151220_214303.jpg

Giving good feedback is actually a lot of work.  I asked them to play each game twice, one time get the math question correct and then play it again and give the wrong answer.  Then they had to find two things they liked about the game and one thing they wished it would do differently.  I enjoy this feedback part of the game making.

Oh yeah, 4th graders made math games, too. What a difference a year and a bit of Code Club does to the complexity of the games made.  They also worked on giving 2 stars and a wish feedback this week.

Trick or Treat

Today was the second Scratch session with a 3rd grade math class and it was a blast.  Last week I introduced Scratch to them and they also tried out the Etch-a-sketch project from Simon Haughton’s Scratch Progamming lessons.   Some of them spent some time during the week playing with Scratch during free time in math class.

This week I wanted to introduce the “ask and answer” blocks and “if-then-else” so I came up with this Trick or Treat lesson, just in time for Halloween.

First I verbally asked them “Trick or Treat?” Most of them said, “treat” of course.  Then we brainstormed what a “treat” would look like in Scratch – do something (animation), change the costume, say something, play a sound.  They of course had big ideas like candy falling from the sky or the Sprite eating a pile of candy.  I tried to translate that into more programable language.  Then we brainstormed what a “trick” would look like.

I showed them my sample project where a ghost asks “Trick or Treat” and if you say “treat” he turns into a bowl of cheesepuffs otherwise he turns into a scary ghost.  I also had different sounds and a bit of animation (the Sprite turns and grows).

Next it was their turn. I directed them to picked a background for the stage and a Sprite.  Their choice.  We had a lot of ghost and ghouls, but quite a variety of backgrounds.

Screen Shot 2015-10-27 at 9.25.50 PM

Then they asked the question “Trick or Treat?” and set up the answer to equal trick or treat.  Also their choice.Screen Shot 2015-10-27 at 9.28.58 PM

We tested it and they noted it didn’t do anything. Well, not yet.  So we added a “say” block for each condition depending on if what they were looking for, trick or treat, and the opposite in the else clause.

Then I had them add two sounds, one for each condition.  In hindsight, I should have saved the sounds for last as noise level went up both from excitement and the random sounds playing in the room.

Screen Shot 2015-10-27 at 9.08.07 PM

Finally we added some costumes to the Sprite, one for each condition.  (There was a bit of confusion here because we weren’t adding more Sprites but costumes to our Sprite.)

Screen Shot 2015-10-27 at 9.41.58 PM

That was it, with just enough time to share their work. Their math teacher suggested this and it turned out to be a great idea. The projects were saved in a shared directory and all the laptops were closed and I displayed each project up on the screen for all to enjoy.  When it was their turn, I asked the project creator if they wanted me to answer “trick” or “treat” first, then played both cases for all their classmates to see. Screen Shot 2015-10-27 at 9.21.32 PM

I’m very pleased with how this project went with this group of 3rd graders.  I would definitely do it again- just have them add sound last.