use of org.olat.modules.qpool.QuestionType in project openolat by klemens.
the class QTIImportProcessor method processItemQuestionType.
private boolean processItemQuestionType(QuestionItemImpl poolItem, String ident, Element itemEl) {
boolean openolatFormat = false;
// question type: mc, sc...
QuestionType type = null;
// test with openolat ident
if (ident != null && ident.startsWith(ItemParser.ITEM_PREFIX_SCQ)) {
type = QuestionType.SC;
openolatFormat = true;
} else if (ident != null && ident.startsWith(ItemParser.ITEM_PREFIX_MCQ)) {
type = QuestionType.MC;
openolatFormat = true;
} else if (ident != null && ident.startsWith(ItemParser.ITEM_PREFIX_FIB)) {
type = QuestionType.FIB;
openolatFormat = true;
} else if (ident != null && ident.startsWith(ItemParser.ITEM_PREFIX_ESSAY)) {
type = QuestionType.ESSAY;
openolatFormat = true;
} else if (ident != null && ident.startsWith(ItemParser.ITEM_PREFIX_KPRIM)) {
type = QuestionType.KPRIM;
openolatFormat = true;
} else if (itemEl.selectNodes("//render_choice").size() == 1) {
Element lidEl = (Element) itemEl.selectSingleNode("//response_lid");
String rcardinality = getAttributeValue(lidEl, "rcardinality");
if ("Single".equals(rcardinality)) {
type = QuestionType.SC;
} else if ("Multiple".equals(rcardinality)) {
type = QuestionType.MC;
}
} else if (itemEl.selectNodes("//render_fib").size() == 1) {
type = QuestionType.FIB;
}
if (type != null) {
QItemType itemType = qItemTypeDao.loadByType(type.name());
poolItem.setType(itemType);
}
return openolatFormat;
}
Aggregations