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 and Code view in the Code Editor.

If blocks are allowed, you will see a bar near the top that says "Switch to Block View":

Switch to Block View in code editor

Or, "Switch to Code View:

Switch from block view to code view

Change Default Preferences for Blocks

To set your default preferences, click the gear icon in the top-left of the Code Editor.

Change code editor settings using wheel icon in top left corner

Then, toggle this option to automatically display blocks when your teacher has allowed them:

Change default settings preference using check mark

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:

Click More and then Conversation to communicate with your teacher

Blocks in the CodeHS Sandbox

Even if your CodeHS course does not allow blocks, you can use Blocks in Sandbox programs.

Blocks are only available for the following languages / Sandbox program types:

  • Karel in JavaScript
  • HTML
  • Coding in Art, Music, or Sports

To toggle blocks, click the gear icon in the upper-left and toggle Block/Text settings (you will have to refresh to see the changes):

Enable blocks in the Sandbox by changing editor settings

Your view may also look like this:

Change code editor settings

Still have questions? Ask your teacher!

Did this answer your question?