disabled
Back To Udemy

Sign in
English (US) Deutsch Español Français (France) 日本語 한국어 Português 简体中文
  • Sign in
  • English (US) Deutsch Español Français (France) 日本語 한국어 Português 简体中文
Search for solutions
Student Topics
Instructor Topics
Udemy Business Topics
Read article
Combined Results
Do these help?
What's this?
Udemy Business
If you need assistance, please reach out to {{HREF}}
See all {{COUNT}} articles
  1. Udemy Business
  2. Building Custom Courses
  3. Creating Content

How to Create a Coding Exercise

Coding exercises are an interactive tool you can add to your programming courses, so your learners can get practical coding experience. This article outlines how course creators can add a coding exercise to their course curriculum. 

Table of contents

  • Which programming languages are available?
  • How to add a coding exercise to your course curriculum
  • How to create a coding exercise
  • How to create the exercise solution and evaluation files with AI

Which programming languages are available?

Course creators can create coding exercises in various languages, some of which include C++, C#, Java, Python, Ruby, Swift and PHP, among others. 

How to add a coding exercise to your course curriculum

Before you can enter the exercise’s solution, the first step you’ll need to take is to add a coding exercise to your course curriculum.

1. Navigate to the Curriculum page of your course.

2. On the side, hover your cursor over the grey space within a section, where you want the exercise to be placed. Click the + icon that appears and then Coding Exercise.
Add coding exercise.png

3. Enter the exercise’s title and then click Add Coding Exercise.

4. Plan and create the exercise you would like learners to solve by following the steps outlined in the section below.

How to create a coding exercise

Once you’ve added the coding exercise to your course curriculum, you can create the exercise by following the steps below. 

1. Move your cursor to the exercise title and click on the pencil icon that appears to begin creating the exercise.

pencil.jpg

2. Select the programming language for the exercise.

3. On the Plan exercise page, re-enter the exercise title as well as its learning objective (optional) . 

Coding excercise.jpg

4. Next, create the solution on the Author solution page. Enter the solution in full, which includes the evaluation and solution file. You can enter your own solution or select an example solution from the View examples, which can be accessed at the top of the screen.

Note: Depending on the programming language for the exercise, you may be able to use AI as an assistive tool to help you draft the exercise solution and evaluation files. Please review the section below regarding the AI tool for more information.

view examples.png

 5. After creating the solution, clearly communicate the purpose and problem of this exercise on the Guide learners page, and author the Learner file. A Learner file is the code that is needed at the beginning to frame the exercise to keep the learner focused on the targeted skill.

6. In addition to inputting the code and solution for the exercise, you can provide related lectures, as well as hints,  which learners can revisit to get more information on how to solve the problem. 

You can also write a detailed explanation for the Instructor solution to highlight key concepts that learners can review to help comprehend the exercise and solution.

Depending on the programming language for the exercise, you can also select Run Code to view the output of your code before running a test.

run code.png

7. Next, check the exercise’s solution by clicking Run tests at the bottom of the page.

run tests.png

8. If the solution is correct, click Save at the top right hand of the page, and then Publish to make the exercise accessible to learners. You can also preview the coding exercise by clicking on Preview.
save_and_publish_exercises.png

Please note: coding exercises will only appear published in the curriculum of published courses.

published_coding_exercise.jpg

If the course is not published, then a checkmark will not appear beside the coding exercise when it's been added to the curriculum.

How to create the exercise solution and evaluation files with Udemy’s AI tool

Instructors can also quickly use Udemy’s AI tool, powered by a third party LLM and made available on a limited basis, as an assistive tool to help draft the solution and evaluation files for eligible coding exercises (e.g., Python, C++, Java and Web Development). Note that by using this functionality, you're agreeing to the additional terms.

  • Please note that currently this feature is available for only English and Spanish language coding exercises. We plan to release this feature in more languages over the coming weeks.

To create a solution or evaluation file using this AI tool, please follow the steps below:

1. After you’ve started creating a new coding exercise following the instructions outlined above (steps 1-5), click Generate with AI at the beginning of the files section.

generate_files_with_ai.png

2. Within seconds, you will see a draft exercise, a solution, and evaluation files generated for your exercise.

3. Review carefully and make any changes. Note that by default, the exercise file (the code learners will see in the console when they begin the exercise) will match the solution file. You'll need to decide how much of the solution to keep as a starting point for your learners.

4. Click Save and then Publish.

Please note that the Generate with AI feature can be used up to 50 times, per user, within a 24 hour period. 

Was this article helpful?
1 out of 1 found this helpful

Related articles

  • Empowering Customers With AI-powered Learning Tools
  • Udemy’s GenAI Tools: Frequently Asked Questions
  • Learning With Coding Exercises
  • Create a Practice Test
  • How to Create Assignments For Your Course
Contact Us

Related articles

  • Empowering Customers With AI-powered Learning Tools
  • Udemy’s GenAI Tools: Frequently Asked Questions
  • Learning With Coding Exercises
  • Create a Practice Test
  • How to Create Assignments For Your Course

Need Help?

Contact Us
'coding exercise','coding assignment','code','How to Create a Coding Exercise',
English (US) Deutsch Español Français (France) 日本語 한국어 Português 简体中文
  • Udemy.com
  • About us
  • Events
  • News
  • Investor Relations
  • Careers
  • Terms & conditions
  • Privacy policy
  • Cookie settings
  • Sitemap
  • Accessibility statement
Udemy
© 2025 Udemy, Inc.
true