Skip to main content

Outline

This component is suitable for use when creating accessible courses.

The Code component lets you present formatted code content to your learners.

This article provides an overview of the Code component, component setup and behavior, and examples of Code component configurations.

Component overview


The Code component lets you present formatted code content to your learners. The Code component can be configured to display code line numbers along the left-hand side.

The Code component is fully responsive and can be added to your Evolve course as a left-handed, full-width, or right-handed component.

Component Set Up


To add this component, follow the steps in this article:

The Property Panel for the newly added component will then open automatically for you to customize set-up.

Or click anywhere on an existing component to open the Property Panel.


General section

In the General section:

Screenshot of Code component General settings

Add Title, or a Display Title, as needed. Display Title is seen by learners.

Screenshot of Code component General settings

Scroll down and add your Body. Use the text editor to style and format your text, as needed.

Screenshot of Code component General settings
  1. Add Instruction Text that tells users how to use the component.
  2. Include an Aria Label for screen readers, as needed.

Interaction Label section

In the Interaction Label section, you can enable an Interaction Label.

The Interaction Label allows you to add a widget before or after the Code component. This widget can display an icon and label prior to the Code component completion, which changes to a different icon and label once the Code component is completed.

Code section


Screenshot showing Code section of settings

In the Code section, you enter code content to be presented to learners.

Component examples


Below are examples that illustrate the Code component setup:

Example 1 – displays the Code component with example of html-code content.

Example 2 - displays the Code component with example of html-code content and the setting Show Line Number enabled.

Appearance section


Screenshot showing Code component Appearance settings
  1. In the Appearance section, you select Code Language for correct formatting of your Code component. Options to select from are javascript, html, css, python, java, csharp, and php.
  2. Select Code Style from the available themes docco, monokai, github, or tomorrowNight.
  3. Toggle to Show Line Numbers. With this setting enabled, code line numbers will be shown along the left-hand side in the Code component.
  4. Set Starting Line Number as needed.

Note: Set Starting Line Number requires Show line Numbers to be enabled.

Did this article help?

Let us know by leaving a star rating or review at the top of this article.