Skip to content

Commit

Permalink
i273: update ShadowController to include "judgerId". Specifically,
Browse files Browse the repository at this point in the history
added the most recent "ClientId" from the JudgementRecord for each run
to the ShadowJudgementInfo for each submission.
  • Loading branch information
clevengr committed Jul 29, 2021
1 parent dcba92f commit a48a3ba
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/edu/csus/ecs/pc2/shadow/ShadowController.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ private Map<String, ShadowJudgementInfo> getJudgementsMap(Run[] pc2Runs) {

if (run.isJudged()) {

// get the judgement assigned to the run by PC2
// get the most recent judgement assigned to the run in PC2
JudgementRecord jr = run.getJudgementRecord();

if (jr != null) {
Expand Down Expand Up @@ -614,6 +614,9 @@ private Map<String, ShadowJudgementInfo> getJudgementsMap(Run[] pc2Runs) {
}

if (acronym != null) {

//get the id of who applied the most recent judgement
ClientId judgerClientID = jr.getJudgerClientId();

// assign PC2 judgement, plus a "pending" for remote judgement (to be filled in later)
ShadowJudgementPair pair = new ShadowJudgementPair(submissionId, acronym.name(), "<pending>");
Expand All @@ -622,7 +625,7 @@ private Map<String, ShadowJudgementInfo> getJudgementsMap(Run[] pc2Runs) {
// System.out.println(" submissionID=" + submissionId + " teamID=" + teamID + " problemID=" + problemID + " languageID=" + languageID
// + " pc2Judgement=" + acronym.name() + " remoteJudgement=" + "<pending>");

ShadowJudgementInfo info = new ShadowJudgementInfo(submissionId, teamID, problemID, languageID, pair);
ShadowJudgementInfo info = new ShadowJudgementInfo(submissionId, teamID, problemID, languageID, judgerClientID, pair);

pc2JudgementInfoMap.put(submissionId, info);

Expand All @@ -638,9 +641,9 @@ private Map<String, ShadowJudgementInfo> getJudgementsMap(Run[] pc2Runs) {

} else {

// we have a run which has not yet been judged by PC2; assign "pending" for both the PC2 and remote judgement
// we have a run which has not yet been judged by PC2; assign "pending" for both the PC2 and remote judgement and null for the judgerId
ShadowJudgementPair pair = new ShadowJudgementPair(submissionId, "<pending>", "<pending>");
ShadowJudgementInfo info = new ShadowJudgementInfo(submissionId, teamID, problemID, languageID, pair);
ShadowJudgementInfo info = new ShadowJudgementInfo(submissionId, teamID, problemID, languageID, null, pair);

// System.out.print("Debug: adding to judgementsMap: ");
// System.out.println(" submissionID=" + submissionId + " teamID=" + teamID + " problemID=" + problemID + " languageID=" + languageID
Expand Down

0 comments on commit a48a3ba

Please sign in to comment.