Edit Page

Teaching Kotlin with EduTools plugin

This tutorial will walk you through creating a simple Kotlin course with a set of programming tasks and integrated tests.

With EduTools plugin you can learn and teach Kotlin through code practicing tasks. It is available both in Android Studio and IntelliJ IDEA. This tutorial describes course creation for an educator. If you want to use EduTools plugin for learning, read "Learning Kotlin with EduTools plugin".

Installing EduTools plugin

Go to Preferences -> Plugins (or Configure -> Plugins from the Welcome Screen), press Install JetBrains Plugin… and search for EduTools plugin:

Installing EduTools plugin

When installed for the first time, EduTools plugin asks if you're a Learner or an Educator. Please choose Educator to enable course creation functionality:

Educator role

If you need to enable the course creation functionality later, you can go to Help Menu -> Enable Course Creator Features.

Creating a course

To create a course, go to Create New Course from the Welcome Screen or in the File Menu, fill in the title, author and description:

Creating a course

Every Kotlin course created with EduTools is structured as a list of lessons. Each lesson contains tasks. A task has the following components: a description, a Task.kt file with exercise code, a Tests.kt file with the task check, and any other files needed for the learner to complete the task.

Go to View -> Tool Windows -> Project to look at the course structure:

Course structure

Add more lessons and tasks via the File Menu -> New, drag-n-drop items to reorder them, or to rename items right-click them then in the menu use Refactor -> Rename:

Rename a task

If you need additional files for the task, just add them and decide whether you want to make them visible to learners or not with the Course Creator -> Make Visible to / Hide from Student.

Working with tasks

Open Task.kt file to write the code you want for the exercise:

Task code

Once the code is ready, select a fragment you want a learner to fill in, invoke Add Answer Placeholder command from the right-click menu and add the placeholder text and some hints to help the learner find the right solution:

Answer placeholder

If you want to see how your task will be look to the learner, right-click the Task.kt file in the Project tool window, and choose Course Creator -> Show Preview:

Task preview

Now it's time to add the task description. Click the Edit icon at the top of Task Description panel to switch to the editing mode:

Task description editing
Task description preview

EduTools supports HTML and Markdown, so you can start editing with your preferred format, or even a combination of both.

Writing tests

You can write your custom tests using EduTools testing framework to automatically verify the learner's solution. Every task has a Tests.kt file already filled in with a test template that you will need to modify:

Test file

Let's replace testSolution() function content with the following:

Write test

To check that your code passes your own test click the Check icon at the top of Task Description panel. If your code and test are correct, you will see the "Congratulations!" text:

Write test

Course preview

When you have finished creating your course, it's a good idea to view your course from a learner's perspective and test it. Right-click on the course view and go to Course Creator -> Create Course Preview to open your course in learner mode:

Course preview

So you can solve tasks:

Course preview

And verify them:

Course preview

Course sharing

You can share your learning materials publicly or privately with your students or co-workers on Stepik, a learning management and MOOC platform. Or you can save your course as an archive file.

To save your course as a zip file, go to Course Creator -> Generate Course Archive action. The generated archive can be opened via the Browse Courses available from the Welcome Screen and in the File Menu with the Import Course icon:

Import course

Import course

If you have an account on Stepik, you can easily upload your course there, update it anytime you need, and share publicly or privately.