Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grading: update submission grading engine when regraded #632

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ public Submission createSubmission(SubmissionData data, ProblemSubmissionConfig
return submissionFromModels(submissionDao.insert(model), null);
}

@Override
public void updateSubmissionGradingEngine(String submissionJid, String gradingEngine) {
Optional<SM> maybeModel = submissionDao.selectByJid(submissionJid);
if (maybeModel.isPresent()) {
SM model = maybeModel.get();
model.gradingEngine = gradingEngine;
submissionDao.update(model);
}
}

@Override
public String createGrading(Submission submission) {
GM model = gradingDao.createGradingModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public void regrade(String gradingJid, Submission submission, SubmissionSource s

public void regrade(String gradingJid, Submission submission, SubmissionSource source, ProblemSubmissionConfig config, GradingOptions options) {
if (config.getGradingLastUpdateTime().isAfter(submission.getTime())) {
// TODO(fushar): update submission's grading engine
if (!submission.getGradingEngine().equals(config.getGradingEngine())) {
submissionStore.updateSubmissionGradingEngine(submission.getJid(), config.getGradingEngine());
}
}
requestGrading(gradingJid, submission, source, config, options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Optional<Submission> getLatestSubmission(
Map<String, Long> getTotalSubmissionsMap(String containerJid, String userJid, Collection<String> problemJids);

Submission createSubmission(SubmissionData data, ProblemSubmissionConfig config);
void updateSubmissionGradingEngine(String submissionJid, String gradingEngine);
String createGrading(Submission submission);
Optional<Submission> updateGrading(String gradingJid, GradingResult result);
}