Why is Gradescope giving me errors?

Our testing script in Gradescope tests each individual function separately, so Gradescope may pick up some problems with code that seems to function fine when run as a program in Thonny.

Here is some advice in response to errors we have seen in office hours:

  1. query_equation() needs to take a string as a parameter (not numops).
  2. query_equation() should not return a value.
  3. query_equation() should test if the difference between the user’s guess and the correct answer is <= 2 rather than < 2
  4. play_game() needs to call both random_equation() and query_equation(). Try to test your individual functions (instead of hitting the green arrow) as demonstrated in the Guide section.
  5. play_game() needs to record the start time before entering the while loop.
  6. Your program should not have any global variables that the required functions depend on to give the required output. (It’s OK to use global variables for creativity as long as it doesn’t mess up the expected functionality of the individual functions.)
  7. There should not be any lines that are outside of the function definitions.
  8. Make sure to delete the pass line in main(), and be sure to add code to launch the game in the main() function, not un-indented or outside of any function.