diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java index ad20887d..ae492339 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/ExamForm.java @@ -349,18 +349,19 @@ public class ExamForm implements TemplateComposer { .withInputSpan(4) .withEmptyCellSeparation(false)) - .addField(FormBuilder.singleSelection( - Domain.EXAM.ATTR_EXAM_TEMPLATE_ID, - FORM_EXAM_TEMPLATE_TEXT_KEY, - (exam.examTemplateId == null) - ? getDefaultExamTemplateId() - : String.valueOf(exam.examTemplateId), - this.resourceService::examTemplateResources) - .withSelectionListener(form -> this.processTemplateSelection(form, formContext)) - .withLabelSpan(2) - .withInputSpan(4) - .withEmptyCellSpan(2) - .readonly(!importFromQuizData)) + .addFieldIf( + () -> importFromQuizData, + () -> FormBuilder.singleSelection( + Domain.EXAM.ATTR_EXAM_TEMPLATE_ID, + FORM_EXAM_TEMPLATE_TEXT_KEY, + (exam.examTemplateId == null) + ? getDefaultExamTemplateId() + : String.valueOf(exam.examTemplateId), + this.resourceService::examTemplateResources) + .withSelectionListener(form -> this.processTemplateSelection(form, formContext)) + .withLabelSpan(2) + .withInputSpan(4) + .withEmptyCellSpan(2)) .addField(FormBuilder.singleSelection( Domain.EXAM.ATTR_TYPE,