COX / AP / 01
AP Computer Science A
The Java AP course, live.
Open the syllabusUnited States · Middle and high school · CodeHS
CodeHS is a browser-based coding platform used in school computer science classes from Karel the Dog all the way to AP Computer Science A. When it goes wrong, it tends to go wrong in the same handful of ways: the Check Code button stops responding, a unit test fails even though the code looks right, the autograder complains about style, or the login sends you to the wrong account. CodeHS documents every one of these in its own help center. This page collects those fixes in one place, adds small examples of our own, and is clear about one thing from the start: we explain how things work, and we do not hand out answers to assignments.
Live teaching since 2020 · 10,000+ students · Java, Python and JavaScript
In short
Most CodeHS problems have documented fixes. A frozen Check Code button usually means an infinite loop. To start an exercise over, open More, then History, choose Reset Code and press Save. In unit-test exercises, write and run your function in the Scratchpad, and make it return a value. For login trouble, use your school email or your class’s Google, Clever or Canvas sign-in. Modern Age Coders teaches this live online for US students, in a batch or one to one, and the first class is free.
Learn it with a teacher
Live lessons that teach the ideas behind the exercises, so the CodeHS work makes sense.

COX / 01
Java for the AP exam, unit by unit, alongside your school course.
Open the syllabus →
COX / 02
The big ideas, the exam and planning a Create task of your own.
Open the syllabus →
COX / 03
Ages 13 to 18. Functions, loops and testing, from first principles.
Open the syllabus →Find your problem
Each row is a problem CodeHS documents in its help center, with the fix it gives. Start with the row that matches your screen.
| What you see | What CodeHS says it usually means | What to try |
|---|---|---|
| The browser freezes or crashes after Run or Check Code | The code contains an infinite loop | Comment out loops one at a time to find it, then make sure its condition can become false |
| The Check Code button does nothing | An error in your code, or an infinite loop | Run the program first and read any error message |
| You want to start an exercise again | Reset Code restores the starter code | More, then History, then Reset Code, then Save |
| A unit test freezes after Check Code | User input inside a unit-test function, or no return value | Remove input the instructions did not ask for; make the function return |
| A Karel exercise fails on style | The general Karel autograder checks syntax, indentation and naming | Read the exact Style message; it names the line or function |
| Your HTML page shows No CodeHS.me Site Here | The program was blocked, or a link does not match a filename | Check whether your links and filenames match exactly |
| The cursor is misaligned on a Chromebook | The browser font is not monospace | Set Chrome’s fixed-width font to one with Mono in its name |
| A lesson video will not play | The video host is blocked on the school network | Use the CodeHS-hosted version of the video, or the lesson slides |
CodeHS says Reset Code is available for both teachers and students, and that after clicking it you must save the change with the Save button. It returns the exercise to its starter code, so anything you wrote is replaced.
Before resetting, look through the History tab. CodeHS describes it as a list of every previous version of your program, which often lets you recover the last version that worked instead of starting from nothing.
CodeHS has a built-in way to message your teacher about a specific exercise: open the More tab in the code editor and choose Conversation. Replies appear in your Inbox, under the bell icon.
Asking there, with the exercise open, is usually faster than an email, because your teacher can see the exact code you mean.
Sources: CodeHS help center articles on code that crashes the browser, resetting your code and sending questions to your teacher, read 17 October 2026. We are not connected with CodeHS.
Debugging tools
CodeHS lists five tools for students in its debugging article, plus a separate step debugger for some program types. Most students use one or two of them. All of them help.
| Tool | Where it is | What it is good for |
|---|---|---|
| Docs tab | In the code editor | Examples and syntax of the concepts your course has covered so far |
| History tab | Under More | Every earlier version of your program, to see what changed since it last worked |
| Speed slider | In the editor | Running code slowly to see where it goes off track |
| Next and Last buttons | Top of the editor | Running one line at a time to find the exact line at fault |
| Test Code button | Red button in the editor | Seeing which autograder tests pass; a progress bar counts them |
| Step debugger | Gear icon, then Debug Mode | Pausing a Python 3, Python 3 Graphics (tkinter) or Java (main) program and stepping through it |
# ours: why the Run button seems dead
count = 0
while count < 3:
print("checking", count)
# count never changes, so count < 3 stays true
# the fix: change the variable the condition tests
count = 0
while count < 3:
print("checking", count)
count += 1
print("done")Ours, run with Python 3.13.6 outside CodeHS. The first loop printed checking 0 without end until we stopped it; the second printed checking 0, 1 and 2, then done. CodeHS’s own questions apply: in a while loop, will the condition ever become false?
CodeHS describes five debugger functions: Run, which runs normally; Step, which moves to the next command even inside another file or library; Next, which moves to the next command in the current file; Continue, which runs until the end or a crash; and Stop.
Most students only need Next. Press it, watch which line lights up, and check whether the variables hold what you expected at that moment.
CodeHS recommends commenting out sections and re-running, so the skipped code tells you by elimination where an error lives. For infinite loops, it suggests testing sections with for or while loops first, then if and else statements, then the rest.
It is a slow method, but it never fails, and it works in every language and every editor you will ever use.
Sources: CodeHS help center, tips on debugging code and using the step debugger, read 17 October 2026.
Unit tests and the Scratchpad
Many CodeHS exercises in Python, JavaScript and Java are graded by unit tests. CodeHS explains how they differ from a normal program, and the difference trips up a lot of students.
| Unit Test file | Scratchpad file | |
|---|---|---|
| Graded? | Yes | No |
| Can you Run it and print? | No: it can not Run or print to the console | Yes: it can Run and print to the console |
| What belongs in it | A fully working function that works as expected | Experiments: different inputs, print statements, mistakes |
| What CodeHS requires | A Unit Test requires a return statement and does not ask for user input | Anything that helps you test the function |
# Scratchpad (ours): prints the answer, returns nothing
def add_tax(price):
print(price * 1.08)
result = add_tax(50)
print("result is", result)
# output
54.0
result is NoneOurs, a made-up example, not a CodeHS exercise. It looks right because 54.0 appears on screen, but the function hands nothing back, so result is None. A unit test checks what the function returns, and would see None.
# Scratchpad (ours): returns the answer instead
def add_tax(price):
return round(price * 1.08, 2)
print(add_tax(50))
print(add_tax(0))
print(add_tax(19.99))
# output
54.0
0.0
21.59Ours, run with Python 3.13.6. CodeHS suggests testing edge cases such as zero and negative inputs in the Scratchpad; we add a value that is not a round number, like 19.99, then copy the working function into the Unit Test file.
CodeHS gives four steps: copy the starter code from the Unit Test into the Scratchpad; write and test your function in the Scratchpad, where you can run it; copy the working function back into the Unit Test file; and when it passes all the checks, submit it.
If the program will not run, CodeHS points out that the green Run button only runs the Scratchpad, not the Unit Test file, and that you need to both define and call the function to see anything.
Students sometimes ask why CodeHS will not just show what the test expected. The test is there to check your function, and the exercise is there to teach you to write it. That is the same reason we teach the idea of returning a value rather than supplying the function.
A good question to ask yourself instead: if someone called my function with a value I did not try, what would it give back?
Source: CodeHS help center, using the Scratchpad and Unit Test files, read 17 October 2026.
Karel autograder messages
Karel exercises use a general autograder that applies a set of tests to each program, from the final world to the way functions are named. CodeHS publishes the common messages. Here is what each one asks you to check.
| Message | What it checks | What to look at |
|---|---|---|
| Functionality: World _______ | Karel’s location, ball count and square colors at the end, against each Result World | Run it and compare your final world with the expected one |
| Style: You are missing a semicolon on the following lines: | That every command ends with a semicolon | The line numbers listed |
| Style: It looks like your indentation is off on line ___ | Indentation | Code inside a function or loop should be indented one level |
| Style: Some of your functions (FunctionName) do not start with a lowercase letter. | Function naming | Names like turnRight, not TurnRight |
| Style: You have a function function1 nested inside another function function2. | Functions defined inside other functions | Define functions one after the other |
| Style: You should not redefine turnRight()/turnAround() because SuperKarel already knows it. | Unneeded definitions in SuperKarel and UltraKarel | Delete your own turnRight or turnAround |
A program can make Karel finish in the right place and still fail on style, and the other way round. Fix the Functionality test first, because changing what the program does may change which style messages appear.
Then work through the Style messages in order. Each one quotes the exact name or line, so there is no guessing involved.
Naming functions in lowercase camelCase and indenting consistently are conventions every programmer follows, because code is read far more often than it is written. Karel is where CodeHS starts teaching that habit.
Students who build it early find their later Java and Python code much easier to debug, because they can see the structure at a glance.
Source: CodeHS help center, Karel autograder messages, read 17 October 2026.
Login, devices and versions
Some CodeHS problems have nothing to do with code. These are the ones CodeHS documents for signing in, school devices and language versions.
| Language | What CodeHS says |
|---|---|
| Python | Python 3.8, 3.11 and 3.12 are provided; Python 3, Python 3 Graphics (tkinter) and Pygame programs use 3.11 |
| Java | Most core courses currently use Java 8 (1.8); Java 21.05 is used in AP Computer Science A (Cortado), all new courses and all new Sandbox programs |
| JavaScript | ES6, the version all browsers use |
| Java, interactive | JShell, a Java read-eval-print loop, is supported |
Versions matter when code from a textbook, a website or a home computer behaves differently on CodeHS. A newer Java feature will not compile in a course still on Java 8. Sources: CodeHS help center, login troubleshooting, Chromebook cursor fixes and language versions, read 17 October 2026.
About answers
Search for CodeHS and the suggestions fill up with answer keys for every unit. We understand why: it is late, the test will not pass, and the deadline is tomorrow. Here is why we will not supply them, and what we do instead.
CodeHS exercises are graded by your teacher and the autograder. Copying an answer means handing in work that is not yours, and we will not take part in that.
CodeHS gives teachers settings such as copy and paste prevention, which in CodeHS Pro stops students in a section from pasting into the editor. Schools take this seriously.
CodeHS courses build step by step. An answer copied in unit 3 leaves a gap that the unit 5 exercise will find, usually at a worse moment.
The student shares their screen with the CodeHS exercise open. The teacher asks what the exercise wants, what the code does now, and what the autograder message says, and then teaches the idea that is missing, using a different example of our own.
The student then goes back to their exercise and writes the code themselves. It takes longer than copying, and it is the only version that helps on the next exercise and on the test.
CodeHS says its AP Computer Science A course (Cortado) runs Java 21.05. The AP exam itself is, in College Board’s words, a fully digital exam taken in the Bluebook app, so CodeHS is where you practice, not where you sit the test.
For exam-focused help alongside your school course, see our AP Computer Science A classes or AP CSP coaching.
Sources: CodeHS help center, copy and paste prevention; College Board, AP Computer Science A Exam. Both read 17 October 2026. AP is a trademark of College Board, which is not connected with us.
Getting unstuck
Where students usually are when they first search for CodeHS help, and where they can get to.
| Stage | What it looks like |
|---|---|
| 1. Stuck | Presses Check Code again and again, hoping for a different result |
| 2. Reading | Reads the autograder and error messages and goes to the line they name |
| 3. Testing | Uses the Scratchpad, the History tab and the debugger to check ideas |
| 4. Independent | Finishes exercises without help and can explain how the code works |
A child who is stuck on CodeHS at 10 pm needs to understand one idea, not to be given one answer.
Asking them to read the autograder message aloud is a surprisingly good first step, even if you do not code.
Run before you check. The Run output often shows the problem the autograder is hinting at.
Use History before Reset. Your last working version is usually still there.
The catalogue
Live teaching with a regular teacher, as a batch or one to one, in the same languages CodeHS uses.
COX / AP / 01
The Java AP course, live.
Open the syllabusCOX / AP / 02
Exam topics and the Create task process.
Open the syllabusCOX / AP / 03
Java before or beside AP CSA.
Open the syllabusCOX / LANG / 01
Functions, lists and testing.
Open the syllabusCOX / LANG / 02
Interactive pages and browser games.
Open the syllabusCOX / LANG / 03
The web design units, in depth.
Open the syllabusCOX / KID / 01
Events and loops in blocks.
Open the syllabusCOX / KID / 02
Typed code with turtle art and games.
Open the syllabusCOX / KID / 03
From blocks to first real apps.
Open the syllabusHow lessons run
Weekdays or weekends, flexible: choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.
Weekdays
Late afternoons and evenings in US time zones.
Weekends
A weekly slot away from the school rush.
1-on-1
Booked around unit tests and deadlines.
The same teacher, week after week.
Share the exercise; we teach the idea.
Different problems that teach the same concept.
Your CodeHS work stays yours.
Live and online, wherever you are.
Fifteen to twenty students, or one.
Student work
Projects from students who once worked through the same exercises. Browse more on the student labs page.

