Education 2018.1 Help

Educator Start Guide

With Educational Products, you can learn and teach programming languages in the form of coding tasks and custom verification tests right inside of JetBrains IntelliJ Platform based IDEs.

Educational Products support Java, Kotlin, and Python, with more to come.

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

You can switch to a different programming language using the Section drop-down menu at the top of the page.

Creating a course

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

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

    edu new course java
    edu new course kotlin
    edu new course python
  3. Every course created with your IDE 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,
    • Tests.kt file with the task check,
    • any other files needed for the learner to complete the task.

    Go to View | Tool Windows | Project or invoke Alt+1 to look at the course structure:

    edu course structure java
    edu course structure kotlin
    edu course structure python
  4. Add more lessons and tasks via the File Menu | New, drag-n-drop items to reorder them.

    To rename items right-click them then in the menu use Refactor | Rename or invoke Shift+F6:

    edu rename task java
    edu rename task kotlin
    edu rename task python

Working with tasks

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

    class HelloJava { public static void main(String[] args) { System.out.println(sayHello()); } private static String sayHello() { return "Hello, Java!"; } }
    fun hello(): String = "Hello, Kotlin!" fun main(args: Array<String>) { println(hello()) }
    def hello(): return "Hello, Python!" print(hello())
    edu task code java
    edu task code kotlin
    edu task code python
  2. Click on the Run icon run 2x gutter in the left gutter to run your code and check if it works as expected:

    edu task run java
    edu task run kotlin
    edu task run python
  3. 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:

    edu answer placeholder java
    edu answer placeholder kotlin
    edu answer placeholder python
  4. 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 | Preview Task File:

    edu task preview java
    edu task preview kotlin
    edu task preview python
  5. Now it's time to add the task description. Click the Edit icon edit 2x edu at the top of Task Description panel to switch to the editing mode:

    edu task description edit java
    edu task description java
    edu task description edit kotlin
    edu task description kotlin
    edu task description edit python
    edu task description python

Writing tests

  1. You can write your custom tests to automatically verify the learner's solution. Every task has a Tests.kt file that you will need to modify:

    edu test file java
    edu test file kotlin
    edu test file python
  2. Let's replace the test file content with the following:

    import org.junit.Test; import static org.junit.Assert.*; public class HelloJavaTest { @Test public void testSolution() { assertEquals("You should say hello to Java", "Hello, Java!", HelloJava.sayHello()); } }
    import org.junit.Assert import org.junit.Test class Test { @Test fun testSolution() { Assert.assertEquals("You should say hello to Kotlin", "Hello, Kotlin!", hello()) } }
    from test_helper import run_common_tests, failed, passed, get_answer_placeholders def test_answer_placeholders(): placeholders = get_answer_placeholders() placeholder = placeholders[0] if placeholder == '"Hello, Python!"': passed() else: failed("You should say hello to Python") if __name__ == '__main__': run_common_tests() test_answer_placeholders()
  3. To check that your code passes your own tests go back to Task.kt and click the Check icon at the top of Task Description panel. If your code and test are correct, you will see the "Congratulations!" text:

    edu congratulations java
    edu task checked java
    edu congratulations kotlin
    edu task checked kotlin
    edu congratulations python
    edu task checked python

Course preview

  1. 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:

    edu course preview java
    edu course preview kotlin
    edu course preview python
  2. So you can solve tasks and verify them with the check task 2x edu icon:

    edu course preview java 1
    edu course preview java 2
    edu course preview kotlin 1
    edu course preview kotlin 2
    edu course preview python 1
    edu course preview python 2

    Ask for a hint with show hint 2x edu icon:

    edu course preview java 3
    edu course preview java 4
    edu course preview kotlin 3
    edu course preview kotlin 4
    edu course preview python 3
    edu course preview python 4

Course sharing

  1. 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.

  2. 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 2x edu icon:

    edu import course java
    edu course imported java
    edu import course kotlin
    edu course imported kotlin
    edu import course python
    edu course imported python
  3. If you have an account on Stepik, you can easily upload your course there, update it anytime you need, and share publicly or privately.

Last modified: 5 April 2018