Search in sources :

Example 1 with PasswordStore

use of org.olat.course.condition.additionalconditions.PasswordStore in project OpenOLAT by OpenOLAT.

the class CourseNodePasswordManagerImpl method updatePwd.

/**
 * @see de.bps.course.nodes.CourseNodePasswordManager#updatePwd(org.olat.core.id.Identity, java.lang.String, java.lang.String, java.lang.String)
 */
@Override
public void updatePwd(Identity identity, String nodeIdentifier, Long courseId, String value) {
    AdditionalConditionAnswerContainer answers = getAnswerContainer(identity);
    if (answers == null) {
        answers = new AdditionalConditionAnswerContainer();
    }
    PasswordStore pwdStore = (PasswordStore) answers.getAnswers(nodeIdentifier, courseId);
    if (pwdStore != null) {
        pwdStore.setPassword(value);
    } else {
        PasswordStore store = new PasswordStore();
        store.setPassword(value);
        store.setNodeIdent(Long.valueOf(nodeIdentifier));
        store.setCourseId(Long.valueOf(courseId));
        answers.insertAnswer(nodeIdentifier, courseId, store);
    }
    persistAnswerContainer(identity, answers);
}
Also used : PasswordStore(org.olat.course.condition.additionalconditions.PasswordStore) AdditionalConditionAnswerContainer(org.olat.course.condition.additionalconditions.AdditionalConditionAnswerContainer)

Example 2 with PasswordStore

use of org.olat.course.condition.additionalconditions.PasswordStore in project openolat by klemens.

the class CourseNodePasswordManagerImpl method updatePwd.

/**
 * @see de.bps.course.nodes.CourseNodePasswordManager#updatePwd(org.olat.core.id.Identity, java.lang.String, java.lang.String, java.lang.String)
 */
@Override
public void updatePwd(Identity identity, String nodeIdentifier, Long courseId, String value) {
    AdditionalConditionAnswerContainer answers = getAnswerContainer(identity);
    if (answers == null) {
        answers = new AdditionalConditionAnswerContainer();
    }
    PasswordStore pwdStore = (PasswordStore) answers.getAnswers(nodeIdentifier, courseId);
    if (pwdStore != null) {
        pwdStore.setPassword(value);
    } else {
        PasswordStore store = new PasswordStore();
        store.setPassword(value);
        store.setNodeIdent(Long.valueOf(nodeIdentifier));
        store.setCourseId(Long.valueOf(courseId));
        answers.insertAnswer(nodeIdentifier, courseId, store);
    }
    persistAnswerContainer(identity, answers);
}
Also used : PasswordStore(org.olat.course.condition.additionalconditions.PasswordStore) AdditionalConditionAnswerContainer(org.olat.course.condition.additionalconditions.AdditionalConditionAnswerContainer)

Aggregations

AdditionalConditionAnswerContainer (org.olat.course.condition.additionalconditions.AdditionalConditionAnswerContainer)2 PasswordStore (org.olat.course.condition.additionalconditions.PasswordStore)2