# Moodle Dockerized Code Testing (MoDoCoT) - Backend
## Usage
### Conventions
- The JUnit test classes cannot be organized in packages. Tasks and helper classes can use packages.
## Development Hints
### Build
This is a maven project. It can be build with `mvn package`.
There is also a ready-to-go docker image available. It can be found [on Docker Hub](https://hub.docker.com/r/hftstuttgart/modocot-backend/)
### Server application configuration
We're using the **application-server.properties** file to configure the application.
The file can be found under _/src/main/resources/_
You need to configure following entries:
docker.hostIp= "Your docker host ip"
jenkins.api.token= "Your jenkins api token" [See Jenkins Doc](https://www.jenkins.io/doc/book/using/remote-access-api/)
### Local application configuration
We're using the **application.properties** file to configure the application.
The file can be found under _/src/main/resources/_
You need to configure following entries:
docker.hostIp= "Your docker host ip"
jenkins.api.token= "Your jenkins api token" [See Jenkins Doc](https://www.jenkins.io/doc/book/using/remote-access-api/)
## Interfaces
##### POST /v1/unittest
Used for uploading / creating of assignments. The body needs to contain two fields as form data:
*assignmentId*: The ID of the created assignment. This is created by moodle.
*unitTestFile*: The zip file containing the unit tests for this assignment.
##### DELETE /v1/unittest?assignmentId=<111>
Delete the created assignment. The assignment ID of the unit tests which need to be deleted is passed as a query parameter
##### POST /v1/task
The upload of the Java files to be tested. The body needs to contain two form fields:
*taskFile*: The zip file containing the java files
*assignmentId*: The id of the assignment. Provided by moodle