use of org.olat.modules.ModuleConfiguration 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.modules.ModuleConfiguration in project openolat by klemens.
the class OpenMeetingsEditController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (source == accessibilityCondContr) {
if (event == Event.CHANGED_EVENT) {
Condition cond = accessibilityCondContr.getCondition();
courseNode.setPreConditionAccess(cond);
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == editForm) {
// config form action
if (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
OpenMeetingsRoom room = editForm.getRoom();
if (room != null) {
ModuleConfiguration moduleConfiguration = courseNode.getModuleConfiguration();
moduleConfiguration.set(CONFIG_ROOM_NAME, room.getName());
moduleConfiguration.set(CONFIG_ROOM_SIZE, new Long(room.getSize()));
moduleConfiguration.set(CONFIG_ROOM_MODERATION, new Boolean(room.isModerated()));
moduleConfiguration.set(CONFIG_ROOM_AUDIO_ONLY, new Boolean(room.isAudioOnly()));
moduleConfiguration.set(CONFIG_ROOM_COMMENT, room.getComment());
moduleConfiguration.set(CONFIG_ROOM_TYPE, new Long(room.getType()));
}
}
if (event == Event.DONE_EVENT) {
fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
}
}
use of org.olat.modules.ModuleConfiguration in project openolat by klemens.
the class OpenMeetingsEditController method getDefaultValues.
private OpenMeetingsRoom getDefaultValues() {
OpenMeetingsRoom room = new OpenMeetingsRoom();
ModuleConfiguration moduleConfiguration = courseNode.getModuleConfiguration();
Object name = moduleConfiguration.get(CONFIG_ROOM_NAME);
if (name instanceof String) {
room.setName((String) name);
}
Object size = moduleConfiguration.get(CONFIG_ROOM_SIZE);
if (size instanceof Long) {
room.setSize(((Long) size).longValue());
}
Object moderated = moduleConfiguration.get(CONFIG_ROOM_MODERATION);
if (moderated instanceof Boolean) {
room.setModerated(((Boolean) moderated).booleanValue());
} else if (moderated == null) {
room.setModerated(true);
}
Object comment = moduleConfiguration.get(CONFIG_ROOM_COMMENT);
if (comment instanceof String) {
room.setComment((String) comment);
}
Object type = moduleConfiguration.get(CONFIG_ROOM_TYPE);
if (type instanceof Long) {
room.setType(((Long) type).longValue());
} else if (type == null) {
room.setType(3);
}
Object isAudioOnly = moduleConfiguration.get(CONFIG_ROOM_AUDIO_ONLY);
if (isAudioOnly instanceof Boolean) {
room.setAudioOnly(((Boolean) isAudioOnly).booleanValue());
} else if (isAudioOnly == null) {
room.setAudioOnly(true);
}
return room;
}
use of org.olat.modules.ModuleConfiguration in project openolat by klemens.
the class ScormAPIMapper method calculatePassed.
private void calculatePassed(String olatSahsId, Properties lessonStatusProp, boolean finish) {
int found = 0;
boolean passedScos = true;
for (Iterator<Object> it_status = lessonStatusProp.values().iterator(); it_status.hasNext(); ) {
String status = (String) it_status.next();
passedScos &= "passed".equals(status);
found++;
}
boolean passed = (found == scormAdapter.getNumOfSCOs()) && passedScos;
// if advanceScore option is set update the score only if it is higher
// <OLATEE-27>
ModuleConfiguration config = scormNode.getModuleConfiguration();
if (config.getBooleanSafe(ScormEditController.CONFIG_ADVANCESCORE, true)) {
if (currentPassed == null || !currentPassed.booleanValue()) {
// </OLATEE-27>
boolean increment = !attemptsIncremented && finish;
ScoreEvaluation sceval = new ScoreEvaluation(new Float(0.0f), Boolean.valueOf(passed));
scormNode.updateUserScoreEvaluation(sceval, userCourseEnv, identity, increment, Role.user);
if (increment) {
attemptsIncremented = true;
}
} else if (!config.getBooleanSafe(ScormEditController.CONFIG_ATTEMPTSDEPENDONSCORE, false)) {
boolean increment = !attemptsIncremented && finish;
ScoreEvaluation sceval = scormNode.getUserScoreEvaluation(userCourseEnv);
scormNode.updateUserScoreEvaluation(sceval, userCourseEnv, identity, increment, Role.user);
if (increment) {
attemptsIncremented = true;
}
}
} else {
boolean increment = !attemptsIncremented && finish;
ScoreEvaluation sceval = new ScoreEvaluation(new Float(0.0f), Boolean.valueOf(passed));
scormNode.updateUserScoreEvaluation(sceval, userCourseEnv, identity, false, Role.user);
if (increment) {
attemptsIncremented = true;
}
}
if (log.isDebug()) {
String msg = "for scorm node:" + scormNode.getIdent() + " (" + scormNode.getShortTitle() + ") a lmsCommit for scoId " + olatSahsId + " occured, passed: " + passed + ", all lesson status now = " + lessonStatusProp.toString();
log.debug(msg, null);
}
}
use of org.olat.modules.ModuleConfiguration in project openolat by klemens.
the class AbstractCourseNodeWebService method updateCourseNode.
// fxdiff FXOLAT-122: course management
private CourseNodeVO updateCourseNode(String nodeId, String shortTitle, String longTitle, String learningObjectives, String visibilityExpertRules, String accessExpertRules, CustomConfigDelegate delegateConfig, CourseEditSession editSession) {
ICourse course = editSession.getCourse();
TreeNode updateEditorNode = course.getEditorTreeModel().getNodeById(nodeId);
CourseNode updatedNode = course.getEditorTreeModel().getCourseNode(nodeId);
if (StringHelper.containsNonWhitespace(shortTitle)) {
updatedNode.setShortTitle(shortTitle);
}
if (StringHelper.containsNonWhitespace(longTitle)) {
updatedNode.setLongTitle(longTitle);
}
if (StringHelper.containsNonWhitespace(learningObjectives)) {
updatedNode.setLearningObjectives(learningObjectives);
}
if (visibilityExpertRules != null) {
Condition cond = createExpertCondition(CONDITION_ID_VISIBILITY, visibilityExpertRules);
updatedNode.setPreConditionVisibility(cond);
}
if (StringHelper.containsNonWhitespace(accessExpertRules) && updatedNode instanceof AbstractAccessableCourseNode) {
Condition cond = createExpertCondition(CONDITION_ID_ACCESS, accessExpertRules);
((AbstractAccessableCourseNode) updatedNode).setPreConditionAccess(cond);
}
if (delegateConfig != null) {
ModuleConfiguration moduleConfig = updatedNode.getModuleConfiguration();
delegateConfig.configure(course, updatedNode, moduleConfig);
}
course.getEditorTreeModel().nodeConfigChanged(updateEditorNode);
CourseEditorTreeNode editorNode = course.getEditorTreeModel().getCourseEditorNodeContaining(updatedNode);
CourseNodeVO vo = get(updatedNode);
vo.setParentId(editorNode.getParent() == null ? null : editorNode.getParent().getIdent());
return vo;
}
Aggregations