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

OO-4643: extend trim for text entries to insecable spaces

parent d5c6acda
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@
<version.selenium>3.141.59</version.selenium>
<version.drone>2.5.1</version.drone>
<activemq.version>5.15.11</activemq.version>
<qtiworks.version>1.0.18</qtiworks.version>
<qtiworks.version>1.0.19</qtiworks.version>
<!-- 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 -->
......
......@@ -55,6 +55,7 @@ import org.xml.sax.helpers.DefaultHandler;
import nu.validator.htmlparser.common.XmlViolationPolicy;
import nu.validator.htmlparser.sax.HtmlParser;
import uk.ac.ed.ph.jqtiplus.internal.util.StringUtilities;
/**
*
......@@ -357,6 +358,7 @@ public class FIBEditorController extends FormBasicController {
solution = attributes.getValue(i);
if(solution != null) {
solution = itemBuilder.unescapeDataQtiSolution(solution);
solution = StringUtilities.trim(solution);
}
} else if("data-qti-solution-empty".equals(name)) {
solutionEmpty = attributes.getValue(i);
......
......@@ -41,6 +41,7 @@ import org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder.TextEn
import org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder.TextEntryAlternative;
import org.olat.ims.qti21.ui.editor.AssessmentTestEditorController;
import uk.ac.ed.ph.jqtiplus.internal.util.StringUtilities;
import uk.ac.ed.ph.jqtiplus.types.Identifier;
/**
......@@ -241,7 +242,7 @@ public class FIBTextEntrySettingsController extends FormBasicController {
@Override
protected void formOK(UserRequest ureq) {
interaction.setSolution(solutionEl.getValue());
interaction.setSolution(StringUtilities.trim(solutionEl.getValue()));
interaction.setPlaceholder(placeholderEl.getValue());
List<TextEntryAlternative> alternatives = new ArrayList<>(alternativeRows.size());
for(AlternativeRow row:alternativeRows) {
......@@ -253,24 +254,24 @@ public class FIBTextEntrySettingsController extends FormBasicController {
String[] valArr = val.split("[;]");
for(int i=0;i<valArr.length; i++) {
if(i==0) {
alternative.setAlternative(valArr[i]);
alternative.setAlternative(StringUtilities.trim(valArr[i]));
alternatives.add(alternative);
} else {
TextEntryAlternative newAlternative = new TextEntryAlternative();
newAlternative.setAlternative(valArr[i]);
newAlternative.setAlternative(StringUtilities.trim(valArr[i]));
newAlternative.setScore(alternative.getScore());
alternatives.add(newAlternative);
}
}
} else {
alternative.setAlternative(val);
alternative.setAlternative(StringUtilities.trim(val));
alternatives.add(alternative);
}
}
interaction.setAlternatives(alternatives);
interaction.setCaseSensitive(caseSensitiveEl.isAtLeastSelected(1));
if(StringHelper.containsNonWhitespace(expectedLengthEl.getValue())) {
interaction.setExpectedLength(new Integer(expectedLengthEl.getValue()));
interaction.setExpectedLength(Integer.valueOf(expectedLengthEl.getValue()));
} else {
interaction.setExpectedLength(null);
}
......
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