Autograder Help #121
-
First of all, new here... so hopefully I am posting this in the correct thread. I am a mathematician, not a programmer. I can usually figure out how to write algorithmically based programs, but am struggling on getting my autograder to work. I downloaded the example autograder for the calculator example off of gradescope and attemted to edit it. I have a setup.sh, requirements.txt, run_autograder, run_test.py and a folder with the tests.
run_tests.py says:
Inside the test folder, I have an init.py file and two test. One is below:
The corresponding program solution is:
Which is inside a file called problemset1.py. While the autograder compiles, when it attempts to autograde the assignment it returns messages: Any help as to where I went wrong would be greatly appreciated. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The error you're seeing is from your testing file. In particular, the line
What you're trying to do here is to set In your case, if the satisfied_checker() program is a function [which is fine], then you don't need to call it here. Instead, you can simply do
Then, future calls to However, once that's fixed, you'll still run into problems because of the lines of the form
Note the example If it makes things simpler, I would probably just replace all instances of |
Beta Was this translation helpful? Give feedback.
The error you're seeing is from your testing file. In particular, the line
What you're trying to do here is to set
self.calc
to be the satisfied checker function, but this line of code is actually attempting to call the function. Note that in the example code, theCalculator()
call of a similar form is instantiating aCalculator
class object [which is effectively calling the constructor method of theCalculator
class, which doesn't happen to take any arguments].In your case, if the satisfied_checker() program is a function [which is fine], then you don't need to call it here. Instead, you can simply do
Then, future calls to
s…