Skip to content
Snippets Groups Projects
Commit 54a9f7ba authored by srosse's avatar srosse
Browse files

OO-3631: allow a tolerance of 0.0 in numerical input

parent 84e7e759
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<version.selenium>3.11.0</version.selenium> <version.selenium>3.11.0</version.selenium>
<version.drone>2.5.1</version.drone> <version.drone>2.5.1</version.drone>
<activemq.version>5.11.1</activemq.version> <activemq.version>5.11.1</activemq.version>
<qtiworks.version>1.0.8</qtiworks.version> <qtiworks.version>1.0.9</qtiworks.version>
<!-- properties for testing and Q&A --> <!-- properties for testing and Q&A -->
<!-- by default no tests are executed so far (April 2011). Use appropriate profiles and properties on the command line --> <!-- by default no tests are executed so far (April 2011). Use appropriate profiles and properties on the command line -->
......
...@@ -996,7 +996,7 @@ public class FIBAssessmentItemBuilder extends AssessmentItemBuilder { ...@@ -996,7 +996,7 @@ public class FIBAssessmentItemBuilder extends AssessmentItemBuilder {
private boolean match(double answer) { private boolean match(double answer) {
double lTolerance = lowerTolerance == null ? 0.0d : lowerTolerance.doubleValue(); double lTolerance = lowerTolerance == null ? 0.0d : lowerTolerance.doubleValue();
double uTolerance = upperTolerance == null ? 0.0d : upperTolerance.doubleValue(); double uTolerance = upperTolerance == null ? 0.0d : upperTolerance.doubleValue();
if(toleranceMode == ToleranceMode.ABSOLUTE && (lTolerance <= 0.0d || uTolerance <= 0.0d)) { if(toleranceMode == ToleranceMode.ABSOLUTE && (lTolerance < 0.0d || uTolerance < 0.0d)) {
return false; return false;
} }
return toleranceMode.isEqual(solution, answer, return toleranceMode.isEqual(solution, answer,
......
...@@ -38,7 +38,7 @@ error.import.question=Die Frage konnte wegen eine unerwartete Fehler nicht impor ...@@ -38,7 +38,7 @@ error.import.question=Die Frage konnte wegen eine unerwartete Fehler nicht impor
error.integer=$org.olat.ims.qti21.ui\:error.integer error.integer=$org.olat.ims.qti21.ui\:error.integer
error.lock=Dieser Test/Fragebogen wird momentan vom Benutzer {0} editiert und ist deshalb gesperrt. error.lock=Dieser Test/Fragebogen wird momentan vom Benutzer {0} editiert und ist deshalb gesperrt.
error.lock.title=Test gesperrt error.lock.title=Test gesperrt
error.lower.tolerance=Die untere Schranke muss kleiner als die L\u00F6sung sein. error.lower.tolerance=Die untere Schranke muss kleiner - gleich als die L\u00F6sung sein.
error.mimetype=$org.olat.core.commons.modules.bc\:WrongMimeType error.mimetype=$org.olat.core.commons.modules.bc\:WrongMimeType
error.min.score.bigger.max=Minimal erreichbare Punktzahl muss kleiner als then maximal erreichbare Punktzahl sein. error.min.score.bigger.max=Minimal erreichbare Punktzahl muss kleiner als then maximal erreichbare Punktzahl sein.
error.missing.fib=Die Frage mussen mindestens einen L\u00FCckentext oder eine Numerische Eingabe enthalten. error.missing.fib=Die Frage mussen mindestens einen L\u00FCckentext oder eine Numerische Eingabe enthalten.
...@@ -46,7 +46,7 @@ error.missing.hottext=Die Frage mussen mindestens einen Hottext enthalten. ...@@ -46,7 +46,7 @@ error.missing.hottext=Die Frage mussen mindestens einen Hottext enthalten.
error.need.correct.answer=Sie m\u00FCssen mindestens eine Antwort als korrekt markieren. error.need.correct.answer=Sie m\u00FCssen mindestens eine Antwort als korrekt markieren.
error.positive.double=Falsches Zahlenformat, nur positive Nummer sind erlaubt. Beispiele\: 15.0, 5.5, 10 error.positive.double=Falsches Zahlenformat, nur positive Nummer sind erlaubt. Beispiele\: 15.0, 5.5, 10
error.singlechoice=Genau ein ausw\u00E4hlen error.singlechoice=Genau ein ausw\u00E4hlen
error.upper.tolerance=Die obere Schranke muss gr\u00F6sser als die L\u00F6sung sein. error.upper.tolerance=Die obere Schranke muss gr\u00F6sser - gleich als die L\u00F6sung sein.
essay.expectedLength=Anzahl Buchstaben essay.expectedLength=Anzahl Buchstaben
essay.max.strings=Max Anzahl W\u00F6rter essay.max.strings=Max Anzahl W\u00F6rter
essay.min.strings=Min Anzahl W\u00F6rter essay.min.strings=Min Anzahl W\u00F6rter
......
...@@ -36,7 +36,7 @@ error.import.question=An unexpected error happens during import of a question. ...@@ -36,7 +36,7 @@ error.import.question=An unexpected error happens during import of a question.
error.integer=$org.olat.ims.qti21.ui\:error.integer error.integer=$org.olat.ims.qti21.ui\:error.integer
error.lock=This test/questionnaire is being edited by user {0} at the moment and therefore locked. error.lock=This test/questionnaire is being edited by user {0} at the moment and therefore locked.
error.lock.title=Test locked error.lock.title=Test locked
error.lower.tolerance=The lower bound need to be smaller than the solution. error.lower.tolerance=The lower bound need to be smaller than or equal to the solution.
error.min.score.bigger.max=Min. score must be bigger than the max. score. error.min.score.bigger.max=Min. score must be bigger than the max. score.
error.mimetype=$org.olat.core.commons.modules.bc\:WrongMimeType error.mimetype=$org.olat.core.commons.modules.bc\:WrongMimeType
error.missing.fib=The question need at least a gap text or a numerical input. error.missing.fib=The question need at least a gap text or a numerical input.
...@@ -48,7 +48,7 @@ essay.expectedLength=Number of letters ...@@ -48,7 +48,7 @@ essay.expectedLength=Number of letters
essay.max.strings=Max. words essay.max.strings=Max. words
essay.min.strings=Min. words essay.min.strings=Min. words
essay.rows=Height (number of lines) essay.rows=Height (number of lines)
error.upper.tolerance=The upper bound need to be bigger than the solution. error.upper.tolerance=The upper bound need to be bigger than or equal to the solution.
export.qpool.successful=$org.olat.ims.qti.editor\:export.qpool.successful export.qpool.successful=$org.olat.ims.qti.editor\:export.qpool.successful
feedback.answered.help=Feedback by answer\: this feedback is shown automatically if the user give an answer. feedback.answered.help=Feedback by answer\: this feedback is shown automatically if the user give an answer.
feedback.correct.help=Feedback for all correct answers\: The feedback appears only if all answer are correct. feedback.correct.help=Feedback for all correct answers\: The feedback appears only if all answer are correct.
......
...@@ -38,7 +38,7 @@ error.import.question=Une erreur inattendue s'est produite pendant l'importation ...@@ -38,7 +38,7 @@ error.import.question=Une erreur inattendue s'est produite pendant l'importation
error.integer=$org.olat.ims.qti21.ui\:error.integer error.integer=$org.olat.ims.qti21.ui\:error.integer
error.lock=Ce test / questionnaire est \u00E9dit\u00E9 par {0} en ce moment et est bloqu\u00E9. error.lock=Ce test / questionnaire est \u00E9dit\u00E9 par {0} en ce moment et est bloqu\u00E9.
error.lock.title=Test bloqu\u00E9 error.lock.title=Test bloqu\u00E9
error.lower.tolerance=La limite inf\u00E9rieure doit \u00EAtre plus petite que la solution. error.lower.tolerance=La limite inf\u00E9rieure doit \u00EAtre plus petite ou \u00E9gale \u00E0 la solution.
error.mimetype=$org.olat.core.commons.modules.bc\:WrongMimeType error.mimetype=$org.olat.core.commons.modules.bc\:WrongMimeType
error.min.score.bigger.max=Le nombre de points minimum doit \u00EAtre plus petit que le nombre de points maximum. error.min.score.bigger.max=Le nombre de points minimum doit \u00EAtre plus petit que le nombre de points maximum.
error.missing.fib=La question doit contenir au moins un text \u00E0 trou ou une entr\u00E9e num\u00E9rique. error.missing.fib=La question doit contenir au moins un text \u00E0 trou ou une entr\u00E9e num\u00E9rique.
...@@ -46,7 +46,7 @@ error.missing.hottext=La question doit contenir au moins un hottext. ...@@ -46,7 +46,7 @@ error.missing.hottext=La question doit contenir au moins un hottext.
error.need.correct.answer=Vous devez s\u00E9lectionner au moins une r\u00E9ponse comme correcte. error.need.correct.answer=Vous devez s\u00E9lectionner au moins une r\u00E9ponse comme correcte.
error.positive.double=Seul des nombres positives sont permis. Par exemple\: 15.0, 5.5, 10 error.positive.double=Seul des nombres positives sont permis. Par exemple\: 15.0, 5.5, 10
error.singlechoice=En s\u00E9lectionner exactement une error.singlechoice=En s\u00E9lectionner exactement une
error.upper.tolerance=La limite sup\u00E9rieure doit \u00EAtre plus grande que la solution. error.upper.tolerance=La limite sup\u00E9rieure doit \u00EAtre plus grande ou \u00E9gale \u00E0 la solution.
essay.expectedLength=Nombre de lettres essay.expectedLength=Nombre de lettres
essay.max.strings=Nombre de mots max. essay.max.strings=Nombre de mots max.
essay.min.strings=Nombre de mots min. essay.min.strings=Nombre de mots min.
......
...@@ -252,11 +252,11 @@ public class FIBNumericalEntrySettingsController extends FormBasicController { ...@@ -252,11 +252,11 @@ public class FIBNumericalEntrySettingsController extends FormBasicController {
BigDecimal solution = new BigDecimal(solutionEl.getValue()); BigDecimal solution = new BigDecimal(solutionEl.getValue());
BigDecimal upperBound = new BigDecimal(upperToleranceEl.getValue()); BigDecimal upperBound = new BigDecimal(upperToleranceEl.getValue());
BigDecimal lowerBound = new BigDecimal(lowerToleranceEl.getValue()); BigDecimal lowerBound = new BigDecimal(lowerToleranceEl.getValue());
if(upperBound.subtract(solution).compareTo(new BigDecimal("0.0")) <= 0) { if(upperBound.subtract(solution).compareTo(new BigDecimal("0.0")) < 0) {
upperToleranceEl.setErrorKey("error.upper.tolerance", null); upperToleranceEl.setErrorKey("error.upper.tolerance", null);
allOk &= false; allOk &= false;
} }
if(solution.subtract(lowerBound).compareTo(new BigDecimal("0.0")) <= 0) { if(solution.subtract(lowerBound).compareTo(new BigDecimal("0.0")) < 0) {
lowerToleranceEl.setErrorKey("error.lower.tolerance", null); lowerToleranceEl.setErrorKey("error.lower.tolerance", null);
allOk &= false; allOk &= false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment