t = codesters.Teacher()
try:
tval1 = t.find_function('choice')[0][1].replace(' ', '')
tval1_line = t.find_function('choice')[0][0]
tval1a = t.get_indent_at_line(tval1_line)
except:
tval1 = "DNE"
tval1_line = "DNE"
tval1a = "DNE"
try:
tval2 = t.find_function('event_interval')[0][0]
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 'info_img=random.choice(my_info)' and tval1_line < tval2 and tval1a == 4, "Great job!")
t1.add_failure(tval1 == "DNE", "Did you add a Random Choice command to your Interval Event?")
t1.add_failure('info_img' not in tval1, "Did you change the name of your Random Choice command to info_img?")
t1.add_failure('my_info' not in tval1, "Did you change the name of the list in parentheses to my_info?")
t1.add_failure(tval1_line > tval2, "Oops! Did you put your Random Choice command inside your Interval Event?")
t1.add_failure(tval1a < 4, "Make sure your Random Choice command is indented in your event 4 spaces.")
t1.add_failure(tval1a > 4, "Make sure your Random Choice command is indented only 4 spaces inside your event.")
tester = TestManager()
tester.add_test_list([t1])
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.