use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.image.Img in project OpenOLAT by OpenOLAT.
the class ImportExportHelper method getMaterials.
protected static List<String> getMaterials(AssessmentItem item) {
List<String> materials = new ArrayList<>();
QueryUtils.search(Img.class, item).forEach((img) -> {
if (img.getSrc() != null) {
materials.add(img.getSrc().toString());
}
});
QueryUtils.search(A.class, item).forEach((a) -> {
URI href = a.getHref();
if (href != null && href.getHost() == null && href.getPath() != null) {
materials.add(href.getPath());
}
});
QueryUtils.search(Object.class, item).forEach((object) -> {
if (StringHelper.containsNonWhitespace(object.getData())) {
materials.add(object.getData());
}
});
return materials;
}
use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.image.Img in project OpenOLAT by OpenOLAT.
the class ImportExportHelper method getMaterials.
protected static void getMaterials(AssessmentItem item, File itemFile, AssessmentItemsAndResources materials) {
File directory = itemFile.getParentFile();
QueryUtils.search(Img.class, item).forEach((img) -> {
if (img.getSrc() != null) {
String imgPath = img.getSrc().toString();
File imgFile = new File(directory, imgPath);
if (imgFile.exists()) {
materials.addMaterial(new ItemMaterial(imgFile, imgPath));
}
}
});
QueryUtils.search(A.class, item).forEach((a) -> {
URI href = a.getHref();
if (href != null && href.getHost() == null && href.getPath() != null) {
String hrefPath = href.getPath();
File aFile = new File(directory, hrefPath);
if (aFile.exists()) {
materials.addMaterial(new ItemMaterial(aFile, hrefPath));
}
}
});
QueryUtils.search(Object.class, item).forEach((object) -> {
if (StringHelper.containsNonWhitespace(object.getData())) {
String path = object.getData();
File objectFile = new File(directory, path);
if (objectFile.exists()) {
materials.addMaterial(new ItemMaterial(objectFile, path));
}
}
});
}
use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.image.Img in project openolat by klemens.
the class ImportExportHelper method getMaterials.
protected static List<String> getMaterials(AssessmentItem item) {
List<String> materials = new ArrayList<>();
QueryUtils.search(Img.class, item).forEach((img) -> {
if (img.getSrc() != null) {
materials.add(img.getSrc().toString());
}
});
QueryUtils.search(A.class, item).forEach((a) -> {
URI href = a.getHref();
if (href != null && href.getHost() == null && href.getPath() != null) {
materials.add(href.getPath());
}
});
QueryUtils.search(Object.class, item).forEach((object) -> {
if (StringHelper.containsNonWhitespace(object.getData())) {
materials.add(object.getData());
}
});
return materials;
}
use of uk.ac.ed.ph.jqtiplus.node.content.xhtml.image.Img in project openolat by klemens.
the class ImportExportHelper method getMaterials.
protected static void getMaterials(AssessmentItem item, File itemFile, AssessmentItemsAndResources materials) {
File directory = itemFile.getParentFile();
QueryUtils.search(Img.class, item).forEach((img) -> {
if (img.getSrc() != null) {
String imgPath = img.getSrc().toString();
File imgFile = new File(directory, imgPath);
if (imgFile.exists()) {
materials.addMaterial(new ItemMaterial(imgFile, imgPath));
}
}
});
QueryUtils.search(A.class, item).forEach((a) -> {
URI href = a.getHref();
if (href != null && href.getHost() == null && href.getPath() != null) {
String hrefPath = href.getPath();
File aFile = new File(directory, hrefPath);
if (aFile.exists()) {
materials.addMaterial(new ItemMaterial(aFile, hrefPath));
}
}
});
QueryUtils.search(Object.class, item).forEach((object) -> {
if (StringHelper.containsNonWhitespace(object.getData())) {
String path = object.getData();
File objectFile = new File(directory, path);
if (objectFile.exists()) {
materials.addMaterial(new ItemMaterial(objectFile, path));
}
}
});
}