t = codesters.Teacher()
txt_func = t.get_parameters_for_function('Text')
try:
tval1 = txt_func[0][0]
except:
tval1 = "DNE"
try:
tval2 = int(txt_func[0][1])
except:
tval2 = "DNE"
try:
tval3 = int(txt_func[0][2])
except:
tval3 = "DNE"
try:
tval4 = txt_func[0][3]
except:
tval4 = "DNE"
t1 = TestObjective()
t1.add_success('Hello' in tval1 and "red" in tval4, "Great job!")
t1.add_failure(tval1 == "DNE" or tval2 == "DNE" or tval3 == "DNE" or tval4 == "DNE", 'Did you add a Text in Color command?')
t1.add_failure('Hello' in tval1 and tval4 == "DNE", "Did you add a Text in Color command?")
t1.add_creative("red" not in tval4 and tval4 != "DNE", "That's a good color too!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
Try the following steps to connect to your Micro:bit:
1. You may need to reload this page and try your program again.
2. Try disconnecting and reconnecting your Micro:bit. Then reload the page and run your program again.
3. If you are still having problems your Micro:bit may have an old
firmware version that is incompatible with Codesters.
To update the firmware follow these instructions from Micro:bit
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.