Search in sources :

Example 16 with ModuleConfiguration

use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.

the class PFCourseNode method updateModuleConfig.

public void updateModuleConfig(boolean participantbox, boolean coachbox, boolean alterfile, boolean limitcount, int filecount, boolean timeframe, Date start, Date end) {
    ModuleConfiguration config = getModuleConfiguration();
    config.setBooleanEntry(CONFIG_KEY_PARTICIPANTBOX, participantbox);
    config.setBooleanEntry(CONFIG_KEY_COACHBOX, coachbox);
    config.setBooleanEntry(CONFIG_KEY_ALTERFILE, alterfile);
    config.setBooleanEntry(CONFIG_KEY_LIMITCOUNT, limitcount);
    if (limitcount) {
        config.set(CONFIG_KEY_FILECOUNT, filecount);
    }
    config.setBooleanEntry(CONFIG_KEY_TIMEFRAME, timeframe);
    if (timeframe) {
        config.set(CONFIG_KEY_DATESTART, start);
        config.set(CONFIG_KEY_DATEEND, end);
    }
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration)

Example 17 with ModuleConfiguration

use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.

the class PFCourseNode method isInDropboxTimeFrame.

public boolean isInDropboxTimeFrame() {
    ModuleConfiguration config = getModuleConfiguration();
    Date start = config.getBooleanEntry(CONFIG_KEY_DATESTART) != null ? (Date) config.getDateValue(CONFIG_KEY_DATESTART) : new Date();
    Date end = config.getBooleanEntry(CONFIG_KEY_DATEEND) != null ? (Date) config.getDateValue(CONFIG_KEY_DATEEND) : new Date();
    Date current = new Date();
    return start.before(current) && end.after(current);
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) Date(java.util.Date)

Example 18 with ModuleConfiguration

use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.

the class ProjectBrokerCourseNode method getCutValueConfiguration.

/**
 * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
 */
@Override
public Float getCutValueConfiguration() {
    if (!hasPassedConfigured()) {
        throw new OLATRuntimeException(ProjectBrokerCourseNode.class, "getCutValue not defined when hasPassed set to false", null);
    }
    ModuleConfiguration config = getModuleConfiguration();
    Float cut = (Float) config.get(MSCourseNode.CONFIG_KEY_PASSED_CUT_VALUE);
    return cut;
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException)

Example 19 with ModuleConfiguration

use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.

the class ProjectBrokerCourseNode method getMinScoreConfiguration.

/**
 * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
 */
@Override
public Float getMinScoreConfiguration() {
    if (!hasScoreConfigured()) {
        throw new OLATRuntimeException(ProjectBrokerCourseNode.class, "getMinScore not defined when hasScore set to false", null);
    }
    ModuleConfiguration config = getModuleConfiguration();
    Float min = (Float) config.get(MSCourseNode.CONFIG_KEY_SCORE_MIN);
    return min;
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException)

Example 20 with ModuleConfiguration

use of org.olat.modules.ModuleConfiguration in project OpenOLAT by OpenOLAT.

the class ProjectBrokerCourseNode method getMaxScoreConfiguration.

/**
 * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
 */
@Override
public Float getMaxScoreConfiguration() {
    if (!hasScoreConfigured()) {
        throw new OLATRuntimeException(ProjectBrokerCourseNode.class, "getMaxScore not defined when hasScore set to false", null);
    }
    ModuleConfiguration config = getModuleConfiguration();
    Float max = (Float) config.get(MSCourseNode.CONFIG_KEY_SCORE_MAX);
    return max;
}
Also used : ModuleConfiguration(org.olat.modules.ModuleConfiguration) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException)

Aggregations

ModuleConfiguration (org.olat.modules.ModuleConfiguration)296 ArrayList (java.util.ArrayList)34 OLATRuntimeException (org.olat.core.logging.OLATRuntimeException)28 ICourse (org.olat.course.ICourse)26 CourseNode (org.olat.course.nodes.CourseNode)26 Date (java.util.Date)22 RepositoryEntry (org.olat.repository.RepositoryEntry)22 File (java.io.File)20 CheckboxList (org.olat.course.nodes.cl.model.CheckboxList)18 List (java.util.List)16 Identity (org.olat.core.id.Identity)16 CheckboxManager (org.olat.course.nodes.cl.CheckboxManager)16 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)16 Translator (org.olat.core.gui.translator.Translator)14 AssessmentManager (org.olat.course.assessment.AssessmentManager)14 CourseEnvironment (org.olat.course.run.environment.CourseEnvironment)14 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)14 VFSItem (org.olat.core.util.vfs.VFSItem)12 BusinessGroup (org.olat.group.BusinessGroup)12 Checkbox (org.olat.course.nodes.cl.model.Checkbox)11