Skip to main content
Editing Student Code

Save changes you make to code in student assignments

Sara Jenis avatar
Written by Sara Jenis
Updated over a month ago
Free Feature

On CodeHS Free and Pro, you have the ability to edit and save code in student Assignments. With this feature, you can add comments or even make changes to student code while you are debugging or grading student work!

Note: Editing student code is currently not available in CodeHS Practice or Unit Test problems, activities which use Block Coding, or in the Intro to Programming with Karel the Dog units.

Saving Code Changes

When viewing a student assignment, you can edit and run the program. Once you click save, you will see a banner at the top of the page saying the code has diverged from the student work. You can choose to Push the code changes to the student's program or Revert to the previous version of the program.

When you Revert code

When you Push code

Your changes to the code will be removed from the program and the program will return to the latest version of student code. You will still be able to access your changes in the Code History.

Your changes will be saved to the student's program and a History timestamp will be created for the student to view in their Code History. Students will only see a History timestamp of your edits when the code is Pushed.

Once changes are Pushed to a program, students will receive a notification. In addition, when they open their program, they will see a pop up notifying them that a teacher has made changes to the code.

Gif showing popup notifying student that teacher made edits to the program

Note: If a student makes changes to their code while you are editing, the student's changes will save and you will see a pop up message notifying you that the code has diverged from your current view. A student's most recent changes will take precedence over a teacher's revisions. You can access your revisions by viewing Code History in the History tab.

Image showing message, "Student has made changes to this assignment since your last save. You can restore any of your previous versions from the history tab"

Viewing Code History

Both teachers and students will be able to view changes made to the program in the History tab. You can access the History tab in the top-right corner of any exercise by going to More > History.

Code History from the Teacher View:

Teachers will see revisions that have been made to the program with a timestamp. Timestamps will include the names of the teacher or student who has made the changes to the program.

Gif showing More>History Tab from Teacher view

Code History from Student View:

When students view their code history, they will see changes that have been made to the program with a timestamp. Changes that have been made by a teacher and Pushed to the student program will include the name of the teacher who made the changes.

Gif showing more>history tab from student view


Still have questions? Contact our team at hello@codehs.com to learn more!

Did this answer your question?