stage.set_background_color("lightblue")
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, 0, 700, 100, "gold")
sprite.turn_left(45)
# sprite = codesters.Rectangle(x, y, width, height, "color")
sprite = codesters.Rectangle(0, 0, 700, 100, "gold")
sprite.turn_right(45)
sprite = codesters.Sprite("earth")
people_sprites = ['person1', 'person2', 'person3', 'person4', 'person5', 'person6',
'person7', 'person8','person9', 'person10', 'person11', 'person12']
rotate = 90
for value in people_sprites:
# add code here
sprite = codesters.Sprite(value)
stage.wait(0.5)
sprite.set_size(0.3)
sprite.set_speed(5)
sprite.move_forward(120)
sprite.turn_right(90)
sprite.rotate_origin(rotate)
rotate += 30
t = codesters.Teacher()
params = t.get_parameters_for_function('Text')
try:
tval1 = params[0][0]
except:
tval1 = "DNE"
try:
tval2 = params[0][1]
except:
tval2 = "DNE"
try:
indents = t.find_function('Text')
tval3 = t.get_indent_at_line(indents[0][0])
except:
tval3 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == '"STRENGTH IN DIVERSITY"', "Great job!")
t1.add_failure(tval1 == '"Hello up here."', "Did you change the string in the Text at a Position command?")
t1.add_failure(tval1 == "DNE", "Did you drag out a Text at a Position block?")
t1.add_creative(tval1 != "DNE" and tval1 != '"Hello up here."' and tval1 != '"STRENGTH IN DIVERSITY"', "That's a great message too!")
t2 = TestObjective()
t2.add_success(tval2 == "0", "Great job!")
t2.add_failure(tval2 == "100", "Did you change the x-coordinate to 0?")
t2.add_failure(tval2 == "DNE", "Did you drag out a Text at a Position block?")
t3 = TestObjective()
t3.add_success(tval3 == 0, "Great job!")
t3.add_failure(tval3 == 4, "Did you un-indent the Text at a Position command?")
t3.add_failure(tval3 > 4 and tval3 != "DNE", "You indented Text at a Position too far.")
t3.add_failure(tval3 == "DNE", "Did you add a Text at a Position command?")
tester = TestManager()
tester.add_test_list([t1,t2,t3])
tester.run_tests()
tester.display_first_feedback()