Simple client for Moss. It can be used in Java or Kotlin applications.
- Obtain a moss id by following the Moss registration instructions. You will find the id in the middle of the submission script in your mailbox.
- Add this in your build.gradle
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.nikita715:mossclient:1.1.1'
}
or this in your pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.nikita715</groupId>
<artifactId>mossclient</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
- Submit files for an analysis
List<File> bases = Arrays.asList(
new File("path/to/basefile1"),
new File("path/to/basefile2")
);
List<Pair<String, File>> solutions = Arrays.asList(
new Pair<>("student1", new File("path/to/solution1")),
new Pair<>("student2", new File("path/to/solution2")),
new Pair<>("student3", new File("path/to/solution3"))
);
String mossId = "12345678"
MossClient mossClient = new MossClient(mossId, Language.JAVA)
.submitFiles(bases, true)
.submitNamedFiles(solutions);
String resultUrl = mossClient.getResult();
- Look at the analysis result by the
resultUrl
More examples available here