Search in sources :

Example 1 with IQSELFCourseNode

use of org.olat.course.nodes.IQSELFCourseNode in project OpenOLAT by OpenOLAT.

the class ArchiverMainController method launchArchiveControllers.

private void launchArchiveControllers(UserRequest ureq, String menuCommand) {
    if (menuCommand.equals(CMD_INDEX)) {
        main.setContent(intro);
    } else {
        removeAsListenerAndDispose(contentCtr);
        if (menuCommand.equals(CMD_QTISURVRESULTS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new IQSURVCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_QTITESTRESULTS)) {
            contentCtr = new TestArchiveController(ureq, getWindowControl(), ores, new IQTESTCourseNode(), new IQSELFCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_SCOREACCOUNTING)) {
            contentCtr = new ScoreAccountingArchiveController(ureq, getWindowControl(), ores);
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_ARCHIVELOGFILES)) {
            contentCtr = new CourseLogsArchiveController(ureq, getWindowControl(), ores);
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_HANDEDINTASKS)) {
            // TACourseNode
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new TACourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_GROUPTASKS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new GTACourseNode(), new GTACourseNode(GTACourseNode.TYPE_INDIVIDUAL));
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_PROJECTBROKER)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ProjectBrokerCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_FORUMS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new FOCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_DIALOGS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new DialogCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_WIKIS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new WikiCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_SCORM)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ScormCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_CHECKLIST)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new CheckListCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_PARTICIPANTFOLDER)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new PFCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        }
        listenTo(contentCtr);
    }
}
Also used : PFCourseNode(org.olat.course.nodes.PFCourseNode) IQSURVCourseNode(org.olat.course.nodes.IQSURVCourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) FOCourseNode(org.olat.course.nodes.FOCourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) CheckListCourseNode(org.olat.course.nodes.CheckListCourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) IQSELFCourseNode(org.olat.course.nodes.IQSELFCourseNode) DialogCourseNode(org.olat.course.nodes.DialogCourseNode) WikiCourseNode(org.olat.course.nodes.WikiCourseNode) ProjectBrokerCourseNode(org.olat.course.nodes.ProjectBrokerCourseNode)

Example 2 with IQSELFCourseNode

use of org.olat.course.nodes.IQSELFCourseNode in project OpenOLAT by OpenOLAT.

the class IQEditReplaceWizard method doStep2.

private void doStep2(UserRequest ureq) {
    String nodeTitle = courseNode.getShortTitle();
    if (results != null && !results.isEmpty()) {
        exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
        UserManager um = UserManager.getInstance();
        String charset = um.getUserCharset(ureq.getIdentity());
        QTIExportManager qem = QTIExportManager.getInstance();
        Long repositoryRef = results.get(0).getResultSet().getRepositoryRef();
        List<QTIItemObject> qtiItemObjectList = new QTIObjectTreeBuilder().getQTIItemObjectList(repositoryRef);
        QTIExportFormatter formatter;
        if (courseNode instanceof IQTESTCourseNode) {
            formatter = new QTIExportFormatterCSVType1(ureq.getLocale(), "\t", "\"", "\r\n", false);
        } else if (courseNode instanceof IQSELFCourseNode) {
            formatter = new QTIExportFormatterCSVType1(ureq.getLocale(), "\t", "\"", "\r\n", false);
            ((QTIExportFormatterCSVType1) formatter).setAnonymous(true);
        } else {
            formatter = new QTIExportFormatterCSVType3(ureq.getLocale(), null, "\t", "\"", "\r\n", false);
        }
        Map<Class<?>, QTIExportItemFormatConfig> qtiItemConfigs = getQTIItemConfigs(qtiItemObjectList);
        formatter.setMapWithExportItemConfigs(qtiItemConfigs);
        resultExportFile = qem.exportResults(formatter, results, qtiItemObjectList, courseNode.getShortTitle(), exportDir, charset, ".xls");
        vcStep2 = createVelocityContainer("replacewizard_step2");
        String[] args1 = new String[] { Integer.toString(learners.size()) };
        vcStep2.contextPut("information", translate("replace.wizard.information.paragraph1", args1));
        String[] args2 = new String[] { exportDir.getName(), resultExportFile };
        vcStep2.contextPut("information_par2", translate("replace.wizard.information.paragraph2", args2));
        vcStep2.contextPut("nodetitle", nodeTitle);
        showFileButton = LinkFactory.createButton("replace.wizard.showfile", vcStep2, this);
    } else {
        // it exists no result
        String[] args = new String[] { Integer.toString(numberOfQtiSerEntries) };
        vcStep2 = createVelocityContainer("replacewizard_step2");
        vcStep2.contextPut("information", translate("replace.wizard.information.empty.results", args));
        vcStep2.contextPut("nodetitle", nodeTitle);
    }
    nextBtn = LinkFactory.createButton("replace.wizard.next", vcStep2, this);
    setNextWizardStep(translate("replace.wizard.title.step2"), vcStep2);
}
Also used : QTIExportFormatterCSVType1(org.olat.ims.qti.export.QTIExportFormatterCSVType1) QTIExportFormatterCSVType3(org.olat.ims.qti.export.QTIExportFormatterCSVType3) QTIExportFormatter(org.olat.ims.qti.export.QTIExportFormatter) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) UserManager(org.olat.user.UserManager) QTIExportManager(org.olat.ims.qti.export.QTIExportManager) QTIObjectTreeBuilder(org.olat.ims.qti.export.helper.QTIObjectTreeBuilder) IQSELFCourseNode(org.olat.course.nodes.IQSELFCourseNode) QTIExportItemFormatConfig(org.olat.ims.qti.export.QTIExportItemFormatConfig)

