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;
}
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);
}
}
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);
}
}
Aggregations