From a14585d36fa41c9520a131cd26c29e8f9b49ab93 Mon Sep 17 00:00:00 2001 From: Michael Elliot Braun Date: Wed, 30 Mar 2016 15:54:19 -0700 Subject: [PATCH] updating lessons --- docs/lessons/counter.md | 2 ++ docs/lessons/die-roll.md | 3 ++- docs/lessons/digi-yoyo.md | 10 ++------- docs/lessons/digi-yoyo/activity.md | 1 - docs/lessons/digi-yoyo/challenges.md | 4 +++- docs/lessons/guess-the-number.md | 2 ++ docs/lessons/guess-the-number/quiz-answers.md | 2 +- docs/lessons/looper.md | 3 +++ docs/lessons/magic-8.md | 3 ++- docs/lessons/magic-8/quiz-answers.md | 3 ++- docs/lessons/magic-8/quiz.md | 2 +- docs/lessons/magic-logo.md | 2 ++ docs/lessons/night-light.md | 2 ++ docs/lessons/night-light/quiz-answers.md | 22 ++++++++++++++----- docs/lessons/rotation-animation.md | 15 +++++-------- docs/lessons/rotation-animation/challenges.md | 17 ++++++-------- docs/lessons/spinner.md | 2 ++ docs/lessons/strobe-light.md | 2 ++ docs/lessons/strobe-light/activity.md | 9 +++++++- docs/lessons/truth-or-dare.md | 2 ++ 20 files changed, 67 insertions(+), 41 deletions(-) diff --git a/docs/lessons/counter.md b/docs/lessons/counter.md index 921c8aa0..09ad7590 100644 --- a/docs/lessons/counter.md +++ b/docs/lessons/counter.md @@ -12,6 +12,8 @@ Variables * [activity](/microbit/lessons/counter/activity) * [challenges](/microbit/lessons/counter/challenges) +* [quiz](/microbit/lessons/counter/quiz) +* [quiz answers](/microbit/lessons/counter/quiz-answers) ## Prior learning/place of lesson in scheme of work diff --git a/docs/lessons/die-roll.md b/docs/lessons/die-roll.md index 673f306a..54329cb9 100644 --- a/docs/lessons/die-roll.md +++ b/docs/lessons/die-roll.md @@ -12,7 +12,8 @@ If (Conditionals) * [activity](/microbit/lessons/die-roll/activity) * [challenges](/microbit/lessons/die-roll/challenges) - +* [quiz](/microbit/lessons/die-roll/quiz) +* [quiz answers](/microbit/lessons/die-roll/quiz-answers) ## Prior learning/place of lesson in scheme of work diff --git a/docs/lessons/digi-yoyo.md b/docs/lessons/digi-yoyo.md index c0eae3c2..98e70b14 100644 --- a/docs/lessons/digi-yoyo.md +++ b/docs/lessons/digi-yoyo.md @@ -12,6 +12,8 @@ While Loop * [activity](/microbit/lessons/digi-yoyo/activity) * [challenges](/microbit/lessons/digi-yoyo/challenges) +* [quiz](/microbit/lessons/digi-yoyo/quiz) +* [quiz answers](/microbit/lessons/digi-yoyo/quiz-answers) ## Prior learning/place of lesson in scheme of work @@ -20,20 +22,12 @@ Learn how to creating a **while loop**, `while condition do` to repeat code whil ## Documentation ```docs - let x = 0 - basic.showNumber(0) - - while (true) { basic.pause(20) } - - - - ``` ## Objectives diff --git a/docs/lessons/digi-yoyo/activity.md b/docs/lessons/digi-yoyo/activity.md index bd6bfa71..da9c8dbf 100644 --- a/docs/lessons/digi-yoyo/activity.md +++ b/docs/lessons/digi-yoyo/activity.md @@ -18,7 +18,6 @@ let count = 0 Add a while loop that will loop over and over until the variable `count` equals 10. -![](/static/mb/blocks/lessons/digi-yoyo-1.jpg) ```blocks let count = 0 diff --git a/docs/lessons/digi-yoyo/challenges.md b/docs/lessons/digi-yoyo/challenges.md index 42b1afaa..24dee263 100644 --- a/docs/lessons/digi-yoyo/challenges.md +++ b/docs/lessons/digi-yoyo/challenges.md @@ -69,5 +69,7 @@ Now, we need `count` to decrease by one after the micro:bit has displayed the va We can do this by adding this line: ```blocks -let count = count + (count - 1); +let count = 0; +count = count + (count - 1); + ``` diff --git a/docs/lessons/guess-the-number.md b/docs/lessons/guess-the-number.md index 727a3bb4..d1457195 100644 --- a/docs/lessons/guess-the-number.md +++ b/docs/lessons/guess-the-number.md @@ -12,6 +12,8 @@ Math - Pick Random * [activity](/microbit/lessons/guess-the-number/activity) * [challenges](/microbit/lessons/guess-the-number/challenges) +* [quiz](/microbit/lessons/guess-the-number/quiz) +* [quiz answers](/microbit/lessons/guess-the-number/quiz-answers) ## Prior learning/place of lesson in scheme of work diff --git a/docs/lessons/guess-the-number/quiz-answers.md b/docs/lessons/guess-the-number/quiz-answers.md index a32d39ed..c4984252 100644 --- a/docs/lessons/guess-the-number/quiz-answers.md +++ b/docs/lessons/guess-the-number/quiz-answers.md @@ -31,7 +31,7 @@ let randomNumber = Math.random(10) If the rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded. ```blocks -randomNumber = Math.random(10) +let randomNumber = Math.random(10) ``` diff --git a/docs/lessons/looper.md b/docs/lessons/looper.md index 8dc06ac6..75f01bb3 100644 --- a/docs/lessons/looper.md +++ b/docs/lessons/looper.md @@ -12,6 +12,9 @@ For Loop * [activity](/microbit/lessons/looper/activity) * [challenges](/microbit/lessons/looper/challenges) +* [quiz](/microbit/lessons/looper/quiz) +* [quiz answers](/microbit/lessons/looper/quiz-answers) + ## Class diff --git a/docs/lessons/magic-8.md b/docs/lessons/magic-8.md index 9330a5ea..856b4ddf 100644 --- a/docs/lessons/magic-8.md +++ b/docs/lessons/magic-8.md @@ -10,6 +10,8 @@ If (Conditionals) * [activity](/microbit/lessons/magic-8/activity) * [challenges](/microbit/lessons/magic-8/challenges) +* [quiz](/microbit/lessons/magic-8/quiz) +* [quiz answers](/microbit/lessons/magic-8/quiz-answers) ## Prior learning/place of lesson in scheme of work @@ -28,7 +30,6 @@ input.onGesture(Gesture.Shake, () => { basic.showNumber(7) basic.clearScreen() basic.showString("Hello!") - ``` ## Objectives diff --git a/docs/lessons/magic-8/quiz-answers.md b/docs/lessons/magic-8/quiz-answers.md index 60628125..9acfa619 100644 --- a/docs/lessons/magic-8/quiz-answers.md +++ b/docs/lessons/magic-8/quiz-answers.md @@ -25,12 +25,13 @@ let x = Math.random(3) ## 3. Write the 'if statement' to check if ``x`` is equal to 2. Inside the 'if statement', display the string "Yes". ```blocks +let x = Math.random(3) if (x == 2) { basic.showString("Yes", 150) } ``` -## 3. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No." +## 4. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No." ```blocks let x = Math.random(3) diff --git a/docs/lessons/magic-8/quiz.md b/docs/lessons/magic-8/quiz.md index 317adce7..ed2cd13a 100644 --- a/docs/lessons/magic-8/quiz.md +++ b/docs/lessons/magic-8/quiz.md @@ -22,7 +22,7 @@ Answer the questions while completing the tutorial. Pay attention to the dialogu
-## 3. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No." +## 4. Write the 'if statement' to check if ``x`` is equal to 1. Inside the 'if statement', display the string "No."
diff --git a/docs/lessons/magic-logo.md b/docs/lessons/magic-logo.md index c36d453b..ff659cab 100644 --- a/docs/lessons/magic-logo.md +++ b/docs/lessons/magic-logo.md @@ -12,6 +12,8 @@ On Logo Up * [activity](/microbit/lessons/magic-logo/activity) * [challenges](/microbit/lessons/magic-logo/challenges) +* [quiz](/microbit/lessons/magic-logo/challenges) +* [quiz answers](/microbit/lessons/magic-logo/challenges) ## Prior learning/place of lesson in scheme of work diff --git a/docs/lessons/night-light.md b/docs/lessons/night-light.md index 53816d77..b7e65054 100644 --- a/docs/lessons/night-light.md +++ b/docs/lessons/night-light.md @@ -12,6 +12,8 @@ Set Brightness * [activity](/microbit/lessons/night-light/activity) * [challenges](/microbit/lessons/night-light/challenges) +* [quiz](/microbit/lessons/night-light/quiz) +* [quiz answers](/microbit/lessons/night-light/quiz-answers) ## Prior learning/place of lesson in scheme of work diff --git a/docs/lessons/night-light/quiz-answers.md b/docs/lessons/night-light/quiz-answers.md index 2396e758..14df5f9a 100644 --- a/docs/lessons/night-light/quiz-answers.md +++ b/docs/lessons/night-light/quiz-answers.md @@ -16,9 +16,15 @@ If the rectangle above represents the BBC micro:bit, write the code to set all t
-``` +```blocks led.setBrightness(255) -led.plotAll() +basic.showLeds(` + # # # # # + # # # # # + # # # # # + # # # # # + # # # # # + `) ``` ## 3. Consider the following image @@ -29,9 +35,15 @@ If the rectangle above represents the BBC micro:bit, write the code to set the s
-``` +```blocks led.setBrightness(128) -led.plotAll() +basic.showLeds(` + # # # # # + # # # # # + # # # # # + # # # # # + # # # # # + `) ``` ## 4. Consider the following image @@ -40,7 +52,7 @@ led.plotAll() If the rectangle above represents the BBC micro:bit, write the code to turn off all the LEDs. -``` +```blocks led.setBrightness(0) ``` diff --git a/docs/lessons/rotation-animation.md b/docs/lessons/rotation-animation.md index 1c2665f6..9f77f5f6 100644 --- a/docs/lessons/rotation-animation.md +++ b/docs/lessons/rotation-animation.md @@ -10,10 +10,8 @@ While Loop * [activity](/microbit/lessons/rotation-animation/activity) * [challenges](/microbit/lessons/rotation-animation/challenges) - -## Class - -Year 7 +* [quiz](/microbit/lessons/rotation-animation/quiz) +* [quiz answers](/microbit/lessons/rotation-animation/quiz-answers) ## Prior learning/place of lesson in scheme of work @@ -38,17 +36,14 @@ while (true) { basic.pause(20) } - - - ``` ## Objectives -* learn how to create a global variable for a place where you can store data, accessible across functions, and in nested code blocks -* learn how to set or change the value of a global variable +* learn how to create a variable for a place where you can store data, accessible across functions, and in nested code blocks +* learn how to set or change the value of a variable * learn how to repeat code while a condition is true -* learn how to declare a global boolean variable to determine which code will execute next +* learn how to declare a boolean variable to determine which code will execute next * learn how to run code when an input button is pressed * learn how to show a series of image frames on the LED screen * learn how to pause your code for the specified number of milliseconds diff --git a/docs/lessons/rotation-animation/challenges.md b/docs/lessons/rotation-animation/challenges.md index 14bb9d82..b58cbc3f 100644 --- a/docs/lessons/rotation-animation/challenges.md +++ b/docs/lessons/rotation-animation/challenges.md @@ -54,9 +54,6 @@ Now let's add to this by creating a condition for on button pressed `A` before t ```blocks let rotating = true; -input.onButtonPressed(Button.A, () => { - serial.writeLine("hello") -}) while (rotating) { serial.writeLine("loop") basic.showLeds(` @@ -88,8 +85,9 @@ while (rotating) { . . . . . `) } - - +input.onButtonPressed(Button.A, () => { + serial.writeLine("hello") +}) ``` @@ -101,10 +99,6 @@ Now that we have the on button pressed condition, let's make the animation stop ```blocks let rotating = true; -input.onButtonPressed(Button.A, () => { - serial.writeLine("hello") - rotating = false -}) while (rotating) { serial.writeLine("loop") basic.showLeds(` @@ -136,7 +130,10 @@ while (rotating) { . . . . . `) } - +input.onButtonPressed(Button.A, () => { + serial.writeLine("hello") + rotating = false +}) ``` diff --git a/docs/lessons/spinner.md b/docs/lessons/spinner.md index 29b54c64..360162f2 100644 --- a/docs/lessons/spinner.md +++ b/docs/lessons/spinner.md @@ -12,6 +12,8 @@ If (Conditionals) * [activity](/microbit/lessons/spinner/activity) * [challenges](/microbit/lessons/spinner/challenges) +* [quiz](/microbit/lessons/spinner/quiz) +* [quiz answers](/microbit/lessons/spinner/quiz-answers) ## Prior learning/place of lesson in scheme of work diff --git a/docs/lessons/strobe-light.md b/docs/lessons/strobe-light.md index f22e84bb..57092d62 100644 --- a/docs/lessons/strobe-light.md +++ b/docs/lessons/strobe-light.md @@ -12,6 +12,8 @@ For Loop * [activity](/microbit/lessons/strobe-light/activity) * [challenges](/microbit/lessons/strobe-light/challenges) +* [quiz](/microbit/lessons/strobe-light/quiz) +* [quiz answers](/microbit/lessons/strobe-light/quiz-answers) ## Documentation diff --git a/docs/lessons/strobe-light/activity.md b/docs/lessons/strobe-light/activity.md index 8ff62a3a..80ed82ba 100644 --- a/docs/lessons/strobe-light/activity.md +++ b/docs/lessons/strobe-light/activity.md @@ -45,7 +45,14 @@ for (let i = 0; i < 5; i++) { The pause will add a delay between lighting each LED. -![](/static/mb/blocks/lessons/strobe-light-3.jpg) +```blocks +for (let i = 0; i < 5; i++) { + for (let j = 0; j < 5; j++) { + led.plot(i, j) + basic.pause(200) + } +} +``` ### ~avatar avatar diff --git a/docs/lessons/truth-or-dare.md b/docs/lessons/truth-or-dare.md index 73bf9877..32fe19d8 100644 --- a/docs/lessons/truth-or-dare.md +++ b/docs/lessons/truth-or-dare.md @@ -12,6 +12,8 @@ If (Conditionals) * [activity](/microbit/lessons/truth-or-dare/activity) * [challenges](/microbit/lessons/truth-or-dare/challenges) +* [quiz](/microbit/lessons/truth-or-dare/quiz) +* [quiz answers](/microbit/lessons/truth-or-dare/quiz-answers) ## Prior learning/place of lesson in scheme of work