Allows admins to manage grading report templates #14
@ -74,10 +74,12 @@ class EditingGradingTemplate implements Serializable {
|
|||||||
private List<Point> points = new ArrayList<>();
|
private List<Point> points = new ArrayList<>();
|
||||||
private Flag flag;
|
private Flag flag;
|
||||||
private Type type = Type.PROJECT;
|
private Type type = Type.PROJECT;
|
||||||
|
private int pointsRequiredToPass;
|
||||||
|
|
||||||
Criteria(GradingCriterionTemplate criteria) {
|
Criteria(GradingCriterionTemplate criteria) {
|
||||||
this.titleSv = criteria.getTitle();
|
this.titleSv = criteria.getTitle();
|
||||||
this.titleEn = criteria.getTitleEn();
|
this.titleEn = criteria.getTitleEn();
|
||||||
|
this.pointsRequiredToPass = criteria.getPointsRequiredToPass();
|
||||||
for (var point : criteria.getGradingCriterionPointTemplates()) {
|
for (var point : criteria.getGradingCriterionPointTemplates()) {
|
||||||
if (point.getPoint() == 0) continue;;
|
if (point.getPoint() == 0) continue;;
|
||||||
Point editingPoint = new Point(point);
|
Point editingPoint = new Point(point);
|
||||||
@ -131,6 +133,14 @@ class EditingGradingTemplate implements Serializable {
|
|||||||
this.points = points;
|
this.points = points;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPointsRequiredToPass() {
|
||||||
|
return pointsRequiredToPass;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPointsRequiredToPass(int pointsRequiredToPass) {
|
||||||
|
this.pointsRequiredToPass = pointsRequiredToPass;
|
||||||
|
}
|
||||||
|
|
||||||
class Point implements Serializable {
|
class Point implements Serializable {
|
||||||
private String requirementEn;
|
private String requirementEn;
|
||||||
private String requirementSv;
|
private String requirementSv;
|
||||||
|
@ -94,6 +94,17 @@
|
|||||||
<small class="text-muted">You can flag a criteria if it is connected to some other part of the system</small>
|
<small class="text-muted">You can flag a criteria if it is connected to some other part of the system</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label" wicket:for="points_required_to_pass">
|
||||||
|
Points required to pass
|
||||||
|
</label>
|
||||||
|
<input required type="number" class="form-control" wicket:id="points_required_to_pass">
|
||||||
|
<small class="text-muted">
|
||||||
|
If the author does not get at least this many points on this criterion,
|
||||||
|
they get the default grade.
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Points</legend>
|
<legend>Points</legend>
|
||||||
|
|
||||||
|
@ -114,6 +114,18 @@ class EditingGradingTemplateComponentPanel extends GenericPanel<EditingGradingTe
|
|||||||
typeChoice.setRequired(true);
|
typeChoice.setRequired(true);
|
||||||
add(typeChoice);
|
add(typeChoice);
|
||||||
|
|
||||||
|
NumberTextField<Integer> pointsRequiredToPass = new NumberTextField<>(
|
||||||
|
"points_required_to_pass",
|
||||||
|
LambdaModel.of(
|
||||||
|
model,
|
||||||
|
EditingGradingTemplate.Criteria::getPointsRequiredToPass,
|
||||||
|
EditingGradingTemplate.Criteria::setPointsRequiredToPass),
|
||||||
|
Integer.class);
|
||||||
|
pointsRequiredToPass.setMinimum(0);
|
||||||
|
pointsRequiredToPass.setRequired(true);
|
||||||
|
pointsRequiredToPass.add(new AutoSave());
|
||||||
|
add(pointsRequiredToPass);
|
||||||
|
|
||||||
AjaxDropDownChoice<EditingGradingTemplate.Criteria.Flag> flagChoice = new AjaxDropDownChoice<>(
|
AjaxDropDownChoice<EditingGradingTemplate.Criteria.Flag> flagChoice = new AjaxDropDownChoice<>(
|
||||||
"flag",
|
"flag",
|
||||||
LambdaModel.of(
|
LambdaModel.of(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user