Blocks in CodeHS Courses
Blocks allow you to drag and drop pieces of code together instead of typing everything out. If your teacher allows blocks for your course, you can switch back and forth between "Block View" and "Code View" in the code editor. How you turn blocks on or switch views depends on which type of program you're working in:
HTML and JavaScript Karel Programs
From your code editor, click the Blocks icon in the left sidebar, then switch between Blocks and Code using the two buttons that appear:
When you're in Code View, the block palette is grayed out. To get back to blocks, click Blocks up top next to Code, or press Switch to Block Coding to use the palette:
If your teacher has turned on block coding for you, you can enable coding with blocks by default for HTML/JavaScript Karel programs. You can do this by clicking the gear icon in the left sidebar of the code editor, and toggle on Code with blocks by default:
Coding in Art/Music/Sports Programs
If blocks are allowed, you will see a dropdown menu next to the Share button in the top right of the code editor. You can use this dropdown menu to switch between block coding and regular text coding:
Python Turtle (Blocks) Programs
You can use block coding for Python Turtle programs in the sandbox (not available in Python Turtle Assignments).
To do this, Go to the Block Coding filter and select Python Turtle (Blocks) when creating your sandbox program.
Note: switching to text coding isn't an option for "Python Turtle (Blocks)" Sandbox programs
Can I ask my teacher to enable blocks?
You can reach out to your teacher to ask if they can enable blocks by going to More > Conversation near the top-right corner of your code editor.
Here, you can ask them to enable blocks for the assignment you're working on:
Blocks in the CodeHS Sandbox
Even if your CodeHS course does not allow blocks, you can use blocks in Sandbox programs.
Blocks are available for the following languages/Sandbox program types:
Karel in JavaScript
HTML
Coding in Art, Music, or Sports
Python Turtle (Blocks) Sandbox programs
To create a block coding sandbox program, choose Block Coding under "Choose a Language," then pick your program type. These programs will open with block coding enabled.
If you have an already-existing HTML/JavaScript Karel program and would like to turn on block coding, click the gear icon in the left sidebar and toggle Use block coding (you'll have to refresh to see the changes):
Still have questions? Ask your teacher!