Example 3 with IQSELFCourseNode

use of org.olat.course.nodes.IQSELFCourseNode in project openolat by klemens.

the class ArchiverMainController method launchArchiveControllers.

private void launchArchiveControllers(UserRequest ureq, String menuCommand) {
    if (menuCommand.equals(CMD_INDEX)) {
        main.setContent(intro);
    } else {
        removeAsListenerAndDispose(contentCtr);
        if (menuCommand.equals(CMD_QTISURVRESULTS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new IQSURVCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_QTITESTRESULTS)) {
            contentCtr = new TestArchiveController(ureq, getWindowControl(), ores, new IQTESTCourseNode(), new IQSELFCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_SCOREACCOUNTING)) {
            contentCtr = new ScoreAccountingArchiveController(ureq, getWindowControl(), ores);
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_ARCHIVELOGFILES)) {
            contentCtr = new CourseLogsArchiveController(ureq, getWindowControl(), ores);
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_HANDEDINTASKS)) {
            // TACourseNode
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new TACourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_GROUPTASKS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new GTACourseNode(), new GTACourseNode(GTACourseNode.TYPE_INDIVIDUAL));
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_PROJECTBROKER)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ProjectBrokerCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_FORUMS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new FOCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_DIALOGS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new DialogCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_WIKIS)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new WikiCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_SCORM)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new ScormCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_CHECKLIST)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new CheckListCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        } else if (menuCommand.equals(CMD_PARTICIPANTFOLDER)) {
            contentCtr = new GenericArchiveController(ureq, getWindowControl(), ores, new PFCourseNode());
            main.setContent(contentCtr.getInitialComponent());
        }
        listenTo(contentCtr);
    }
}
Also used : PFCourseNode(org.olat.course.nodes.PFCourseNode) IQSURVCourseNode(org.olat.course.nodes.IQSURVCourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) FOCourseNode(org.olat.course.nodes.FOCourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) CheckListCourseNode(org.olat.course.nodes.CheckListCourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) IQSELFCourseNode(org.olat.course.nodes.IQSELFCourseNode) DialogCourseNode(org.olat.course.nodes.DialogCourseNode) WikiCourseNode(org.olat.course.nodes.WikiCourseNode) ProjectBrokerCourseNode(org.olat.course.nodes.ProjectBrokerCourseNode)

Example 4 with IQSELFCourseNode

use of org.olat.course.nodes.IQSELFCourseNode in project openolat by klemens.

the class IQEditReplaceWizard method doStep2.

