-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grader: allow floor rounding mode more properly
- Loading branch information
Showing
19 changed files
with
173 additions
and
6 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
judgels-backends/judgels-grader-engines/src/main/java/judgels/gabriel/api/GradingConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
package judgels.gabriel.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import java.util.List; | ||
import java.util.Map; | ||
import org.immutables.value.Value; | ||
|
||
public interface GradingConfig { | ||
Map<String, String> getSourceFileFields(); | ||
int getTimeLimit(); | ||
int getMemoryLimit(); | ||
List<TestGroup> getTestData(); | ||
List<Subtask> getSubtasks(); | ||
|
||
@Value.Default | ||
@JsonInclude(Include.NON_DEFAULT) | ||
default ScoringConfig getScoringConfig() { | ||
return ScoringConfig.DEFAULT; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
judgels-backends/judgels-grader-engines/src/main/java/judgels/gabriel/api/ScoringConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package judgels.gabriel.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonInclude.Include; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import org.immutables.value.Value; | ||
|
||
@Value.Immutable | ||
@JsonDeserialize(as = ImmutableScoringConfig.class) | ||
public interface ScoringConfig { | ||
ScoringConfig DEFAULT = new Builder().build(); | ||
|
||
@Value.Default | ||
@JsonInclude(Include.NON_DEFAULT) | ||
default ScoringRoundingMode getRoundingMode() { | ||
return ScoringRoundingMode.ROUND; | ||
} | ||
|
||
class Builder extends ImmutableScoringConfig.Builder {} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ackends/judgels-grader-engines/src/main/java/judgels/gabriel/api/ScoringRoundingMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package judgels.gabriel.api; | ||
|
||
public enum ScoringRoundingMode { | ||
ROUND, | ||
FLOOR, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.