Skip to content
Snippets Groups Projects
README.md 2.51 KiB
Newer Older
  • Learn to ignore specific revisions
  • Tue Herlau's avatar
    Tue Herlau committed
    # Unitgrade-private
    
    
    
    tuhe's avatar
    tuhe committed
    Unitgrade is an automatic report and exam evaluation framework that enables instructors to offer automatically evaluated programming assignments. 
     Unitgrade is build on pythons `unittest` framework so that the tests can be specified in a familiar syntax and will integrate with any modern IDE. What it offers beyond `unittest` is the ability to collect tests in reports (for automatic evaluation) and an easy and 100% safe mechanism for verifying the students results and creating additional, hidden tests. A powerful cache system allows instructors to automatically create test-answers based on a working solution. 
    
    Tue Herlau's avatar
    Tue Herlau committed
    
    
    tuhe's avatar
    tuhe committed
     - 100% Python `unittest` compatible
     - No external configuration files: Just write a `unittest`
     - No unnatural limitations: Use any package or framework. If you can `unittest` it, it works.   
     - Granular security model: 
        - Students get public `unittests` for easy development of solutions
        - Students get a tamper-resistant file to create submissions which are uploaded
        - Instructors can automatically verify the students solution using a Docker VM and run hidden tests
     - Tests are quick to run and will integrate with your IDE
    
    Tue Herlau's avatar
    Tue Herlau committed
    
    
    tuhe's avatar
    tuhe committed
    ** Note: This is the development version of unitgrade. If you are a student, please see http://gitlab.compute.dtu.dk/tuhe/unitgrade. **
    
    Tue Herlau's avatar
    Tue Herlau committed
    
    
    tuhe's avatar
    tuhe committed
    # Using unitgrade
    
    Tue Herlau's avatar
    Tue Herlau committed
    
    
    tuhe's avatar
    tuhe committed
    ## At a glance
    Unitgrade makes the following assumptions:
     - Your code is in python
     - Whatever you want to do can be specified as a `unittest`
    
    Tue Herlau's avatar
    Tue Herlau committed
    
    
    tuhe's avatar
    tuhe committed
    Although not required, it is recommended you maintain two version of the code: 
     - A fully-working version (i.e. all tests pass)
     - A public version distributed to students (some code removed))
    
    Tue Herlau's avatar
    Tue Herlau committed
    
    
    tuhe's avatar
    tuhe committed
    In this example, I will use `snipper` (see http://gitlab.compute.dtu.dk/tuhe/snipper) to synchronize the two versions automatically.
    Let's look at an example. You need three files
    
    Tue Herlau's avatar
    Tue Herlau committed
    ```
    
    tuhe's avatar
    tuhe committed
    instructor/cs101/homework.py # This contains the students homework
    instructor/cs101/report1.py  # This contains the tests
    instructor/cs101/deploy.py   # This deploys the tests
    
    Tue Herlau's avatar
    Tue Herlau committed
    ```
    
    
    tuhe's avatar
    tuhe committed
    ### The homework
    The homework is just any old python code. 
    ```python
    def add(a,b):
       # Write a function which add two numbers!
       return a+b # naturally, this part would NOT be destributed to students
    
    Tue Herlau's avatar
    Tue Herlau committed
    ```
    
    tuhe's avatar
    tuhe committed
    ### The test: 
    The test consists of individual problems and a report-class. The tests themselves are just regular Unittest. For instance:
    ```python
    import unittest
    class MyTest(unittest.TestCase):
       # Write a function which add two numbers!
       return a+b # naturally, this part would NOT be destributed to students
    
    Tue Herlau's avatar
    Tue Herlau committed
    ```
    
    
    Tue Herlau's avatar
    Tue Herlau committed