Embed a Coding Challenge into Your Course
Add a published coding challenge to a course as a Code Challenge lesson.
Add a coding challenge to your course as a Code Challenge lesson. Learners solve it in the built-in code editor, run test cases and submit their answer.
Before you start
- Create the coding challenge under Products > Code and publish it. Only published challenges can be embedded. See Create a coding challenge.
Step 1: Add a Code Challenge lesson
- Open your course. In a section, click Add Lesson, enter the Lesson Title, select Code Challenge and click Continue.
- The lesson shows Language, Total Marks, Maximum Attempts and Difficulty Level. These fill in once you embed a challenge.

Step 2: Embed the challenge
- Under Embed Code ("Embed a code to this lesson"), click From all codes to pick from your coding challenges, or From library to pick from the code library.
- In Add Code ("Select and add code"), search by name if needed, select one challenge, and click Add code.

You can embed one challenge per lesson. To add more challenges, add more Code Challenge lessons.
What learners see
Learners see the problem, a code editor in the challenge's language, and test cases. They can run their code and submit it, and see the result, such as Correct Answer.


Use cases
- Practice after a lesson: add a challenge right after a video on loops or arrays.
- Graded assignments: use Total Marks and Maximum Attempts to assess learners.
- Interview prep courses with a set of challenges by difficulty.
Troubleshooting & FAQs
- My challenge isn't in the list: publish it first. Only published challenges appear.
- Can learners solve it on mobile? Coding challenges are best solved on a computer.
What to do next
If you have questions, contact us at support@learnyst.com.