use of org.olat.course.run.environment.CourseEnvironment in project OpenOLAT by OpenOLAT.
the class QTI21AssessmentDetailsController method getSignatureOptions.
private DigitalSignatureOptions getSignatureOptions(AssessmentTestSession session) {
RepositoryEntry sessionTestEntry = session.getTestEntry();
QTI21DeliveryOptions deliveryOptions = qtiService.getDeliveryOptions(sessionTestEntry);
boolean digitalSignature = deliveryOptions.isDigitalSignature();
boolean sendMail = deliveryOptions.isDigitalSignatureMail();
if (courseNode != null) {
ModuleConfiguration config = courseNode.getModuleConfiguration();
digitalSignature = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE, deliveryOptions.isDigitalSignature());
sendMail = config.getBooleanSafe(IQEditController.CONFIG_DIGITAL_SIGNATURE_SEND_MAIL, deliveryOptions.isDigitalSignatureMail());
}
DigitalSignatureOptions options = new DigitalSignatureOptions(digitalSignature, sendMail, entry, testEntry);
if (digitalSignature) {
if (courseNode == null) {
AssessmentEntryOutcomesListener.decorateResourceConfirmation(entry, testEntry, session, options, null, getLocale());
} else {
CourseEnvironment courseEnv = CourseFactory.loadCourse(entry).getCourseEnvironment();
QTI21AssessmentRunController.decorateCourseConfirmation(session, options, courseEnv, courseNode, sessionTestEntry, null, getLocale());
}
}
return options;
}
use of org.olat.course.run.environment.CourseEnvironment in project OpenOLAT by OpenOLAT.
the class QTI21RetrieveTestsController method doRetrieveTest.
private void doRetrieveTest(AssessmentTestSession session) {
session = qtiService.getAssessmentTestSession(session.getKey());
session = qtiService.pullSession(session, getSignatureOptions(session), getIdentity());
if (courseNode != null) {
RepositoryEntry courseEntry = session.getRepositoryEntry();
CourseEnvironment courseEnv = CourseFactory.loadCourse(courseEntry).getCourseEnvironment();
UserCourseEnvironment assessedUserCourseEnv = AssessmentHelper.createAndInitUserCourseEnvironment(session.getIdentity(), courseEnv);
courseNode.pullAssessmentTestSession(session, assessedUserCourseEnv, getIdentity(), Role.coach);
}
}
use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class TodayVariable method getValue.
/**
* @see com.neemsoft.jmep.VariableCB#getValue()
*/
public Object getValue() {
CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
if (cev != null) {
return new Double(0);
}
CourseEnvironment ce = getUserCourseEnv().getCourseEnvironment();
long time = ce.getCurrentTimeMillis();
Date date = new Date(time);
Date day = DateUtils.truncate(date, Calendar.DATE);
Double dDay = new Double(day.getTime());
return dDay;
}
use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class CheckboxEditController method getFileContainer.
private VFSContainer getFileContainer() {
VFSContainer container;
if (courseNode == null) {
File tmp = new File(FolderConfig.getCanonicalTmpDir(), checkbox.getCheckboxId());
container = new LocalFolderImpl(tmp);
} else {
ICourse course = CourseFactory.loadCourse(courseOres);
CourseEnvironment courseEnv = course.getCourseEnvironment();
container = checkboxManager.getFileContainer(courseEnv, courseNode);
}
return container;
}
use of org.olat.course.run.environment.CourseEnvironment in project openolat by klemens.
the class BulkAssessmentTask method getReturnBox.
/**
* Return the target folder of the assessed identity. This is a factory method which take care
* of the type of the course node.
*
* @param uce
* @param courseNode
* @param identity
* @return
*/
private VFSContainer getReturnBox(UserCourseEnvironment uce, CourseNode courseNode, Identity identity) {
VFSContainer returnContainer = null;
if (courseNode instanceof GTACourseNode) {
final GTAManager gtaManager = CoreSpringFactory.getImpl(GTAManager.class);
CourseEnvironment courseEnv = uce.getCourseEnvironment();
returnContainer = gtaManager.getCorrectionContainer(courseEnv, (GTACourseNode) courseNode, identity);
} else {
String returnPath = ReturnboxController.getReturnboxPathRelToFolderRoot(uce.getCourseEnvironment(), courseNode);
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(returnPath, null);
VFSItem assessedItem = rootFolder.resolve(identity.getName());
if (assessedItem == null) {
returnContainer = rootFolder.createChildContainer(identity.getName());
} else if (assessedItem instanceof VFSContainer) {
returnContainer = (VFSContainer) assessedItem;
}
}
return returnContainer;
}
Aggregations