Package org.olat.course.run.scoring

Examples of org.olat.course.run.scoring.ScoreCalculator


  /**
   * @return Returns the scoreCalculator.
   */
  public ScoreCalculator getScoreCalculator() {
    if (scoreCalculator == null) {
      scoreCalculator = new ScoreCalculator(null, null);
    }
    passedExpression = new Condition();
    passedExpression.setConditionId("passed");
    if (scoreCalculator.getPassedExpression() != null) {
      passedExpression.setConditionExpression(scoreCalculator.getPassedExpression());
View Full Code Here


    Condition accessCondition = stNode.getPreConditionAccess();
    accessibilityCondContr = new ConditionEditController(ureq, getWindowControl(), groupMgr, accessCondition, "accessabilityConditionForm",
        assessableChildren, euce);   
    this.listenTo(accessibilityCondContr);

    ScoreCalculator scoreCalc = stNode.getScoreCalculator();
    if (scoreCalc != null) {
      if (scoreCalc.isExpertMode() && scoreCalc.getPassedExpression() == null && scoreCalc.getScoreExpression() == null) {
        scoreCalc = null;
      } else if (!scoreCalc.isExpertMode() && scoreCalc.getPassedExpressionFromEasyModeConfiguration() == null
          && scoreCalc.getScoreExpressionFromEasyModeConfiguration() == null) {
        scoreCalc = null;
      }
    }

    if (assessableChildren.size() == 0 && scoreCalc == null) {
      // show only the no assessable children message, if no previous score
      // config exists.
      score.contextPut("noAssessableChildren", Boolean.TRUE);
    } else {
      score.contextPut("noAssessableChildren", Boolean.FALSE);
    }

    // Init score calculator form
    if (scoreCalc != null && scoreCalc.isExpertMode()) {
      initScoreExpertForm();
    } else {
      initScoreEasyForm();
    }
  }
View Full Code Here

        String msg = getWarningMessage(testElemWithNoResource);
        if(msg!=null) {               
          getWindowControl().setWarning(msg);
        }
       
        ScoreCalculator sc = scoreExpertForm.getScoreCalulator();
        /*
         * OLAT-1144 bug fix if a ScoreCalculator == NULL !
         */
        if (sc != null) {
          sc.clearEasyMode();
        }
        // ..setScoreCalculator(sc) can handle NULL values!
        stNode.setScoreCalculator(sc);
        fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
      } else if (event == Form.EVNT_FORM_CANCELLED) { // reload form
        initScoreExpertForm();
      }
    } else if (source == scoreEasyForm) {
      if (event == Form.EVNT_VALIDATION_OK) { 
        //show warning if the score might be wrong because of the invalid nodes used for calculation
        List<String> testElemWithNoResource = scoreEasyForm.getInvalidNodeDescriptions();
        String msg = getWarningMessage(testElemWithNoResource);
        if(msg!=null) {               
          getWindowControl().setWarning(msg);
        }
               
        ScoreCalculator sc = scoreEasyForm.getScoreCalulator();
        /*
         * OLAT-1144 bug fix if Calculation Score -> NO and Calculate passing
         * score -> NO we get a ScoreCalculator == NULL !
         */
        if (sc != null) {
          sc.setPassedExpression(sc.getPassedExpressionFromEasyModeConfiguration());
          sc.setScoreExpression(sc.getScoreExpressionFromEasyModeConfiguration());
        }
        // ..setScoreCalculator(sc) can handle NULL values!
        stNode.setScoreCalculator(sc);
        initScoreEasyForm(); // reload form, remove deleted nodes
        fireEvent(ureq, NodeEditController.NODECONFIG_CHANGED_EVENT);
View Full Code Here

TOP

Related Classes of org.olat.course.run.scoring.ScoreCalculator

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.