Today, a highly requested feature has been released: Input/Output testing & autograding. The Input/Output Tests pane is embeded within all new and existing Teams for Education projects.
This pane contains tools designed to simplify testing code. Instead of manually entering typing input and checking output for every submission, the autograder allows you to define and automate testing.
How do I use it?
Input/Output tests is only available for projects created within the Teams for Education product. This feature is available on all projects - new and existing.
Click on the icon within the workspace sidebar nav to reveal the Input/Output tests pane.
Click on the button to reveal a form with the following fields:
Test name- This is the name of the test, which is for you and your students to identify it.
Input(optional) - This is where you put in the input for your test.
Expected output- This is the output which the program is expected to have.
match) - This is how we represent how we compare the actual output of the script with the expected output.
expectedOutput === actualOutput || expectedOutput + '\n' === actualOutput.
regex- The test passes if the test matches the expectedOutput compiled as a regex. This is equivalent to
If you don't want to be lenient of an extra newline and have a truly exact match with the expectedOutput and actualOutput, you can use the
regex with a
^ at the start and
$ at the end. Keep in mind though, that you'll have to escape other regex characters.
Tests cases can be added, edited, and deleted at any time - even after the project has been published. This added flexibility allows you to get started with testing right away.
If a test fails, you can view the results by clicking that appear on each test case:
What if I want to add tests to a pre-existing project?
All changes applied to Input/Output tests within a project will be applied to the submissions automatically. Students will not need to refork to the original project to use updated test cases from their instructors.
Migrating from Repl.it Classroom
Input/Ouput tests created within Repl.it Classroom assignments can now be migrated to Teams for Education using the Classroom Migration Tool.
If you migrated your Classroom since 12/11/2020, you'll see your input/output tests in your new Team. If you migrated your Classroom before then, you'll be able to migrate your Classroom again.
Giving Feedback Goes a Long Way
Teachers continue to express their enthusiasm for multiplayer Repls, annotations, and group projects. We will continue to build on these new platform features to provide a seamless collaborative experience for project based learning.
Learn more about Teams for Education in our documentation.