t = codesters.Teacher()
widths = t.get_parameters_for_function('pen_width')
width_line = t.find_text('pen_width')
try:
tval1a = int(width_line[0][0])
tval1b = t.get_indent_at_line(tval1a)
except:
tval1a = -1
tval1b = -1
try:
tval2 = widths[0][0]
except:
tval2 = "DNE"
t1 = TestObjective()
t1.add_success(tval2 == 'width' and tval1b == 4, "Great job!")
t1.add_failure(tval2 == "DNE", "Did you drag Pen Width into your a_key() event?")
t1.add_failure('"' in tval2 or "'" in tval2, "Oops! Did you put width in quotes?")
t1.add_failure(tval2 != 'width', "Did you change the argument in .pen_width()?")
t1.add_failure(tval1b > 4, "It looks like you indented too far. Make sure your Ask for Integer command is only 4 spaces in.")
t1.add_failure(tval1b < 4, "Make sure your Ask for Integer command is indented 4 spaces in your event block.")
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.