t = codesters.Teacher()
try:
tval1 = int(t.get_parameters_for_function('rotate_origin')[0][0])
except:
tval1 = "DNE"
try:
tval2 = sprite.get_x()
tval3 = sprite.get_y()
except:
tval2 = "DNE"
tval3 = "DNE"
try:
tval4 = t.find_text('sprite.')[0][1]
except:
tval4 = "DNE"
if tval1 == 270 and tval2 == 50 and tval3 == -100 and 'rotate_origin' in tval4:
text.set_text(' ')
t1 = TestObjective()
t1.add_success(tval1 == 270 and tval2 == 50 and tval3 == -100 and 'rotate_origin' in tval4, "Great job!")
t1.add_failure(tval4 == "DNE", "Try a Geometry Transformation command that maps your sprite to the target!")
t1.add_failure('reflect' not in tval4 and 'translate' not in tval4 and 'rotate' not in tval4 and tval4 != "DNE", "Oops! Did you use a command from a different section?")
t1.add_failure('reflect' in tval4 or 'translate' in tval4, "Try a transformation that TURNS your sprite about the origin.")
t1.add_failure('about' in tval4, "For this problem, try using a Rotation about the Origin.")
t2 = TestObjective()
t2.add_success(tval1 == 270 or tval1 == -90, "Great job!")
t2.add_failure(tval1 < 270, "Not quite there! Try increasing your rotation angle.")
t2.add_failure(tval1 > 270, "Oops! That's a little too far! Try making your rotation angle smaller.")
t3 = TestObjective()
t3.add_success(tval2 == 50 and tval3 == -100, "Great job!")
t3.add_failure(tval2 != 50 or tval3 != -100, "Oops! Did you change your sprite's position before the transofrmation?")
tester = TestManager()
tester.display_graphics = False
tester.add_test_list([t1, t2, t3])
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.