Skip to content

Commit

Permalink
HACK: floor the total points for 'certain' problems in OSN 2024 (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
fushar authored Aug 18, 2024
1 parent 85294fc commit 6b74bb8
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.InputStream;
import java.nio.file.Path;
import java.time.Instant;
import java.util.Arrays;
import java.util.List;
import javax.inject.Inject;
import judgels.fs.FileInfo;
Expand All @@ -18,6 +19,14 @@
import judgels.sandalphon.problem.base.ProblemFs;

public final class ProgrammingProblemStore extends BaseProblemStore {
// HACK for OSN 2024
private static final List<String> OSN_2024_CERTAIN_PROBLEMS = Arrays.asList(
"JIDPROG0NHjqvK7B7oiYf6mOOov",
"JIDPROGiZN73iuSVYJE5btHUzni",
"JIDPROGbDLh6vwDRHTXFijN3HYC",
"JIDPROGSohGUsEykcREuewkE2cn"
);

@Inject
public ProgrammingProblemStore(ObjectMapper mapper, @ProblemFs FileSystem problemFs) {
super(mapper, problemFs);
Expand Down Expand Up @@ -50,6 +59,12 @@ public GradingConfig getGradingConfig(String userJid, String problemJid) {
String gradingEngine = problemFs.readFromFile(getGradingEngineFilePath(userJid, problemJid));
String gradingConfig = problemFs.readFromFile(getGradingConfigFilePath(userJid, problemJid));

// HACK for OSN 2024
if (OSN_2024_CERTAIN_PROBLEMS.contains(problemJid)) {
gradingConfig = gradingConfig.substring(0, gradingConfig.length() - 1);
gradingConfig = gradingConfig + ",\"scoringConfig\":{\"roundingMode\":\"FLOOR\"}}";
}

try {
return GradingEngineRegistry.getInstance().get(gradingEngine).parseConfig(mapper, gradingConfig);
} catch (IOException e) {
Expand Down

0 comments on commit 6b74bb8

Please sign in to comment.