Allows admins to manage grading report templates #14

Merged
niat8586 merged 41 commits from 3482-new-grading-criteria into develop 2024-10-30 10:05:23 +01:00
4 changed files with 41 additions and 0 deletions
Showing only changes of commit 56bac63e4f - Show all commits

View File

@ -65,10 +65,15 @@ class EditingGradingTemplate implements Serializable {
OPPOSITION, REFLECTION OPPOSITION, REFLECTION
} }
enum Type {
PROJECT, INDIVIDUAL
}
private String titleSv; private String titleSv;
private String titleEn; private String titleEn;
private List<Point> points = new ArrayList<>(); private List<Point> points = new ArrayList<>();
private Flag flag; private Flag flag;
private Type type = Type.PROJECT;
Criteria(GradingCriterionTemplate criteria) { Criteria(GradingCriterionTemplate criteria) {
this.titleSv = criteria.getTitle(); this.titleSv = criteria.getTitle();
@ -82,6 +87,14 @@ class EditingGradingTemplate implements Serializable {
private Criteria() {} private Criteria() {}
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public String getTitleSv() { public String getTitleSv() {
return titleSv; return titleSv;
} }

View File

@ -82,6 +82,12 @@
</div> </div>
</div> </div>
<div class="mb-3">
<label class="form-label" wicket:for="type">Type</label>
<select wicket:id="type" class="form-control"></select>
<small class="text-muted">Whether this criterion is assessed once for the thesis or per author.</small>
</div>
<div class="mb-3"> <div class="mb-3">
<label class="form-label" wicket:for="flag">Special flag</label> <label class="form-label" wicket:for="flag">Special flag</label>
<select class="form-control" wicket:id="flag"></select> <select class="form-control" wicket:id="flag"></select>

View File

@ -94,6 +94,26 @@ class EditingGradingTemplateComponentPanel extends GenericPanel<EditingGradingTe
} }
}); });
AjaxDropDownChoice<EditingGradingTemplate.Criteria.Type> typeChoice = new AjaxDropDownChoice<>(
"type",
LambdaModel.of(
model,
EditingGradingTemplate.Criteria::getType,
EditingGradingTemplate.Criteria::setType),
List.of(EditingGradingTemplate.Criteria.Type.values()),
new EnumChoiceRenderer<>(this))
{
@Override
public void onNewSelection(
AjaxRequestTarget target,
EditingGradingTemplate.Criteria.Type objectSelected)
{
// auto save
}
};
typeChoice.setRequired(true);
add(typeChoice);
AjaxDropDownChoice<EditingGradingTemplate.Criteria.Flag> flagChoice = new AjaxDropDownChoice<>( AjaxDropDownChoice<EditingGradingTemplate.Criteria.Flag> flagChoice = new AjaxDropDownChoice<>(
"flag", "flag",
LambdaModel.of( LambdaModel.of(

View File

@ -6,3 +6,5 @@ title_sv.Required=You must set the swedish title for all criteria
title_en.Required=You must set the english title for all criteria title_en.Required=You must set the english title for all criteria
requirement_sv.Required=You must set the swedish requirement for every criteria point requirement_sv.Required=You must set the swedish requirement for every criteria point
requirement_en.Required=You must set the english requirement for every criteria point requirement_en.Required=You must set the english requirement for every criteria point
Type.PROJECT=Once per thesis
Type.INDIVIDUAL=Individually for each author