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

OO-3536: add topic to the imported metadata in question pool

parent e8e22f1e
No related branches found
No related tags found
No related merge requests found
...@@ -120,6 +120,7 @@ public class CSVToAssessmentItemConverter { ...@@ -120,6 +120,7 @@ public class CSVToAssessmentItemConverter {
case "type": processType(parts); break; case "type": processType(parts); break;
case "titel": case "titel":
case "title": processTitle(parts); break; case "title": processTitle(parts); break;
case "topic": processTopic(parts); break;
case "beschreibung": case "beschreibung":
case "description": processDescription(parts); break; case "description": processDescription(parts); break;
case "frage": case "frage":
...@@ -272,7 +273,7 @@ public class CSVToAssessmentItemConverter { ...@@ -272,7 +273,7 @@ public class CSVToAssessmentItemConverter {
String discriminationIndex = parts[1]; String discriminationIndex = parts[1];
if(StringHelper.containsNonWhitespace(discriminationIndex)) { if(StringHelper.containsNonWhitespace(discriminationIndex)) {
try { try {
currentItem.setDifferentiation(new BigDecimal(discriminationIndex.trim())); currentItem.setDifferentiation(new BigDecimal(discriminationIndex.replace(",", ".").trim()));
} catch (Exception e) { } catch (Exception e) {
log.warn("", e); log.warn("", e);
} }
...@@ -285,7 +286,7 @@ public class CSVToAssessmentItemConverter { ...@@ -285,7 +286,7 @@ public class CSVToAssessmentItemConverter {
String difficulty = parts[1]; String difficulty = parts[1];
if(StringHelper.containsNonWhitespace(difficulty)) { if(StringHelper.containsNonWhitespace(difficulty)) {
try { try {
BigDecimal dif = new BigDecimal(difficulty.trim()); BigDecimal dif = new BigDecimal(difficulty.replace(",", ".").trim());
if(dif.doubleValue() >= 0.0d && dif.doubleValue() <= 1.0d) { if(dif.doubleValue() >= 0.0d && dif.doubleValue() <= 1.0d) {
currentItem.setDifficulty(dif); currentItem.setDifficulty(dif);
} else { } else {
...@@ -303,7 +304,7 @@ public class CSVToAssessmentItemConverter { ...@@ -303,7 +304,7 @@ public class CSVToAssessmentItemConverter {
String stddev = parts[1]; String stddev = parts[1];
if(StringHelper.containsNonWhitespace(stddev)) { if(StringHelper.containsNonWhitespace(stddev)) {
try { try {
BigDecimal dev = new BigDecimal(stddev.trim()); BigDecimal dev = new BigDecimal(stddev.replace(",", ".").trim());
if(dev.doubleValue() >= 0.0d && dev.doubleValue() <= 1.0d) { if(dev.doubleValue() >= 0.0d && dev.doubleValue() <= 1.0d) {
currentItem.setStdevDifficulty(dev); currentItem.setStdevDifficulty(dev);
} else { } else {
...@@ -515,6 +516,15 @@ public class CSVToAssessmentItemConverter { ...@@ -515,6 +516,15 @@ public class CSVToAssessmentItemConverter {
} }
} }
private void processTopic(String[] parts) {
if(currentItem == null || parts.length < 2) return;
String topic = parts[1];
if(StringHelper.containsNonWhitespace(topic)) {
currentItem.setTopic(topic);
}
}
private void processQuestion(String[] parts) { private void processQuestion(String[] parts) {
if(currentItem == null) return; if(currentItem == null) return;
......
No preview for this file type
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