Package org.olat.modules

Examples of org.olat.modules.ModuleConfiguration


   *      org.olat.course.run.userview.NodeEvaluation)
   */
  public Controller createPeekViewRunController(UserRequest ureq, WindowControl wControl, UserCourseEnvironment userCourseEnv, NodeEvaluation ne) {
    if (ne.isAtLeastOneAccessible()) {
      OLATResourceable ores = OresHelper.createOLATResourceableInstance(CourseModule.class, userCourseEnv.getCourseEnvironment().getCourseResourceableId());
      ModuleConfiguration config = getModuleConfiguration();
      return new SPPeekviewController(ureq, wControl, userCourseEnv, config, ores);     
    } else {
      // use standard peekview
      return super.createPeekViewRunController(ureq, wControl, userCourseEnv, ne);
    }
View Full Code Here


   * @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, false);
      config.setBooleanEntry(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, false);
      // new since config version 3
      config.setBooleanEntry(SPEditController.CONFIG_IFRAME, Boolean.TRUE.booleanValue());
      config.set(SPEditController.CONFIG_KEY_STATEFUL, Boolean.FALSE.toString());
      config.setConfigurationVersion(3);
    } else {
      config.remove(NodeEditController.CONFIG_INTEGRATION);
      int version = config.getConfigurationVersion();
      if (version < 2) {
        // use values accoring to previous functionality
        config.setBooleanEntry(NodeEditController.CONFIG_STARTPAGE, Boolean.FALSE.booleanValue());
        config.setBooleanEntry(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, Boolean.FALSE.booleanValue());
        config.setConfigurationVersion(2);
      }
      if (version < 3) {
        config.setBooleanEntry(SPEditController.CONFIG_IFRAME, Boolean.TRUE.booleanValue());
        config.set(SPEditController.CONFIG_KEY_STATEFUL, Boolean.FALSE.toString());
        config.setConfigurationVersion(3);
      }
    }
  }
View Full Code Here

   * @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.TRUE.booleanValue());
      config.setBooleanEntry(NodeEditController.CONFIG_COMPONENT_MENU, Boolean.TRUE.booleanValue());
      config.setBooleanEntry(ScormEditController.CONFIG_SHOWNAVBUTTONS, Boolean.TRUE.booleanValue());
      config.set(ScormEditController.CONFIG_HEIGHT, ScormEditController.CONFIG_HEIGHT_AUTO);
      config.setConfigurationVersion(1);
    } else {
      int version = config.getConfigurationVersion();
      if (version < CURRENT_CONFIG_VERSION) {
        // Loaded config is older than current config version => migrate
        if (version == 1) {
          version = 2;
          // remove old config from previous versions
          config.remove(NodeEditController.CONFIG_INTEGRATION);
          // add new parameter 'shownavbuttons' and 'height'
          config.setBooleanEntry(ScormEditController.CONFIG_SHOWNAVBUTTONS, Boolean.TRUE.booleanValue());
          config.set(ScormEditController.CONFIG_HEIGHT, ScormEditController.CONFIG_HEIGHT_AUTO);         
          // verion is now set to 2
          config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
        }
      }

     
    }
View Full Code Here

    translator = new PackageTranslator(PACKAGE, ureq.getLocale());
    myContent = new VelocityContainer("taskVC", VELOCITY_ROOT + "/dropboxscoring.html", translator, this);
    taskLaunchButton = LinkFactory.createButton("task.launch", myContent, this);
    setInitialComponent(myContent);

    ModuleConfiguration modConfig = node.getModuleConfiguration();
    Boolean bValue = (Boolean)modConfig.get(TACourseNode.CONF_TASK_ENABLED);
    myContent.contextPut("hasTask", (bValue != null) ? bValue : new Boolean(false));
    Boolean hasDropbox = (Boolean)modConfig.get(TACourseNode.CONF_DROPBOX_ENABLED); //configured value
    Boolean hasDropboxValue = (hasDropbox != null) ? hasDropbox : new Boolean(true);
    myContent.contextPut("hasDropbox", hasDropboxValue);
   
    Boolean hasReturnbox = (Boolean)modConfig.get(TACourseNode.CONF_RETURNBOX_ENABLED);
    myContent.contextPut("hasReturnbox", (hasReturnbox != null) ? hasReturnbox : hasDropboxValue);

    // dropbox display
    String assesseeName = userCourseEnv.getIdentityEnvironment().getIdentity().getName();
    OlatRootFolderImpl rootDropbox = new OlatRootFolderImpl(getDropboxFilePath(assesseeName), null);
