Package org.olat.ims.qti.process.elements

Examples of org.olat.ims.qti.process.elements.ScoreBooleanEvaluable.eval()


    boolean ev = false;
    for (int i = 0; i < size; i++) {
      Element child = (Element)elems.get(i);
      String name = child.getName();
      ScoreBooleanEvaluable bev = QTIHelper.getSectionBooleanEvaluableInstance(name);
      boolean res = bev.eval(child, score);
      ev = ev || res;
      if (ev) return true;
    }
    return false;
  }
View Full Code Here


        // not_test)>
        Element el_varandornot = (Element) el_testvar.selectSingleNode("variable_test|and_test|or_test|not_test");
        String elname = el_varandornot.getName();
        ScoreBooleanEvaluable sbe = QTIHelper.getSectionBooleanEvaluableInstance(elname);
        float totalscore = getScore();
        boolean fulfilled = sbe.eval(el_varandornot, totalscore);
        if (fulfilled) {
          // get feedback
          Element el_displayfeedback = (Element) el_oft.selectSingleNode("displayfeedback");
          String linkRefId = el_displayfeedback.attributeValue("linkrefid");
          // must exist (dtd)
View Full Code Here

    boolean ev = true;
    for (int i = 0; i < size; i++) {
      Element child = (Element)elems.get(i);
      String name = child.getName();
      ScoreBooleanEvaluable bev = QTIHelper.getSectionBooleanEvaluableInstance(name);
      boolean res = bev.eval(child, score);
      ev = ev && res;
      if (!ev) return false;
    }
    return true;
  }
View Full Code Here

  public boolean eval(Element boolElement, float score) {
    // since the dom is validated against the dtd, we know the not element has exactly one child element.
    Element child = (Element) boolElement.elements().get(0);
    String name = child.getName();
    ScoreBooleanEvaluable bev = QTIHelper.getSectionBooleanEvaluableInstance(name);
    boolean res = !bev.eval(child, score);
    return res;
  }

}
View Full Code Here

      // not_test)>
      Element el_varandornot = (Element) el_testvar.selectSingleNode("variable_test|and_test|or_test|not_test");
      String elname = el_varandornot.getName();
      ScoreBooleanEvaluable sbe = QTIHelper.getSectionBooleanEvaluableInstance(elname);
      float totalscore = getScore();
      boolean fulfilled = sbe.eval(el_varandornot, totalscore);
      if (fulfilled) {
        // get feedback
        Element el_displayfeedback = (Element) el_oft.selectSingleNode("displayfeedback");
        String linkRefId = el_displayfeedback.attributeValue("linkrefid");
        // must exist (dtd)
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.