Examples of CourseEditorEnv


Examples of org.olat.course.editor.CourseEditorEnv

        "error.argtype.groupnameexpected", "solution.example.name.infunction"));
    String groupName = (String)inStack[0];
    /*
     * check reference integrity
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) {
      if (!cev.existsRightGroup(groupName)) { return handleException( new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name, groupName,
          "error.notfound.name", "solution.checkgroupmanagement")); }
      // remember the reference to the node id for this condtion
      cev.addSoftReference("groupId", groupName);
      // return a valid value to continue with condition evaluation test
      return defaultValue();
    }

    /*
 
View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

   */
  public Object call(Object[] inStack) {
    /*
     * expression check only if cev != null
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) {
      // return a valid value to continue with condition evaluation test
      return defaultValue();
    }

View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

   */
  public Object call(Object[] inStack) {
    /*
     * expression check only if cev != null
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) {
      // return a valid value to continue with condition evaluation test
      return defaultValue();
    }

View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

   */
  public OnlyGroupConditionInterpreter(UserCourseEnvironment userCourseEnv) {
    super();
    uce = userCourseEnv;
    //
    CourseEditorEnv cev = uce.getCourseEditorEnv();
    if (cev != null) {
      translator = new PackageTranslator(PACKAGE, cev.getEditorEnvLocale());
    }

    env = new Environment();

    // constants: add for user convenience
View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

        "error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
    String childId = (String) inStack[1];
    /*
     * no integrity check can be done - other course might not exist anymore
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) { return defaultValue(); }

    /*
     * the real function evaluation which is used during run time
     */
 
View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

        "error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
    String childId = (String) inStack[1];
    /*
     * no integrity check can be done - other course might not exist anymore
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) { return defaultValue(); }

    /*
     * the real function evaluation which is used during run time
     */
 
View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

        "error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
    String childId = (String) inStack[0];
    /*
     * check reference integrity
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) {
      if (!cev.existsNode(childId)) { return handleException( new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name, childId,
          "error.notfound.coursenodeid", "solution.copypastenodeid")); }
      if (!cev.isAssessable(childId)) { return handleException(new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name,
          childId, "error.notassessable.coursenodid", "solution.takeassessablenode")); }
      // remember the reference to the node id for this condtion
      cev.addSoftReference("courseNodeId", childId);
      // return a valid value to continue with condition evaluation test
      return defaultValue();
    }

    /*
 
View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

        "error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
    String childId = (String) inStack[0];
    /*
     * check reference integrity
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) {
      if (!cev.existsNode(childId)) { return handleException( new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name, childId,
          "error.notfound.coursenodeid", "solution.copypastenodeid")); }
      if (!cev.isAssessable(childId)) { return handleException(new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name,
          childId, "error.notassessable.coursenodid", "solution.takeassessablenode")); }
      // remember the reference to the node id for this condtion
      cev.addSoftReference("courseNodeId", childId);
      // return a valid value to continue with condition evaluation test
      return defaultValue();
    }

    /*
 
View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

   
    if (StringHelper.containsNonWhitespace(scoreExp)) {   
      /*
       *  not empty, now test precondition syntax and for existing soft references
       */
      CourseEditorEnv cev = euce.getCourseEditorEnv();
      ConditionExpression ce = new ConditionExpression("score",scoreExp);
      ConditionErrorMessage[] cerrmsgs = cev.validateConditionExpression(ce);
      /*
       * display any error detected in the condition expression testing.
       */
      if (cerrmsgs != null && cerrmsgs.length>0) {
        //the error message
        tscoreexpr.setErrorKeyWithParams(cerrmsgs[0].errorKey, cerrmsgs[0].errorKeyParams);
        if (cerrmsgs[0].solutionMsgKey != null && !"".equals(cerrmsgs[0].solutionMsgKey)) {
          //and a hint or example to clarify the error message
          tscoreexpr.setExample(translate(cerrmsgs[0].solutionMsgKey, cerrmsgs[0].errorKeyParams));
        }
        return false;
      }     
      testElemWithNoResource = getInvalidNodeDescriptions(ce);           
    }
    if (StringHelper.containsNonWhitespace(passedExp)) {
      /*
       *  not empty, now test precondition syntax and for existing soft references
       */
      CourseEditorEnv cev = euce.getCourseEditorEnv();
      ConditionExpression ce = new ConditionExpression("passed",passedExp);
      ConditionErrorMessage[] cerrmsgs = cev.validateConditionExpression(ce);
      /*
       * display any error detected in the condition expression testing.
       */
      if (cerrmsgs != null && cerrmsgs.length>0) {
        //the error message
View Full Code Here

Examples of org.olat.course.editor.CourseEditorEnv

        name, "", "error.argtype.coursnodeidexpeted", "solution.example.node.infunction"));
    String nodeId = (String) inStack[0];
    /*
     * check reference integrity
     */
    CourseEditorEnv cev = getUserCourseEnv().getCourseEditorEnv();
    if (cev != null) {
      if (!cev.existsNode(nodeId)) { return handleException(new ArgumentParseException(ArgumentParseException.REFERENCE_NOT_FOUND, name,
          nodeId, "error.notfound.coursenodeid", "solution.copypastenodeid")); }
      // remember the reference to the node id for this condtion
      cev.addSoftReference("courseNodeId", nodeId);
      // return a valid value to continue with condition evaluation test
      return defaultValue();
    }

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