README.md 1.81 KB
Newer Older
Vayhinger's avatar
Vayhinger committed
1
# Moodle Dockerized Code Testing (MoDoCoT) - Backend
Dominik Vayhinger's avatar
Dominik Vayhinger committed
2
3
4
5
6
7
8
9
10

## 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`.

Vayhinger's avatar
Vayhinger committed
11
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/)
Dominik Vayhinger's avatar
Dominik Vayhinger committed
12

Vayhinger's avatar
Vayhinger committed
13
14
15
### Server application configuration
We're using the **application-server.properties** file to configure the application.
The file can be found under _/src/main/resources/_
Dominik Vayhinger's avatar
Dominik Vayhinger committed
16

Vayhinger's avatar
Vayhinger committed
17
18
19
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/)
Dominik Vayhinger's avatar
Dominik Vayhinger committed
20

Vayhinger's avatar
Vayhinger committed
21
22
23
### Local application configuration
We're using the **application.properties** file to configure the application.
The file can be found under _/src/main/resources/_
Dominik Vayhinger's avatar
Dominik Vayhinger committed
24

Vayhinger's avatar
Vayhinger committed
25
26
27
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/)
Dominik Vayhinger's avatar
Dominik Vayhinger committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

## Interfaces
##### POST /v1/unittest
Used for uploading / creating of assignments. The body needs to contain two fields as form data:<br/>
*assignmentId*: The ID of the created assignment. This is created by moodle.<br/>
*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:<br/>
*taskFile*: The zip file containing the java files<br/>
*assignmentId*: The id of the assignment. Provided by moodle