Disable ability to grade opponents after requesting improvements

This commit is contained in:
Andreas Svanberg 2025-02-18 15:12:21 +01:00
parent ad91a9b961
commit 1b36ad7987
2 changed files with 12 additions and 2 deletions
view/src/main/java/se/su/dsv/scipro/finalseminar

@ -58,6 +58,11 @@
</form>
<form wicket:id="request_improvements">
<p>
Once you request improvements the student have a limited time to make the requested changes.
If they do not make the requested improvements in time, they will get an automatic failing grade.
You will be notified when they've submitted a new report.
</p>
<div class="mb-3">
<label class="form-label" wicket:for="feedback_to_opponent">
Provide feedback to the opponent on how to improve the opposition

@ -323,12 +323,17 @@ public class SeminarOppositionPanel extends Panel {
@Override
protected void onConfigure() {
super.onConfigure();
FinalSeminarOpposition opposition = getModelObject();
setVisibilityAllowed(
startDateHasPassed() &&
getModelObject().getPoints() == null &&
getModelObject().getFeedback() == null &&
opposition.getPoints() == null &&
opposition.getFeedback() == null &&
isHeadSupervisor()
);
boolean hasRequestedImprovements = opposition.getImprovementsRequestedAt() != null;
boolean reportIsSubmitted =
opposition.getOppositionReport() != null && opposition.getOppositionReport().isSubmitted();
setEnabled(!hasRequestedImprovements || reportIsSubmitted);
}
}