AI and ML
An AI nutrition coach that reads what you eat and works you toward a target.

AI and ML
A chatbot that answers mathematics and programming questions, built and deployed by a student.

AI and ML
An assistant that helps a young person recognise unsafe situations online.

Web app
A weather forecasting site with live conditions for any location.
Fees
CodeHS is provided by your school; our classes are separate. You pay for live teaching one month at a time, in US dollars, with nothing to sign for the semester and no cost for stopping at the end of any month.
Free first class
USD 0
no card required
Group batch
USD 100
a month, billed in US dollars
One to one
USD 150
a month, billed in US dollars
What families say
Word-for-word reviews that families posted on Google.
★★★★★
"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."
Ria Mukherjee
Parent
★★★★★
"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."
Samriddha Mondal
Student
★★★★★
"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."
Vansh Agarwal
Student
★★★★★
"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."
Sonam Oswal
Parent of Dhairya
★★★★★
"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."
Sonu Goyal
Parent
★★★★★
"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."
Ritu Kedia
Parent
Questions from students and parents
CodeHS says that if the browser freezes or the Check Code button stops responding, the code may contain an error or an infinite loop. Run the program first, read any message, and check that every loop has a condition that can become false.
Open More, then History, in the editor and click Reset Code, which restores the starter code. CodeHS says to save afterwards with the Save button. Look through History first, because an earlier working version may still be there.
A unit test checks what your function returns, not what it prints. CodeHS says a unit test requires a return statement and does not ask for user input. Test the function in the Scratchpad, then copy it back.
It is an ungraded file in unit-test exercises where you can run code, print and try different inputs. The Unit Test file is the graded one and cannot be run or print to the console.
It is a Karel autograder style message. CodeHS says the test checks that every command ends with a semicolon, and the message lists the lines where one is missing.
Click the gear icon in the editor and turn on Debug Mode. CodeHS says the step debugger works for Python 3, Python 3 Graphics (tkinter) and Java programs with a main method, with Run, Step, Next, Continue and Stop.
Use your school-issued email, not a personal one. If your class uses Google, Clever or Canvas, sign in through that. You can also use Forgot Password, or ask your teacher, who can update your password.
CodeHS says most core courses use Java 8, while its AP Computer Science A course (Cortado), all new courses and new Sandbox programs use Java 21.05. You can check any exercise under More, then About.
No. We do not provide CodeHS answers, answer keys or solutions to any graded assignment. We teach the concept with our own examples so you can solve the exercise yourself and explain your code.
Weekdays or weekends, flexible. Choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.
The first lesson is free. After that, classes are paid one month at a time, and the fees section of this page shows the amount in US dollars.
Elsewhere on this site
More for US students who code at school.
Every page we have for US families.
A step-by-step method for any bug.
Live AP CSA preparation.
Live AP CSP preparation.
Choosing an order for the two courses.
The basics behind the Python units.
App Lab help: events, variables, screens, sound and data, from the official docs.
Java cannot find symbol, decoded: real javac output, eight causes, numbered fixes.
BlueJ not working? Official fixes for install, VM errors, output and frozen runs.
Start here
Tell us which CodeHS course you are taking and which idea keeps tripping you up. The teacher plans the first lesson around that concept, with examples of our own.
If you would like to see a lesson first, how we teach walks through one; the courses page lists every syllabus.
WhatsApp us · +91 91233 66161 · connect@modernagecoders.com
We teach live over video, and our teachers are based in India, so there is no local branch to visit. WhatsApp is the fastest way for a US family to reach us.
A priority demo is a full class of about 45 to 60 minutes. After the class the mentor sends a written skill report and a personal learning roadmap on WhatsApp. If you enrol, the demo fee is adjusted against your first month's fee. Share your demo Order ID with us on WhatsApp and we take it off.
Book a priority demo