t = codesters.Teacher()
walls = t.find_text('disable_all_walls')
try:
tval0 = bool(walls)
line_num = walls[0][0]
tval0b = t.get_indent_at_line(line_num)
except:
tval0 = "DNE"
tval0b = -1
try:
defs = t.find_block('def')
tval1 = defs[0][1]
except:
tval1 = "DNE"
try:
handlers = t.find_text('event_click')
tval2 = handlers[0][1]
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval0 and tval0b == 0, "Great Job!")
t1.add_failure(tval0 == "DNE", "Did you add Disable All Walls?")
t1.add_failure(tval0b > 0, "Oops! Did you put Disable All Walls indented in the event?")
t2 = TestObjective()
t2.add_success('click()' in tval1 and 'stage.event_click(click)' in tval2, "Great Job! Be sure to click on the mouth!")
t2.add_failure(tval1 == "DNE", "Did you add Click on Stage?")
t2.add_failure('click(sprite)' in tval1, "Did you add a sprite event instead of a stage event?")
#t1.add_failure(tval2 == 'stage.event_click(click)', "Did you assign the event to mouth by changing sprite to mouth before .event_click(click)?")
t2.add_failure(tval2 != 'stage.event_click(click)', "Did you delete the line stage.event_click(click)?")
#t1.add_creative('click(sprite)' not in tval1 and 'click()' not in tval1 and tval1 != "DNE", "You added a different event! Creative choice!")
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.