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

OO-3306: replace the offline theme by the light theme in archive of QTI 1.2 (2. variant)

parent 2688de01
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ package org.olat.course.archiver; ...@@ -22,6 +22,7 @@ package org.olat.course.archiver;
import org.olat.core.gui.UserRequest; import org.olat.core.gui.UserRequest;
import org.olat.core.logging.OLog; import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing; import org.olat.core.logging.Tracing;
import org.olat.core.util.StringHelper;
import org.olat.core.util.prefs.Preferences; import org.olat.core.util.prefs.Preferences;
import org.olat.core.util.xml.XStreamHelper; import org.olat.core.util.xml.XStreamHelper;
import org.olat.course.nodes.ArchiveOptions; import org.olat.course.nodes.ArchiveOptions;
...@@ -50,8 +51,11 @@ public class FormatConfigHelper { ...@@ -50,8 +51,11 @@ public class FormatConfigHelper {
try { try {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences(); Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
String formatConfigString = (String) guiPrefs.get(ExportOptionsController.class, QTI_EXPORT_ITEM_FORMAT_CONFIG); String formatConfigString = (String) guiPrefs.get(ExportOptionsController.class, QTI_EXPORT_ITEM_FORMAT_CONFIG);
Object formatObject = configXstream.fromXML(formatConfigString); if(StringHelper.containsNonWhitespace(formatConfigString)) {
formatConfig = (ExportFormat) formatObject; formatConfig = (ExportFormat)configXstream.fromXML(formatConfigString);
} else {
formatConfig = new ExportFormat(true, true, true, true, true);
}
} catch (Exception e) { } catch (Exception e) {
log.error("could not establish object from xml", e); log.error("could not establish object from xml", e);
formatConfig = new ExportFormat(true, true, true, true, true); formatConfig = new ExportFormat(true, true, true, true, true);
......
...@@ -240,8 +240,10 @@ public class QTI12ResultsExportMediaResource implements MediaResource { ...@@ -240,8 +240,10 @@ public class QTI12ResultsExportMediaResource implements MediaResource {
convertToZipEntry(zout, exportFolderName + "/index.html", usersHTML); convertToZipEntry(zout, exportFolderName + "/index.html", usersHTML);
//Copy resource files or file trees to export file tree //Copy resource files or file trees to export file tree
File sasstheme = new File(WebappHelper.getContextRealPath("/static/offline/qti")); File theme = new File(WebappHelper.getContextRealPath("/static/themes/light/theme.css"));
fsToZip(zout, sasstheme.toPath(), exportFolderName + "/css/offline/qti/"); ZipUtil.addFileToZip(exportFolderName + "/css/offline/qti/theme.css", theme, zout);
File themeMap = new File(WebappHelper.getContextRealPath("/static/themes/light/theme.css.map"));
ZipUtil.addFileToZip(exportFolderName + "/css/offline/qti/theme.css.map", themeMap, zout);
File fontawesome = new File(WebappHelper.getContextRealPath("/static/font-awesome")); File fontawesome = new File(WebappHelper.getContextRealPath("/static/font-awesome"));
fsToZip(zout, fontawesome.toPath(), exportFolderName + "/css/font-awesome/"); fsToZip(zout, fontawesome.toPath(), exportFolderName + "/css/font-awesome/");
......
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