Examples of ModuleConfiguration


Examples of org.olat.modules.ModuleConfiguration

    super(wControl);
    PackageTranslator trans = new PackageTranslator(PACKAGE, ureq.getLocale());
   
    myContent = new VelocityContainer("olatmsrun", VELOCITY_ROOT + "/run.html", trans, this);
   
    ModuleConfiguration config = msCourseNode.getModuleConfiguration();
    myContent.contextPut("displayNodeInfo", Boolean.valueOf(displayNodeInfo));
    if (displayNodeInfo) {
      // push title and learning objectives, only visible on intro page
      myContent.contextPut("menuTitle", msCourseNode.getShortTitle());
      myContent.contextPut("displayTitle", msCourseNode.getLongTitle());
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

    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(CONFIG_AREANAME);
    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(CONFIG_GROUPNAME);
    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

Examples of org.olat.modules.ModuleConfiguration

 
  /**
   * Init config parameter with default values for a new course node.
   */
  private void initDefaultConfig() {
    ModuleConfiguration config = getModuleConfiguration();
    // defaults
    config.set(CONF_CANCEL_ENROLL_ENABLED, Boolean.TRUE);
    config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
  }
View Full Code Here

Examples of org.olat.modules.ModuleConfiguration

  }
  /**
   * Migrate (add new config parameter/values) config parameter for a existing course node.
   */
  private void migrateConfig() {
    ModuleConfiguration config = getModuleConfiguration();
    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.set(CONF_CANCEL_ENROLL_ENABLED, Boolean.TRUE);
        version = 2;
      }
      config.setConfigurationVersion(CURRENT_CONFIG_VERSION);
    }
  }
View Full Code Here

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

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, 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

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.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

Examples of org.olat.modules.ModuleConfiguration

    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

Examples of org.olat.modules.ModuleConfiguration

     * @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

Examples of org.olat.modules.ModuleConfiguration

  /**
   * @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
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.