From 7abf20d13a6860ed5e00229f413fca7ab4e44828 Mon Sep 17 00:00:00 2001
From: uhensler <none@none>
Date: Mon, 23 Apr 2018 11:18:58 +0200
Subject: [PATCH] OO-3303: Finish button should not be shown if the evaluation
 is done

---
 .../ui/EvaluationFormExecutionController.java |   1 +
 .../modules/forms/ui/model/RubricWrapper.java | 129 ------------------
 2 files changed, 1 insertion(+), 129 deletions(-)
 delete mode 100644 src/main/java/org/olat/modules/forms/ui/model/RubricWrapper.java

diff --git a/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java b/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java
index 97d118c4006..4bb652d4509 100644
--- a/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java
+++ b/src/main/java/org/olat/modules/forms/ui/EvaluationFormExecutionController.java
@@ -166,6 +166,7 @@ public class EvaluationFormExecutionController extends FormBasicController imple
 		}
 		if(session.getEvaluationFormSessionStatus() == EvaluationFormSessionStatus.done) {
 			readOnly = true;
+			showDoneButton = false;
 		} else if(!evaluator.equals(getIdentity())) {
 			flc.contextPut("messageNotDone", Boolean.TRUE);
 		}
diff --git a/src/main/java/org/olat/modules/forms/ui/model/RubricWrapper.java b/src/main/java/org/olat/modules/forms/ui/model/RubricWrapper.java
deleted file mode 100644
index a23cf6b9dcb..00000000000
--- a/src/main/java/org/olat/modules/forms/ui/model/RubricWrapper.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * <a href="http://www.openolat.org">
- * OpenOLAT - Online Learning and Training</a><br>
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); <br>
- * you may not use this file except in compliance with the License.<br>
- * You may obtain a copy of the License at the
- * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
- * <p>
- * Unless required by applicable law or agreed to in writing,<br>
- * software distributed under the License is distributed on an "AS IS" BASIS, <br>
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
- * See the License for the specific language governing permissions and <br>
- * limitations under the License.
- * <p>
- * Initial code contributed and copyrighted by<br>
- * frentix GmbH, http://www.frentix.com
- * <p>
- */
-package org.olat.modules.forms.ui.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.olat.core.util.StringHelper;
-import org.olat.modules.forms.model.xml.Rubric;
-import org.olat.modules.forms.model.xml.Rubric.SliderType;
-import org.olat.modules.forms.model.xml.Slider;
-import org.olat.modules.forms.model.xml.StepLabel;
-
-/**
- * 
- * Initial date: 13 déc. 2016<br>
- * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
- *
- */
-public class RubricWrapper {
-
-	private final Rubric rubric;
-	private List<SliderWrapper> sliders;
-
-	public RubricWrapper(Rubric rubric) {
-		this.rubric = rubric;
-	}
-	
-	public boolean isDiscreteRubric() {
-		return rubric.getSliderType() == SliderType.discrete;
-	}
-	
-	public boolean isDiscreteSliderRubric() {
-		return rubric.getSliderType() == SliderType.discrete_slider;
-	}
-	
-	public boolean isNoResponseEnabled() {
-		return rubric.isNoResponseEnabled();
-	}
-	
-
-	public static int getWidthInPercent(Rubric theRubric) {
-		if(theRubric.getSliderType() == SliderType.discrete) {
-			int steps = theRubric.getSteps();
-			int stepInPercent = Math.round(100.0f / steps) - 1;
-			return stepInPercent;
-		}
-		return 0;
-	}
-	
-	public int getStepInPercent() {
-		return getWidthInPercent(rubric);
-	}
-	
-	public boolean isStepLabels() {
-		if(rubric.getStepLabels() == null || rubric.getStepLabels().isEmpty()) {
-			return false;
-		}
-		
-		List<StepLabel> stepLabels = rubric.getStepLabels();
-		for(StepLabel stepLabel:stepLabels) {
-			if(stepLabel != null && StringHelper.containsNonWhitespace(stepLabel.getLabel())) {
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	public boolean isLeftLabels() {
-		List<Slider> rubricSliders = rubric.getSliders();
-		if(rubricSliders != null && rubricSliders.size() > 0) {
-			for(Slider slider:rubricSliders) {
-				if(slider != null && StringHelper.containsNonWhitespace(slider.getStartLabel())) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-	
-	public boolean isRightLabels() {
-		List<Slider> rubricSliders = rubric.getSliders();
-		if(rubricSliders != null && rubricSliders.size() > 0) {
-			for(Slider slider:rubricSliders) {
-				if(slider != null && StringHelper.containsNonWhitespace(slider.getEndLabel())) {
-					return true;
-				}
-			}
-		}	
-		return false;
-	}
-	
-	public List<String> getStepLabels() {
-		if(rubric.getStepLabels() != null && rubric.getStepLabels().size() > 0) {
-			List<String> stepLabels = new ArrayList<>(rubric.getStepLabels().size());
-			for(StepLabel stepLabel:rubric.getStepLabels()) {
-				stepLabels.add(stepLabel.getLabel());
-			}
-			return stepLabels;
-		}
-		return new ArrayList<>(1);
-	}
-
-	public List<SliderWrapper> getSliders() {
-		return sliders;
-	}
-
-	public void setSliders(List<SliderWrapper> sliders) {
-		this.sliders = sliders;
-	}
-
-}
-- 
GitLab