View Full Code Here

     * @param assessmentManager The course property manager to get user results
     * @param identity The current identity
     */
  public CourseIQSecurityCallback(IQTESTCourseNode iqtestCourseNode, AssessmentManager assessmentManager, Identity identity) {
    super();
    ModuleConfiguration config = iqtestCourseNode.getModuleConfiguration();
    Integer attConf =  (Integer) config.get(IQEditController.CONFIG_KEY_ATTEMPTS);
    if (attConf == null) {
        // number of attempts configuration is set to unlimited, use internal value of 10000
        this.attemptsConfig = 10000;
    } else {
        this.attemptsConfig = attConf.intValue();
View Full Code Here

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
   */
  public Float getCutValueConfiguration() {
    ModuleConfiguration config = this.getModuleConfiguration();
    int cutValue = config.getIntegerSafe(ScormEditController.CONFIG_CUTVALUE, 0);
    return new Float(new Integer(cutValue).floatValue());
  }
View Full Code Here

    List condErrs = isConfigValidWithTranslator(cev, translatorStr, getConditionExpressions());
    List missingNames = new ArrayList();
    /*
     * check group and area names for existence
     */
    ModuleConfiguration mc = getModuleConfiguration();
    String areaStr = (String) mc.get(COEditController.CONFIG_KEY_EMAILTOAREAS);
    String nodeId = getIdent();
    if (areaStr != null) {
      String[] areas = areaStr.split(",");
      for (int i = 0; i < areas.length; i++) {
        String trimmed = areas[i] != null ? areas[i].trim() : areas[i];
        if (!trimmed.equals("") && !cev.existsArea(trimmed)) {
          StatusDescription sd = new StatusDescription(StatusDescription.WARNING, "error.notfound.name", "solution.checkgroupmanagement",
              new String[] { "NONE", trimmed }, translatorStr);
          sd.setDescriptionForUnit(nodeId);
          missingNames.add(sd);
        }
      }
    }
    String groupStr = (String) mc.get(COEditController.CONFIG_KEY_EMAILTOGROUPS);
    if (groupStr != null) {
      String[] groups = groupStr.split(",");
      for (int i = 0; i < groups.length; i++) {
        String trimmed = groups[i] != null ? groups[i].trim() : groups[i];
        if (!trimmed.equals("") && !cev.existsGroup(trimmed)) {
View Full Code Here

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getCutValueConfiguration()
   */
  public Float getCutValueConfiguration() {
    ModuleConfiguration config = this.getModuleConfiguration();
    return (Float) config.get(IQEditController.CONFIG_KEY_CUTVALUE);
  }
View Full Code Here

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMaxScoreConfiguration()
   */
  public Float getMaxScoreConfiguration() {
    ModuleConfiguration config = this.getModuleConfiguration();
    return (Float) config.get(IQEditController.CONFIG_KEY_MAXSCORE);
  }
View Full Code Here

  /**
   * @see org.olat.course.nodes.AssessableCourseNode#getMinScoreConfiguration()
   */
  public Float getMinScoreConfiguration() {
    ModuleConfiguration config = this.getModuleConfiguration();
    return (Float) config.get(IQEditController.CONFIG_KEY_MINSCORE);
  }
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.