Kotlinlearncs.online LogoJava

    Innovations

    learncs.online puts technology to work to create a unique, interactive, and effective learning environment.

    We believe that technology can change the world. By learning computer science and programming, you too can create programs that solve problems, open up new opportunities, and generally make the world just a bit better.

    Here’s how we’ve applied our abilities as computer scientists and programmers to improving online education. All of the tools below are unique to learncs.online, and not available on other sites.(1)

    Playgrounds
    Playgrounds

    System.out.println("Learning Java is fun!");

    Our lessons are filled with playgrounds like the one above that allow you to run, edit, experiment, and generally play with code—right from your web browser, with requiring any additional software(2). They make programming more fun, and encourage the experimentation that leads to understanding. Like anything else, you learn how to program by doing—not watching.

    Our playgrounds support both Java and Kotlin:

    println("Learning Kotlin is also fun!")

    And our Java playgrounds support snippet mode, allowing us to mix top-level code and methods with class and interface declarations into more compact examples than Java normally allows:

    interface Speak {
    void speak();
    }
    class Dog implements Speak {
    public void speak() {
    System.out.println("Woof");
    }
    }
    class Cat implements Speak {
    public void speak() {
    System.out.println("Meow");
    }
    }
    // Snippet mode also supports top-level method declarations...
    public void talk(Speak speaker) {
    speaker.speak();
    }
    // And top-level (or loose) code
    talk(new Dog());
    talk(new Cat());

    For longer examples like the one above and on homework problems, editor contents are synchronized across sessions and devices for logged-in users.

    Our playgrounds are powered by Jeed, our own innovative and open source JVM execution and analysis toolkit.

    Interactive Walkthroughs
    Interactive Walkthroughs

    Our lessons combine text, code, videos, and a new interactive walkthrough component, originally developed for CS 124 at Illinois and now publicly available only on learncs.online. Walkthroughs combine audio with an animated code editor to create live coding examples that are fully interactive.

    U3lzdGVtLm91dC5wcmludGxuKCJIZWxsbywgd29ybGQiKTs=

    Students can pause the walkthroughs, experiment with the code themselves, and then resume where they left off.

    Walkthroughs are recorded directly in the browser, making it easy to add explanations and for others to contribute. CS 124 at Illinois course staff can and do contribute their own explanations, strengthening our materials and diversifying the voice with which the course speaks(3).

    Here’s an overview of how interactive walkthroughs work on the site and how easy it is for staff to record them:

    Homework
    Homework

    Each daily lesson concludes with a small homework problem. Like this one:

    Created By: Geoffrey Challen
    / Version: 2021.2.0

    Declare and implement a function called isOdd. isOdd should accept a single int argument and return true if it is odd and false otherwise. You will probably want to consider using the remainder operator (%) to complete this problem.

    You could also solve it in Kotlin!

    Created By: Geoffrey Challen
    / Version: 2021.2.0

    Let's write another simple function. Declare and implement a function called isOdd. isOdd should accept a single Int argument and return true if it is odd and false otherwise. You will probably want to consider using the remainder operator (%) to complete this problem.

    Our large and growing library of Java and Kotlin small problems is created and maintained using a novel tool that automatically generates a testing strategy from a reference solution. This eliminates the need to write or maintain test cases. For example, the grader for the problem above was generated entirely using the only following code:

    /*
    * Let's write another simple function.
    * Declare and implement a function called `isOdd`.
    * `isOdd` should accept a single `int` argument and return `true` if it is odd and `false` otherwise.
    * You will probably want to consider using the remainder operator (`%`) to complete this problem.
    */
    @Correct(name = "Is Odd", version = "2021.2.0", author = "[email protected]")
    @WrapWith
    public class Question {
    // TEMPLATE_START
    boolean isOdd(int argument) {
    return argument % 2 != 0;
    }
    // TEMPLATE_END
    }

    Our autograder generator also supports grading problems on object-design:

    Created By: Geoffrey Challen
    / Version: 2021.2.0

    Define a public class named Flop with a single public instance method named flip that takes no parameters and returns a boolean. Flop should also provide a single public constructor that accepts a boolean argument and sets the initial state of the Flop instance.

    Flop maintains one piece of private state: the boolean. Calling flip changes the boolean from true to false or false to true and returns the old (not the new) state of the boolean. So, for example:

    Note that the internal state should be private.

    More complex imperative programming questions:

    Created By: Geoffrey Challen
    / Version: 2021.2.0

    Declare and implement a method called countDNASubsequence. It should take two String arguments: the first a strand of DNA to examine, and the second a sequence to look for. It should return as an int the number of nonoverlapping times that the sequence appears in the strand. Both the strand and the sequence will be entirely made up of only the characters 'A', 'T', 'G', and 'C', corresponding to the DNA base pairs.

    For example, given the DNA strand AAAAAAAA and the sequence AA you should return 4, not 7, since the subsequence AA only appears 4 non-overlapping times in the strand.

    If DNA or sequence is null or empty you should return 0.

    And questions using more complex Java features, like lambda functions:

    Created By: Geoffrey Challen
    / Version: 2021.2.0

    Declare a public class Modifier providing one static method subtracter. subtracter takes a single int parameter and returns a method that implements the Modify functional interface:

    The returned "function" should implement modify so that it returns the argument passed to subtracter minus the argument to modify. So, for example:

    The correct solution to this problem is a single line lambda expression!

    Code Quality
    Code Quality

    In addition to correctness, our novel autograder provided by BeyondGrader also provides feedback on multiple aspects of code quality. We can’t read each of your submissions by hand, but we still want to help you learn to write code that is not only correct, but also good: properly formatted, not inefficient, idiomatic, and so on.

    BeyondGrader currently provides automated feedback on the following aspects of code quality for every submission to every homework problem on our site:

    We’re continuing to work on code quality checks, which we’ll deploy here to help you learn to write high quality code.

    Debugging Challenges
    Debugging Challenges

    We’ve also used our huge and growing set of student solutions to our small homework problems to create new debugging exercises. For each solution, we apply source-level mutation to create incorrect examples. Then students have the chance to solve them, but with a limit on how many lines they can modify to prevent them from simply rewriting the code with their own solution. This both provides debugging practice while also allowing students to view code submitted by other students, and get practice modifying code written by others.

    These problems are super fun! Try a few yourself below.