Package org.olat.modules

Examples of org.olat.modules.ModuleConfiguration


  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
   */
  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;
  }
View Full Code Here


  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
   */
  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;
  }
View Full Code Here

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
   */
  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;
  }
View Full Code Here

  /**
   * 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
      // dropbox defaults
      config.set(CONF_DROPBOX_ENABLED, Boolean.TRUE);
      config.set(CONF_DROPBOX_ENABLEMAIL, Boolean.FALSE);
      config.set(CONF_DROPBOX_CONFIRMATION, "");
      // scoring defaults
      config.set(CONF_SCORING_ENABLED, Boolean.FALSE);
      // returnbox defaults
      config.set(CONF_RETURNBOX_ENABLED, Boolean.TRUE);
      // New config parameter version 2
      config.setBooleanEntry(CONF_TASK_PREVIEW, false);
      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
          // <XXX> add migration code here for futur update
          //version = 2;
        }
        config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
      }
    }
  }
View Full Code Here

   *      all course nodes must call updateModuleConfigDefaults(true) here
   */
  public GenericCourseNode(String type) {
    super();
    this.type = type;
    moduleConfiguration = new ModuleConfiguration();
  }
View Full Code Here

        + " course node descriptions. ****", null);
  }
 

  private void migrateSingleTask(CourseNode node) {
    ModuleConfiguration taskConf = node.getModuleConfiguration();
    String[] allKeys = new String[] { TACourseNode.CONF_TASK_TEXT, MSCourseNode.CONFIG_KEY_INFOTEXT_USER,
        MSCourseNode.CONFIG_KEY_INFOTEXT_COACH };
    for (int i = 0; i < allKeys.length; i++) {
      String thisKey = allKeys[i];
      String oldDesc = (String) taskConf.get(thisKey);
      if (StringHelper.containsNonWhitespace(oldDesc)) {
        String newDesc = Formatter.formatWikiMarkup(oldDesc);
        taskConf.set(thisKey, newDesc);
      }
    }
  }
View Full Code Here

      node.setNoAccessExplanation(newDesc);
    }
  }

  private void migrateSingleAssessment(CourseNode node) {
    ModuleConfiguration modConfig = node.getModuleConfiguration();
    String infoUser = (String) modConfig.get(MSCourseNode.CONFIG_KEY_INFOTEXT_USER);
    String newInfoUser = Formatter.formatWikiMarkup(infoUser);
    modConfig.set(MSCourseNode.CONFIG_KEY_INFOTEXT_USER, newInfoUser);
    String infoCoach = (String) modConfig.get(MSCourseNode.CONFIG_KEY_INFOTEXT_COACH);
    String newInfoCoach = Formatter.formatWikiMarkup(infoCoach);
    modConfig.set(MSCourseNode.CONFIG_KEY_INFOTEXT_COACH, newInfoCoach);
  }
View Full Code Here

    int PAGE_SIZE = 20;
    PackageTranslator translator = new PackageTranslator(this.getClass().getPackage().getName(), Locale.GERMAN);

    ProjectBroker projectBrokerD = ProjectBrokerManagerFactory.getProjectBrokerManager().createAndSaveProjectBroker();
    Long idProjectBrokerD = projectBrokerD.getKey();
    ProjectBrokerModuleConfiguration moduleConfig = new ProjectBrokerModuleConfiguration( new ModuleConfiguration() );

    for (int i = 0; i < ITERATION; i++) {
      createProject("thema D1_" + i, id1, idProjectBrokerD, resourceableId );     
    }
    List projectListD = ProjectBrokerManagerFactory.getProjectBrokerManager().getProjectListBy(idProjectBrokerD);
View Full Code Here

  }

  public void testIsProjectManager() throws Exception {
    ProjectBroker projectBrokerD = ProjectBrokerManagerFactory.getProjectBrokerManager().createAndSaveProjectBroker();
    Long idProjectBrokerD = projectBrokerD.getKey();
    ProjectBrokerModuleConfiguration moduleConfig = new ProjectBrokerModuleConfiguration( new ModuleConfiguration() );
   
    Project testProjectA = createProject("thema A", id1, idProjectBrokerD, resourceableId );
    List<Identity> projectManagerList = new ArrayList<Identity>();
    projectManagerList.add(id1);
    BGConfigFlags flags = BGConfigFlags.createRightGroupDefaultFlags();
View Full Code Here

TOP

Related Classes of org.olat.modules.ModuleConfiguration

Copyright © 2018 www.massapicom. 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.