To create a new assignment in Solidity, click into one of your courses, and then click Add assignment. Choose Solidity from the drop-down list of available backend languages and set the the rest of your assignment's parameters (deadline, etc.). Once the assignment is created, a new folder will be created in the private GitHub/GitLab template repository for the course in which you are added this assignment. This folder will contain a standard Solidity project structure.

Automated test-suite setup

If you would like to add tests that are automatically run by AssignmentOS against each student's solution to your assignment, you can add these as test files in the test/ directory.

All unit tests must use the Truffle testing framework. They can be written in either Solidity or JavaScript.

All unit test file names must end with Test.js or Test.sol, and all unit test files with file names ending with HiddenTest.js or HiddenTest.sol will not be visible to the student.

If you want to add files that your hidden unit tests use and hence are also not visible to the student, the names of these files must begin with hidden (case-insensitive), e.g., hiddenFoo.json, hiddenFoo.csv, HiddenFoo.sol, etc.

The package.json file should only be modified in order to add any third-party dependencies required for your solution. The truffle and truffle-assertions versions should not be changed.

The pragma version also must not be changed.

The assignment must be compatible with Node.js version 15.5.1.

GitHub Action & GitLab CI/CD

AssignmentOS uses either GitHub Actions or GitLab CI/CD (depending on whether you use with GitHub or GitLab) to run automated unit tests. We provide the following GitHub Action & GitLab CI/CD file for Solidity assignments. Note that this file is added dynamically to the repo of each student taking your assignment, so please do not include it in your template repo. This file also cannot be changed.

GitHub Action .yml fileGitLab CI/CD .yml file

Coming soon!


An example Solidity assignment that uses automated test suite scoring can be seen here:

Last updated