CS 61A uses a program called
ok to test and submit homework
assignments, labs, and projects.
Every programming assignment will include a
.zip archive that
contains the following:
- Starter code
- A copy of
After extracting the contents of the archive, you can begin your assignment.
Signing in with OK
To get started, open your terminal, and
cd into the right directory
(you should see a file called
ok when you
ls in the right
Try the following command:
This runs the tests (don't worry if the tests fail at first; you haven't written code yet!).
The first time you run
ok, you will be asked your
bCourses email address.
Make sure you use your bCourses email address. We use this email address to post grades on bCourses.
After typing in your email, your web browser will open an
authentication page. Click "Accept" to authenticate
If you typed your email incorrectly, you can re-authenticate with the following command:
python3 ok --authenticate
Testing with OK
After writing some code, you can test your code with
ok in various
Test specific questions
To test a specific question, use the
-q option with the name of the
python3 ok -q <function>
Test all questions
You can run all the tests with the following command:
Display all tests
By default, only tests that fail will appear. If you want to see
how you did on all tests, you can use the
python3 ok -v
If you do not want to send your progress to our server or you have any
problems logging in, add the
--local flag to block all communication:
python3 ok --local
When you are ready to submit, run
ok with the
python3 ok --submit
ok will display a submission URL, with which you
can view your submission on okpy.org.
You can go to okpy.org to check your submissions and backups. Make sure you sign in with your bCourses email.
I can't authenticate!
- Double check your internet connection.
okis known to have problems on Airbears. If you're on campus, try using Airbears2