private void doStep2(UserRequest ureq) {
    String nodeTitle = courseNode.getShortTitle();
    if (results != null && !results.isEmpty()) {
        exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
        UserManager um = UserManager.getInstance();
        String charset = um.getUserCharset(ureq.getIdentity());
        QTIExportManager qem = QTIExportManager.getInstance();
        Long repositoryRef = results.get(0).getResultSet().getRepositoryRef();
        List<QTIItemObject> qtiItemObjectList = new QTIObjectTreeBuilder().getQTIItemObjectList(repositoryRef);
        QTIExportFormatter formatter;
        if (courseNode instanceof IQTESTCourseNode) {
            formatter = new QTIExportFormatterCSVType1(ureq.getLocale(), "\t", "\"", "\r\n", false);
        } else if (courseNode instanceof IQSELFCourseNode) {
            formatter = new QTIExportFormatterCSVType1(ureq.getLocale(), "\t", "\"", "\r\n", false);
            ((QTIExportFormatterCSVType1) formatter).setAnonymous(true);
        } else {
            formatter = new QTIExportFormatterCSVType3(ureq.getLocale(), null, "\t", "\"", "\r\n", false);
        }
        Map<Class<?>, QTIExportItemFormatConfig> qtiItemConfigs = getQTIItemConfigs(qtiItemObjectList);
        formatter.setMapWithExportItemConfigs(qtiItemConfigs);
        resultExportFile = qem.exportResults(formatter, results, qtiItemObjectList, courseNode.getShortTitle(), exportDir, charset, ".xls");
        vcStep2 = createVelocityContainer("replacewizard_step2");
        String[] args1 = new String[] { Integer.toString(learners.size()) };
        vcStep2.contextPut("information", translate("replace.wizard.information.paragraph1", args1));
        String[] args2 = new String[] { exportDir.getName(), resultExportFile };
        vcStep2.contextPut("information_par2", translate("replace.wizard.information.paragraph2", args2));
        vcStep2.contextPut("nodetitle", nodeTitle);
        showFileButton = LinkFactory.createButton("replace.wizard.showfile", vcStep2, this);
    } else {
        // it exists no result
        String[] args = new String[] { Integer.toString(numberOfQtiSerEntries) };
        vcStep2 = createVelocityContainer("replacewizard_step2");
        vcStep2.contextPut("information", translate("replace.wizard.information.empty.results", args));
        vcStep2.contextPut("nodetitle", nodeTitle);
    }
    nextBtn = LinkFactory.createButton("replace.wizard.next", vcStep2, this);
    setNextWizardStep(translate("replace.wizard.title.step2"), vcStep2);
}
Also used : QTIExportFormatterCSVType1(org.olat.ims.qti.export.QTIExportFormatterCSVType1) QTIExportFormatterCSVType3(org.olat.ims.qti.export.QTIExportFormatterCSVType3) QTIExportFormatter(org.olat.ims.qti.export.QTIExportFormatter) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) QTIItemObject(org.olat.ims.qti.export.helper.QTIItemObject) UserManager(org.olat.user.UserManager) QTIExportManager(org.olat.ims.qti.export.QTIExportManager) QTIObjectTreeBuilder(org.olat.ims.qti.export.helper.QTIObjectTreeBuilder) IQSELFCourseNode(org.olat.course.nodes.IQSELFCourseNode) QTIExportItemFormatConfig(org.olat.ims.qti.export.QTIExportItemFormatConfig)

Aggregations

IQSELFCourseNode (org.olat.course.nodes.IQSELFCourseNode)4 IQTESTCourseNode (org.olat.course.nodes.IQTESTCourseNode)4 CheckListCourseNode (org.olat.course.nodes.CheckListCourseNode)2 DialogCourseNode (org.olat.course.nodes.DialogCourseNode)2 FOCourseNode (org.olat.course.nodes.FOCourseNode)2 GTACourseNode (org.olat.course.nodes.GTACourseNode)2 IQSURVCourseNode (org.olat.course.nodes.IQSURVCourseNode)2 PFCourseNode (org.olat.course.nodes.PFCourseNode)2 ProjectBrokerCourseNode (org.olat.course.nodes.ProjectBrokerCourseNode)2 ScormCourseNode (org.olat.course.nodes.ScormCourseNode)2 TACourseNode (org.olat.course.nodes.TACourseNode)2 WikiCourseNode (org.olat.course.nodes.WikiCourseNode)2 QTIExportFormatter (org.olat.ims.qti.export.QTIExportFormatter)2 QTIExportFormatterCSVType1 (org.olat.ims.qti.export.QTIExportFormatterCSVType1)2 QTIExportFormatterCSVType3 (org.olat.ims.qti.export.QTIExportFormatterCSVType3)2 QTIExportItemFormatConfig (org.olat.ims.qti.export.QTIExportItemFormatConfig)2 QTIExportManager (org.olat.ims.qti.export.QTIExportManager)2 QTIItemObject (org.olat.ims.qti.export.helper.QTIItemObject)2 QTIObjectTreeBuilder (org.olat.ims.qti.export.helper.QTIObjectTreeBuilder)2 UserManager (org.olat.user.UserManager)2