Examples of ModuleConfiguration


Examples of org.olat.modules.ModuleConfiguration

  /**
   * Init config parameter with default values for a new course node.
   */
  @Override
  public void updateModuleConfigDefaults(boolean isNewNode) {
    ModuleConfiguration config = getModuleConfiguration();
    if (isNewNode) {
      // use defaults for new course building blocks
      // task defaults
      config.set(CONF_TASK_ENABLED, Boolean.TRUE);
      config.set(CONF_TASK_TYPE, TaskController.TYPE_MANUAL);
      config.set(CONF_TASK_TEXT, "");
      config.set(CONF_TASK_SAMPLING_WITH_REPLACEMENT, Boolean.TRUE);
      // dropbox defaults
      config.set(CONF_DROPBOX_ENABLED, Boolean.TRUE);
      config.set(CONF_RETURNBOX_ENABLED, Boolean.TRUE);
      config.set(CONF_DROPBOX_ENABLEMAIL, Boolean.FALSE);
      config.set(CONF_DROPBOX_CONFIRMATION, "");
      // scoring defaults
      config.set(CONF_SCORING_ENABLED, Boolean.TRUE);
      // New config parameter version 2
      config.setBooleanEntry(CONF_TASK_PREVIEW, false);
      // solution defaults
      config.set(CONF_SOLUTION_ENABLED, Boolean.TRUE);
      MSCourseNode.initDefaultConfig(config);
      config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
    } else {
      int version = config.getConfigurationVersion();
      if (version < CURRENT_CONFIG_VERSION) {
        // Loaded config is older than current config version => migrate
        if (version == 1) {
          // migrate V1 => V2
          config.setBooleanEntry(CONF_TASK_PREVIEW, false);
          // solution defaults
          config.set(CONF_SOLUTION_ENABLED, Boolean.FALSE);
          MSCourseNode.initDefaultConfig(config);
          version = 2;
        }
        config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
      }
    }
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

   * @param isNewNode true: an initial configuration is set; false: upgrading
   *          from previous node configuration version, set default to maintain
   *          previous behaviour
   */
  public void updateModuleConfigDefaults(boolean isNewNode) {
    ModuleConfiguration config = getModuleConfiguration();
    if (isNewNode) {
      // use defaults for new course building blocks
      config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, Boolean.FALSE.booleanValue());
      config.setConfigurationVersion(2);
    } else {
      // clear old popup configuration
      config.remove(NodeEditController.CONFIG_INTEGRATION);
      config.remove("width");
      config.remove("height");
      if (config.getConfigurationVersion() < 2) {
        // update new configuration options using default values for existing nodes
        config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, Boolean.TRUE.booleanValue());
        config.setConfigurationVersion(2);
      }
      // else node is up-to-date - nothing to do
    }
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#hasCommentConfigured()
   */
  public boolean hasCommentConfigured() {
    ModuleConfiguration config = getModuleConfiguration();
    Boolean comment = (Boolean) config.get(CONFIG_KEY_HAS_COMMENT_FIELD);
    if (comment == null) return false;
    return comment.booleanValue();
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#hasPassedConfigured()
   */
  public boolean hasPassedConfigured() {
    ModuleConfiguration config = getModuleConfiguration();
    Boolean passed = (Boolean) config.get(CONFIG_KEY_HAS_PASSED_FIELD);
    if (passed == null) return false;
    return passed.booleanValue();
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#hasScoreConfigured()
   */
  public boolean hasScoreConfigured() {
    ModuleConfiguration config = getModuleConfiguration();
    Boolean score = (Boolean) config.get(CONFIG_KEY_HAS_SCORE_FIELD);
    if (score == null) return false;
    return score.booleanValue();
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
   */
  public Float getMaxScoreConfiguration() {
    if (!hasScoreConfigured()) { throw new OLATRuntimeException(MSCourseNode.class, "getMaxScore not defined when hasScore set to false", null); }
    ModuleConfiguration config = getModuleConfiguration();
    Float max = (Float) config.get(CONFIG_KEY_SCORE_MAX);
    return max;
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
   */
  public Float getMinScoreConfiguration() {
    if (!hasScoreConfigured()) { throw new OLATRuntimeException(MSCourseNode.class, "getMinScore not defined when hasScore set to false", null); }
    ModuleConfiguration config = getModuleConfiguration();
    Float min = (Float) config.get(CONFIG_KEY_SCORE_MIN);
    return min;
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
   */
  public Float getCutValueConfiguration() {
    if (!hasPassedConfigured()) { throw new OLATRuntimeException(MSCourseNode.class, "getCutValue not defined when hasPassed set to false", null); }
    ModuleConfiguration config = getModuleConfiguration();
    Float cut = (Float) config.get(CONFIG_KEY_PASSED_CUT_VALUE);
    return cut;
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  private void init(UserRequest ureq, CalCourseNode courseNode, UserCourseEnvironment courseEnv) {
    ICourse course = CourseFactory.loadCourse(courseEnv.getCourseEnvironment().getCourseResourceableId());
    CourseCalendars myCal = CourseCalendars.createCourseCalendarsWrapper(ureq, getWindowControl(), course);

    Date refDate;
    ModuleConfiguration config = courseNode.getModuleConfiguration();
    if (CalEditController.getAutoDate(config)) {
      refDate = new Date();
    } else {
      refDate = CalEditController.getStartDate(config);
      if (refDate == null) refDate = new Date();
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

   * @param isNewNode true: an initial configuration is set; false: upgrading
   *          from previous node configuration version, set default to maintain
   *          previous behaviour
   */
  public void updateModuleConfigDefaults(boolean isNewNode) {
    ModuleConfiguration config = getModuleConfiguration();
    if (isNewNode) {
      // add default module configuration
      config.set(IQEditController.CONFIG_KEY_ENABLEMENU, new Boolean(true));
      config.set(IQEditController.CONFIG_KEY_SEQUENCE, AssessmentInstance.QMD_ENTRY_SEQUENCE_ITEM);
      config.set(IQEditController.CONFIG_KEY_TYPE, AssessmentInstance.QMD_ENTRY_TYPE_SURVEY);
      config.set(IQEditController.CONFIG_KEY_SUMMARY, AssessmentInstance.QMD_ENTRY_SUMMARY_NONE); // not used in survey
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.