Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nkratzke committed Nov 15, 2018
1 parent 95eddde commit 800cf3b
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 15 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ task runExample(type: JavaExec) {
doFirst {
delete 'test'
mkdir 'test'
workingDir = 'test'
classpath = sourceSets.main.runtimeClasspath
main = 'de.thl.jedunit.CLI'
exec {
workingDir = 'test'
commandLine = '../init.sh'
}
}

workingDir = 'test'
classpath = sourceSets.main.runtimeClasspath
main = 'de.thl.jedunit.CLI'

doLast {
exec {
workingDir = 'test'
Expand Down
Binary file modified build/libs/JEdUnit.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ wget --no-cache https://github.com/nkratzke/VPL-java-template/raw/working/build/
wget --no-cache https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.14/checkstyle-8.14-all.jar -O checkstyle.jar
base64 -i jedunit.jar -o jedunit.jar.b64
base64 -i checkstyle.jar -o checkstyle.jar.b64
java -jar JEdUnit.jar
java -jar jedunit.jar
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ curl -s https://raw.githubusercontent.com/nkratzke/VPL-java-template/working/ini
Then

1. Import the following __requested files__ `Main.java` via the Moodle web interface from this repository as __starting point for your students__.
2. Import the following __execution files__ `Checks.java`, `Solution.java`, `style_checks.xml`, `vpl_evaluate.sh`, and `vpl_run.sh` via the Moodle web interface from this directory.
2. Import the following __execution files__ `Checks.java`, `Solution.java`, `style_checks.xml`, `vpl_evaluate.sh`, `vpl_run.sh`, `jedunit.jar.b64`, and `checkstyle.jar.b64` via the Moodle web interface from this directory.
- `Solution.java` is where you should place your reference solution.
- `Checks.java` is where you place your grading test cases.
- _`style_checks.xml` is a [checkstyle](http://checkstyle.sourceforge.net/index.html) file that is used to enforce coding standards. In most cases you do not need to touch this file._
- _`vpl_run.sh` is the VPL run script that compiles and executes the `Main.java`. In most cases you do not need to touch this file._
- _`vpl_evaluate.sh` is the VPL evaluate script that checks style, and compiles all Java files. Furthermore, it launches `Checks.java` to evaluate the student submission. In most cases you do not need to touch this file._
3. Select __to be keeped files__ `Checks.java`, `Solution.java`, and `style_checks.xml` via the Moodle web interface (otherwise these files will be deleted by the VPL jail server and your evaluation will not work).
- `jedunit.jar.b64`, and `checkstyle.jar.b64` are Base64 encoded jars that are needed on the classpath. Do not touch these files.
3. Select __to be keeped files__ `Checks.java`, `Solution.java`, `style_checks.xml`, `jedunit.jar.b64`, and `checkstyle.jar.b64` via the Moodle web interface (otherwise these files will be deleted by the VPL jail server and your evaluation will not work).

It is recommended to do these __settings only once for a Moodle course__ and derive all your assignments via the __"based-on"__ feature of the Moodle VPL plugin.

### Writing an assignment

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/thl/jedunit/CompareResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public class Entry {
* @param c comment
*/
public Entry(boolean ok, Node r, Node s, String c) {
this.ok = ok;
this.reference = r;
this.submission = s;
this.comment = c;
this.ok = ok;
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/clean.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /bin/bash
rm -f *.class
rm -f *.jar
rm -f *.log
rm -f vpl_execution
3 changes: 0 additions & 3 deletions src/main/resources/vpl_evaluate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ cat > vpl_execution <<EEOOFF
. common_script.sh
rm -f *.class
# rm -f *.jar
# wget --quiet https://github.com/nkratzke/VPL-java-template/raw/working/build/libs/JEdUnit.jar -O JEdUnit.jar
# wget --quiet https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.14/checkstyle-8.14-all.jar -O checkstyle.jar
java -jar checkstyle.jar -c style_checks.xml *.java > checkstyle.log
javac -cp ".:*" -Xlint:none Checks.java
Expand Down
Binary file modified test/JEdUnit.jar
Binary file not shown.
1 change: 1 addition & 0 deletions test/checkstyle.jar.b64

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion test/clean.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#! /bin/bash
rm -f *.class
rm -f *.jar
rm -f *.log
rm -f vpl_execution
1 change: 1 addition & 0 deletions test/jedunit.jar.b64

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions test/vpl_evaluate.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#! /bin/bash
cat > vpl_execution <<EEOOFF
#! /bin/bash
. common_script.sh
rm -f *.class
rm -f *.jar
wget --quiet https://github.com/nkratzke/VPL-java-template/raw/working/build/libs/JEdUnit.jar -O JEdUnit.jar
wget --quiet https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.14/checkstyle-8.14-all.jar -O checkstyle.jar
java -jar checkstyle.jar -c style_checks.xml *.java > checkstyle.log
javac -cp ".:*" -Xlint:none Checks.java
Expand Down

0 comments on commit 800cf3b

Please sign in to comment.