Search in sources :

Example 6 with MSCourseNode

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

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 7 with MSCourseNode

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

the class OLATUpgrade_11_0_0 method postCopyPassedScore.

/**
 * Used if a passed or score value was set.
 * @param nodeAssessment
 * @param course
 */
private void postCopyPassedScore(AssessmentEntry entry, ICourse course) {
    String nodeIdent = entry.getSubIdent();
    CourseNode courseNode = course.getRunStructure().getNode(nodeIdent);
    if (courseNode instanceof GTACourseNode) {
    // 
    } else if (courseNode instanceof TACourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof IQTESTCourseNode) {
    // 
    } else if (courseNode instanceof PortfolioCourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof MSCourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof BasicLTICourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof ScormCourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    }
}
Also used : BasicLTICourseNode(org.olat.course.nodes.BasicLTICourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) PortfolioCourseNode(org.olat.course.nodes.PortfolioCourseNode) MSCourseNode(org.olat.course.nodes.MSCourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) 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) GTACourseNode(org.olat.course.nodes.GTACourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode)

Example 8 with MSCourseNode

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

the class OLATUpgrade_11_0_0 method postCopyPassedScore.

/**
 * Used if a passed or score value was set.
 * @param nodeAssessment
 * @param course
 */
private void postCopyPassedScore(AssessmentEntry entry, ICourse course) {
    String nodeIdent = entry.getSubIdent();
    CourseNode courseNode = course.getRunStructure().getNode(nodeIdent);
    if (courseNode instanceof GTACourseNode) {
    // 
    } else if (courseNode instanceof TACourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof IQTESTCourseNode) {
    // 
    } else if (courseNode instanceof PortfolioCourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof MSCourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof BasicLTICourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    } else if (courseNode instanceof ScormCourseNode) {
        entry.setAssessmentStatus(AssessmentEntryStatus.done);
    }
}
Also used : BasicLTICourseNode(org.olat.course.nodes.BasicLTICourseNode) IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) PortfolioCourseNode(org.olat.course.nodes.PortfolioCourseNode) MSCourseNode(org.olat.course.nodes.MSCourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) 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) GTACourseNode(org.olat.course.nodes.GTACourseNode) TACourseNode(org.olat.course.nodes.TACourseNode) ScormCourseNode(org.olat.course.nodes.ScormCourseNode)

Aggregations

CourseNode (org.olat.course.nodes.CourseNode)8 IQTESTCourseNode (org.olat.course.nodes.IQTESTCourseNode)8 MSCourseNode (org.olat.course.nodes.MSCourseNode)8 STCourseNode (org.olat.course.nodes.STCourseNode)6 ScormCourseNode (org.olat.course.nodes.ScormCourseNode)6 TACourseNode (org.olat.course.nodes.TACourseNode)6 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 BasicLTICourseNode (org.olat.course.nodes.BasicLTICourseNode)3 GTACourseNode (org.olat.course.nodes.GTACourseNode)3 PortfolioCourseNode (org.olat.course.nodes.PortfolioCourseNode)3 File (java.io.File)2 IOException (java.io.IOException)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 List (java.util.List)2 HttpEntity (org.apache.http.HttpEntity)2