use of org.olat.ims.qti.editor.beecom.objects.QTIDocument in project openolat by klemens.
the class QTI12ResultDetailsController method checkEssay.
private boolean checkEssay() {
QTIDocument doc = TestFileResource.getQTIDocument(repositoryEntry.getOlatResource());
if (doc != null && doc.getAssessment() != null) {
Assessment ass = doc.getAssessment();
// Sections with their Items
List<Section> sections = ass.getSections();
for (Section section : sections) {
List<Item> items = section.getItems();
for (Item item : items) {
String ident = item.getIdent();
if (ident != null && ident.startsWith("QTIEDIT:ESSAY")) {
return true;
}
}
}
}
return false;
}
use of org.olat.ims.qti.editor.beecom.objects.QTIDocument in project openolat by klemens.
the class TestFileResource method getQTIEditorPackageReader.
public static QTIReaderPackage getQTIEditorPackageReader(OLATResource resource) {
VFSContainer baseDir = FileResourceManager.getInstance().unzipContainerResource(resource);
QTIDocument document = getQTIDocument(resource);
return new QTIReaderPackage(baseDir, document);
}
use of org.olat.ims.qti.editor.beecom.objects.QTIDocument in project openolat by klemens.
the class QTI12To21Converter method isConvertible.
public static boolean isConvertible(OLATResource resource) {
if (TestFileResource.TYPE_NAME.equals(resource.getResourceableTypeName())) {
if (OnyxModule.isOnyxTest(resource)) {
return true;
}
QTIDocument doc = TestFileResource.getQTIDocument(resource);
if (doc == null) {
return false;
}
boolean alien = false;
@SuppressWarnings("unchecked") List<Item> items = doc.getAssessment().getItems();
for (int i = 0; i < items.size(); i++) {
Item item = items.get(i);
alien |= item.isAlient();
}
return !alien;
}
return false;
}
Aggregations