From c7fd7c53aeba54184e2f3d1cd35d7224e0bf2abd Mon Sep 17 00:00:00 2001
From: srosse <stephane.rosse@frentix.com>
Date: Mon, 25 Jun 2018 17:19:12 +0200
Subject: [PATCH] OO-3544: override score from XML file with the ones from the
 database if manual scoring

---
 .../org/olat/ims/qti21/ui/AssessmentResultController.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java b/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java
index a3624ed2ce9..b46979aaa9a 100644
--- a/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java
+++ b/src/main/java/org/olat/ims/qti21/ui/AssessmentResultController.java
@@ -224,10 +224,12 @@ public class AssessmentResultController extends FormBasicController {
 				layoutCont.contextPut("testResults", testResults);
 				TestResult testResult = assessmentResult.getTestResult();
 				if(testResult != null) {
-					extractOutcomeVariable(testResult.getItemVariables(), testResults);
 					if(candidateSession.getManualScore() != null) {
+						testResults.setScore(candidateSession.getScore());
 						testResults.addScore(candidateSession.getManualScore());
 						testResults.setManualScore(candidateSession.getManualScore());
+					} else {
+						extractOutcomeVariable(testResult.getItemVariables(), testResults);
 					}
 					
 					AssessmentTest assessmentTest = resolvedAssessmentTest.getRootNodeLookup().extractIfSuccessful();
-- 
GitLab