Search in sources :

Example 6 with IQTESTCourseNode

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

the class IQIdentityListCourseNodeController method initMultiSelectionTools.

@Override
protected void initMultiSelectionTools(UserRequest ureq, FormLayoutContainer formLayout) {
    // bulk
    super.initMultiSelectionTools(ureq, formLayout);
    RepositoryEntry testEntry = getReferencedRepositoryEntry();
    if (((IQTESTCourseNode) courseNode).hasQTI21TimeLimit(testEntry)) {
        extraTimeButton = uifactory.addFormLink("extra.time", formLayout, Link.BUTTON);
        extraTimeButton.setIconLeftCSS("o_icon o_icon_extra_time");
    }
    boolean qti21 = isTestQTI21();
    boolean onyx = !qti21 && OnyxModule.isOnyxTest(testEntry.getOlatResource());
    statsButton = uifactory.addFormLink("button.stats", formLayout, Link.BUTTON);
    statsButton.setIconLeftCSS("o_icon o_icon-fw o_icon_statistics_tool");
    if (!coachCourseEnv.isCourseReadOnly()) {
        if (!onyx) {
            pullButton = uifactory.addFormLink("retrieve.tests.title", formLayout, Link.BUTTON);
            pullButton.setIconLeftCSS("o_icon o_icon_pull");
        }
        if (qti21) {
            if (assessmentCallback.isAdmin()) {
                resetButton = uifactory.addFormLink("tool.delete.data", formLayout, Link.BUTTON);
                resetButton.setIconLeftCSS("o_icon o_icon_delete_item");
            }
            if (qtiService.needManualCorrection(testEntry) || IQEditController.CORRECTION_MANUAL.equals(courseNode.getModuleConfiguration().getStringValue(IQEditController.CONFIG_CORRECTION_MODE))) {
                correctionButton = uifactory.addFormLink("correction.test.title", formLayout, Link.BUTTON);
                correctionButton.setIconLeftCSS("o_icon o_icon-fw o_icon_correction");
            }
            if (courseNode.getModuleConfiguration().getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE, false)) {
                validateButton = uifactory.addFormLink("validate.xml.signature", formLayout, Link.BUTTON);
                validateButton.setIconLeftCSS("o_icon o_icon-fw o_icon_correction");
            }
        }
    }
    if (!onyx) {
        exportResultsButton = uifactory.addFormLink("button.export", formLayout, Link.BUTTON);
        exportResultsButton.setIconLeftCSS("o_icon o_icon-fw o_icon_export");
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 7 with IQTESTCourseNode

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

the class IQIdentityListCourseNodeController method loadModel.

@Override
protected void loadModel(UserRequest ureq) {
    super.loadModel(ureq);
    if (((IQTESTCourseNode) courseNode).hasQTI21TimeLimit(getReferencedRepositoryEntry())) {
        Map<Long, ExtraTimeInfos> extraTimeInfos = getExtraTimes();
        List<AssessedIdentityElementRow> rows = usersTableModel.getObjects();
        for (AssessedIdentityElementRow row : rows) {
            row.setDetails(extraTimeInfos.get(row.getIdentityKey()));
        }
    }
    if (pullButton != null) {
        boolean enabled = isTestRunning();
        pullButton.setEnabled(enabled);
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow)

Example 8 with IQTESTCourseNode

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

the class IQIdentityListCourseNodeController method doConfirmResetData.

private void doConfirmResetData(UserRequest ureq) {
    AssessmentToolOptions asOptions = getOptions();
    CourseEnvironment courseEnv = getCourseEnvironment();
    resetDataCtrl = new QTI21ResetDataController(ureq, getWindowControl(), courseEnv, asOptions, (IQTESTCourseNode) courseNode);
    listenTo(resetDataCtrl);
    String title = translate("tool.reset");
    cmc = new CloseableModalController(getWindowControl(), null, resetDataCtrl.getInitialComponent(), true, title, true);
    listenTo(cmc);
    cmc.activate();
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) AssessmentToolOptions(org.olat.modules.assessment.AssessmentToolOptions) QTI21ResetDataController(org.olat.ims.qti21.ui.QTI21ResetDataController)

Example 9 with IQTESTCourseNode

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

the class QTI21IdentityListCourseNodeToolsController method doConfirmDeleteData.

private void doConfirmDeleteData(UserRequest ureq) {
    resetDataCtrl = new QTI21ResetDataController(ureq, getWindowControl(), courseEntry, (IQTESTCourseNode) courseNode, assessedIdentity);
    listenTo(resetDataCtrl);
    String title = translate("reset.test.data.title");
    cmc = new CloseableModalController(getWindowControl(), null, resetDataCtrl.getInitialComponent(), true, title, true);
    listenTo(cmc);
    cmc.activate();
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) QTI21ResetDataController(org.olat.ims.qti21.ui.QTI21ResetDataController)

Example 10 with IQTESTCourseNode

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

the class QTI21AssessmentRunController method doDownloadSignature.

private void doDownloadSignature(UserRequest ureq) {
    MediaResource resource = null;
    if (courseNode instanceof IQTESTCourseNode) {
        IQTESTCourseNode testCourseNode = (IQTESTCourseNode) courseNode;
        AssessmentEntry assessmentEntry = testCourseNode.getUserAssessmentEntry(userCourseEnv);
        AssessmentTestSession session = qtiService.getAssessmentTestSession(assessmentEntry.getAssessmentId());
        File signature = qtiService.getAssessmentResultSignature(session);
        if (signature.exists()) {
            resource = new DownloadeableMediaResource(signature);
        }
    }
    if (resource == null) {
        resource = new NotFoundMediaResource();
    }
    ureq.getDispatchResult().setResultingMediaResource(resource);
}
Also used : NotFoundMediaResource(org.olat.core.gui.media.NotFoundMediaResource) AssessmentTestSession(org.olat.ims.qti21.AssessmentTestSession) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) DownloadeableMediaResource(org.olat.fileresource.DownloadeableMediaResource) MediaResource(org.olat.core.gui.media.MediaResource) DownloadeableMediaResource(org.olat.fileresource.DownloadeableMediaResource) NotFoundMediaResource(org.olat.core.gui.media.NotFoundMediaResource) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) File(java.io.File)

Aggregations

IQTESTCourseNode (org.olat.course.nodes.IQTESTCourseNode)50 RepositoryEntry (org.olat.repository.RepositoryEntry)14 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)12 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)10 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)10 CourseNode (org.olat.course.nodes.CourseNode)10 File (java.io.File)8 Identity (org.olat.core.id.Identity)8 MSCourseNode (org.olat.course.nodes.MSCourseNode)8 ScormCourseNode (org.olat.course.nodes.ScormCourseNode)8 TACourseNode (org.olat.course.nodes.TACourseNode)8 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)8 ICourse (org.olat.course.ICourse)6 GTACourseNode (org.olat.course.nodes.GTACourseNode)6 STCourseNode (org.olat.course.nodes.STCourseNode)6 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)6 QTI21ResetDataController (org.olat.ims.qti21.ui.QTI21ResetDataController)6 QTI21RetrieveTestsController (org.olat.ims.qti21.ui.QTI21RetrieveTestsController)5 IOException (java.io.IOException)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4