Skip to content

Commit 88bbf42

Browse files
committed
fixed quiz bugs w/Jim
1 parent e1588b3 commit 88bbf42

File tree

7 files changed

+27
-35
lines changed

7 files changed

+27
-35
lines changed
0 Bytes
Binary file not shown.

TeachingKidsProgramming/src/org/teachingkidsprogramming/recipes/quizzes/graders/PentagonCrazyQuizGrader.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import org.teachingextensions.logo.Colors;
1010
import org.teachingextensions.logo.Paintable;
1111
import org.teachingextensions.logo.Tortoise;
12-
import org.teachingextensions.logo.Turtle;
1312
import org.teachingextensions.logo.Wheel;
13+
import org.teachingextensions.logo.Turtle;
1414
import org.teachingextensions.logo.utils.TortoiseUtils;
1515

1616
import com.spun.util.NumberUtils;
@@ -75,7 +75,7 @@ private boolean grade3Lime()
7575
{
7676
ColorWheel.removeAllColors();
7777
quiz.question3();
78-
return getSafeColor() == Colors.Greens.Lime;
78+
return Colors.Greens.Lime.equals(getSafeColor());
7979
}
8080
public Color getSafeColor()
8181
{
@@ -85,14 +85,14 @@ public Color getSafeColor()
8585
}
8686
catch (Exception e)
8787
{
88-
return null;
88+
return Colors.Yellows.Yellow;
8989
}
9090
}
9191
private boolean grade4Red()
9292
{
9393
ColorWheel.removeAllColors();
9494
quiz.question4();
95-
return getSafeColor() == Colors.Reds.Red;
95+
return Colors.Reds.Red.equals(getSafeColor());
9696
}
9797
public void setColors()
9898
{

TeachingKidsProgramming/src/org/teachingkidsprogramming/section05recursion/TreeQuiz.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void questions1To4()
2222
// Question 3
2323
// setNinety (recipe below)
2424
// ------------- Recipe for setNinety
25-
// sets the angle of the current turn to 90
25+
// set the current turn angle to 90, HINT: Use angles
2626
// ------------- End of setNinety recipe
2727
//
2828
// Question 4

TeachingKidsProgramming/src/org/teachingkidsprogramming/section06modelviewcontroller/AdLibsQuiz.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.teachingkidsprogramming.section06modelviewcontroller;
22

3+
import org.teachingextensions.simpleparser.Parser;
34
import org.teachingkidsprogramming.recipes.quizzes.graders.AdLibsQuizAdapter;
45
import org.teachingkidsprogramming.recipes.quizzes.graders.AdLibsQuizGrader;
56

@@ -8,18 +9,22 @@ public class AdLibsQuiz extends AdLibsQuizAdapter
89
public void question1(String letter1, String letter3)
910
{
1011
//set current value of word1 to be letter1 + 'o' + letter3
12+
word1 = letter1 + 'o' + letter3;
1113
}
1214
public void question2(String letter1)
1315
{
1416
//add the letter1 to the end of word2
17+
word2 = word2 + letter1;
1518
}
1619
public void question3(String templateText, Object model)
1720
{
1821
//use the parser to combine the template and the model as word3
22+
word3 = Parser.parse(templateText, model);
1923
}
2024
public void question4(Pieces pieces)
2125
{
2226
//set template4 to the template which does'g' + pieces.middle + 'e'
27+
template4 = "g{middle}e";
2328
}
2429
public static void main(String[] args)
2530
{

TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/DeepDive07Events.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public void twoTortoisesAgain() throws Exception
4242
public void twoTortoisesYetAgain() throws Exception
4343
{
4444
Tortoise rafael = new Tortoise();
45-
Tortoise michealangelo = new Tortoise();
45+
Tortoise michelangelo = new Tortoise();
4646
Tortoise anonymousNinja = ________;
47-
boolean result = michealangelo.equals(anonymousNinja);
47+
boolean result = michelangelo.equals(anonymousNinja);
4848
Assert.assertEquals(true, result);
4949
}
5050
//Turtle Leonardo belongs to "this"
@@ -70,12 +70,12 @@ public void explodingTurtle() throws Exception
7070
@Test
7171
public void feedTheNinja() throws Exception
7272
{
73-
Tortoise michealangelo = new Tortoise();
74-
michealangelo.likesTopping(Topping.Pepperoni);
73+
Tortoise michelangelo = new Tortoise();
74+
michelangelo.likesTopping(Topping.Pepperoni);
7575
Pizza pizza = new Pizza();
7676
pizza.addTopping(_________);
77-
boolean likedIt = michealangelo.eatPizza(pizza);
78-
Assert.assertTrue("Michealangelo barfs! Wrong pizza!", likedIt);
77+
boolean likedIt = michelangelo.eatPizza(pizza);
78+
Assert.assertTrue("Michelangelo barfs! Wrong pizza!", likedIt);
7979
}
8080
@Test
8181
public void feedTheNinjaTwo() throws Exception

TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/ManyAnimals.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,27 @@ public ManyAnimals()
88
}
99
//Create a container to hold your turtles HINT: Use ArrayList --#2.1
1010
//Create a window to show your turtles HINT: Use MultiTurtlePanel --#1.1
11+
//
1112
private void showSomeTurtles()
1213
{
1314
//Show your panel --#1.2
1415
//Set the size to 100 --#5.4
16+
//
1517
//Add your three turtles HINT: FOR loop which 'does an action' --#2.2
1618
//Create your turtle --#2.4
1719
//Add your turtles to your turtle container --#2.5
1820
//Repeat --#2.2
21+
//
1922
//Add your turtles to your window HINT: Use a foreach loop --#3.1
20-
//Must call addTurtle BEFORE calling other methods --INFO
23+
//HINT: Must call addTurtle BEFORE calling other methods --INFO
2124
//Add your turtles to your window --#3.3
2225
//Repeat --#3.2
26+
//
2327
//Teleport your turtles around your window HINT: Use a FOR loop and ZERO --#4.1
2428
//Get your turtle's current position and then set the X position to i*100 + 350 --#4.3
2529
//Get your turtle's current position and then set the Y position to i*100 + 100 --#4.4
2630
//Repeat --#4.2
31+
//
2732
//Set some values for your turtles HINT: Use a foreach loop --#5.1
2833
//Set the speed of your turtles to 7 --#5.3
2934
//Have every turtle draw a star of the current size --#5.4

TeachingKidsProgramming/src/org/teachingkidsprogramming/section07events/SimpleBubbleQuiz.java

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
public class SimpleBubbleQuiz extends SimpleBubbleQuizAdapter
77
{
88
//**THIS QUIZ IS IN PROGRESS
9+
// Grader could listen for events
10+
// students wire up events, then grader listens (draws)
11+
// student must click for final reward FAIL-> PASS (toggle)
12+
// Tortoise on baseball diamond - click on first base, second base
13+
// click order - change from fail to pass
914
public void question1(String letter1, String letter3)
1015
{
1116
//set current value of word1 to be letter1 + 'o' + letter3
@@ -26,27 +31,4 @@ public static void main(String[] args)
2631
{
2732
new SimpleBubbleQuizGrader().grade(new SimpleBubbleQuiz());
2833
}
29-
//this is the original quiz (from SmallBasic) - need to be translated to Java
30-
//Variables needed for Quiz
31-
// action[1] = 15
32-
// ball = 1
33-
// BubbleQuiz.StartQuizAt = Question2
34-
//--------------------Begin Quiz --------------------
35-
//Question1 - Is At the bottom of this quiz. But do it 1st!
36-
// Sub Question2
37-
// Set the 1st action to 5
38-
// EndSub
39-
// Sub Question3
40-
//Have the timer call Move every 100 milliseconds
41-
// EndSub
42-
// Sub Question4
43-
// Set the 2nd action to -6
44-
// EndSub
45-
// Sub Question5
46-
//Change the color for the next circle to be yellow
47-
//Make the current ball be a circle with a 11 pixel radius
48-
// EndSub
49-
//Question1
50-
//Create a subroutine called Move
51-
// that calls Quiz.DoMovement()
5234
}

0 commit comments

Comments
 (0)