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 instructors 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 Udemy’s AI tool
Which programming languages are available?
Instructors can create coding exercises in various languages, some of which include C++, C#, Java, Python, Ruby, Swift, Web Development and PHP, among others. Review all the programming languages that are available for coding exercises.
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.
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. For advice and best practices on creating coding exercises, please review this Teaching Center resource.
1. Move your cursor to the exercise title and click on the pencil icon that appears to begin creating the exercise.
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) .
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.
Please 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.
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.
7. Next, check the exercise’s solution by clicking Run tests at the bottom of the page.
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.
Please note: coding exercises will only appear published in the curriculum of published courses.
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, eligible, coding exercise following the instructions outlined above (steps 1-5), click Generate with AI at the beginning of the files section.
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.