t = codesters.Teacher()
turns = t.find_function('turn_left')
gotos = t.find_function('go_to')
hides = t.find_function('hide')
try:
tval1 = turns[0][0]
except:
tval1 = "DNE"
try:
tval4 = gotos[1][0]
except:
tval4 = "DNE"
try:
tval2 = hides[0][1]
tval3 = t.get_indent_at_line(hides[0][0])
except:
tval2 = "DNE"
tval3 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == "DNE" and tval4 == "DNE", "Great job!")
t1.add_failure(tval1 != "DNE", "Did you delete the Turn Left command?")
t1.add_failure(tval4 != "DNE", "Did you delete the Go To command inside the event?")
t2 = TestObjective()
t2.add_success('hit_sprite.' in tval2 and tval3 == 4, "Great job!")
t2.add_failure(tval2 == "DNE", "Oops! Did you delete the Hide command from your Collision event?")
# t2.add_failure('hit_sprite.' not in tval2, "Did you change the name in front of .hide() to hit_sprite?")
t2.add_failure(tval3 < 4, "Make sure your Hide command is indented 4 spaces inside the Collision event!")
t2.add_failure(tval3 > 4, "Oops! Make sure your Hide command is indented only 4 spaces inside the Collision event!")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.