Search in sources :

Example 16 with IQTESTCourseNode

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

the class OLATUpgrade_11_0_0 method createAssessmentEntry.

private AssessmentEntryImpl createAssessmentEntry(Identity assessedIdentity, Property property, ICourse course, RepositoryEntry courseEntry, String nodeIdent) {
    AssessmentEntryImpl entry = new AssessmentEntryImpl();
    if (property == null) {
        entry.setCreationDate(new Date());
        entry.setLastModified(entry.getCreationDate());
    } else {
        entry.setCreationDate(property.getCreationDate());
        entry.setLastModified(property.getLastModified());
    }
    entry.setIdentity(assessedIdentity);
    entry.setRepositoryEntry(courseEntry);
    entry.setSubIdent(nodeIdent);
    entry.setAttempts(new Integer(0));
    entry.setUserVisibility(Boolean.TRUE);
    CourseNode courseNode = course.getRunStructure().getNode(nodeIdent);
    if (courseNode != null) {
        if (courseNode.needsReferenceToARepositoryEntry()) {
            RepositoryEntry referenceEntry = courseNode.getReferencedRepositoryEntry();
            entry.setReferenceEntry(referenceEntry);
        }
        if (courseNode instanceof GTACourseNode) {
            processAssessmentPropertyForGTA(assessedIdentity, entry, (GTACourseNode) courseNode, courseEntry);
        } else if (courseNode instanceof TACourseNode) {
            processAssessmentPropertyForTA(assessedIdentity, entry, (TACourseNode) courseNode, course);
        } else if (courseNode instanceof IQTESTCourseNode) {
            processAssessmentPropertyForIQTEST(assessedIdentity, entry, (IQTESTCourseNode) courseNode, course);
        } else if (courseNode instanceof PortfolioCourseNode) {
            processAssessmentPropertyForPortfolio(assessedIdentity, entry, (PortfolioCourseNode) courseNode, course);
        } else if (courseNode instanceof MSCourseNode) {
            entry.setAssessmentStatus(AssessmentEntryStatus.inReview);
        } else if (courseNode instanceof BasicLTICourseNode) {
            processAssessmentPropertyForBasicLTI(assessedIdentity, entry, (BasicLTICourseNode) courseNode, course);
        } else if (courseNode instanceof ScormCourseNode) {
            String username = assessedIdentity.getName();
            Map<Date, List<CmiData>> rawDatas = ScormAssessmentManager.getInstance().visitScoDatasMultiResults(username, course.getCourseEnvironment(), (ScormCourseNode) courseNode);
            if (rawDatas != null && rawDatas.size() > 0) {
                entry.setAssessmentStatus(AssessmentEntryStatus.inProgress);
            } else {
                entry.setAssessmentStatus(AssessmentEntryStatus.notStarted);
            }
        }
    }
    return entry;
}
Also used : BasicLTICourseNode(org.olat.course.nodes.BasicLTICourseNode) PortfolioCourseNode(org.olat.course.nodes.PortfolioCourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) RepositoryEntry(org.olat.repository.RepositoryEntry) GTACourseNode(org.olat.course.nodes.GTACourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode) Date(java.util.Date) AssessmentEntryImpl(org.olat.modules.assessment.model.AssessmentEntryImpl) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) MSCourseNode(org.olat.course.nodes.MSCourseNode) ArrayList(java.util.ArrayList) List(java.util.List) STCourseNode(org.olat.course.nodes.STCourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) MSCourseNode(org.olat.course.nodes.MSCourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode) CourseNode(org.olat.course.nodes.CourseNode) PortfolioCourseNode(org.olat.course.nodes.PortfolioCourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) BasicLTICourseNode(org.olat.course.nodes.BasicLTICourseNode)

Example 17 with IQTESTCourseNode

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

the class OLATUpgrade_12_0_0 method processCourseNodeAssessmentLastModified.

private boolean processCourseNodeAssessmentLastModified(ICourse course, RepositoryEntry entry, CourseNode courseNode, Set<Identity> changeSet) {
    if (courseNode instanceof IQTESTCourseNode) {
        updateTest(entry, (IQTESTCourseNode) courseNode, changeSet);
    } else if (courseNode instanceof MSCourseNode) {
        updateMS(entry, courseNode, changeSet);
    } else if (courseNode instanceof ScormCourseNode) {
        updateScorm(course, entry, courseNode, changeSet);
    }
    dbInstance.commitAndCloseSession();
    for (int i = courseNode.getChildCount(); i-- > 0; ) {
        CourseNode child = (CourseNode) courseNode.getChildAt(i);
        processCourseNodeAssessmentLastModified(course, entry, child, changeSet);
    }
    return true;
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) MSCourseNode(org.olat.course.nodes.MSCourseNode) CourseNode(org.olat.course.nodes.CourseNode) MSCourseNode(org.olat.course.nodes.MSCourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode)

Example 18 with IQTESTCourseNode

use of org.olat.course.nodes.IQTESTCourseNode 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 19 with IQTESTCourseNode

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

the class QTI21AssessmentRunController method updateOutcomes.

@Override
public void updateOutcomes(Float score, Boolean pass, Double completion) {
    if (courseNode instanceof IQTESTCourseNode) {
        ((IQTESTCourseNode) courseNode).updateCurrentCompletion(userCourseEnv, getIdentity(), completion, AssessmentRunStatus.running, Role.user);
        coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new CompletionEvent(CompletionEvent.PROGRESS, courseNode.getIdent(), completion, AssessmentRunStatus.running, getIdentity().getKey()), userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) CompletionEvent(org.olat.modules.assessment.ui.event.CompletionEvent)

Example 20 with IQTESTCourseNode

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

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