stage.set_background("schoolentrance")
sprite = codesters.Sprite("person10")
sprite.go_to(-125, -100)
emma = codesters.Sprite("person8")
emma.move_down(125)
emma.say("Someone took my phone!")
stage.wait(2)
emma.say("They've been sending people mean texts pretending to be me!")
stage.wait(2)
sprite.say("What should I do?")
stage.wait(2)
choice = sprite.ask("a) tell a trusted adult b) tell people Emma is sending the messages c) ignore Emma")
t = codesters.Teacher()
try:
tval1 = int(t.get_parameters_for_function('Text')[0][1])
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 0, "Great job!")
t1.add_failure(tval1 == "DNE", "Did you add a Text at Position command?")
t1.add_failure(tval1 == 100, "Did you change the x-coordinate in the Text command?")
t1.add_failure(tval1 < -250 or tval1 > 250, "Oops! Did you move your text off the stage?")
t1.add_creative(tval1 != 0 and tval1 != "DNE", "That's a good place for Text, too!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
提交作品
-
下个活动
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)