Package org.olat.ims.qti.container

Examples of org.olat.ims.qti.container.Variable


        String action = element.attributeValue("action");
        String varName = element.attributeValue("varname");
        if (varName == null) varName = "SCORE";
        varName.trim();
        String varVal = element.getText();
        Variable var = vars.getVariable(varName);
        if (var == null) throw new RuntimeException("var "+varName+" is in setvar, but was not declared ");
        if (action.equals("Set")) {
          var.setValue(varVal);
        } else {
          // we are doing Integer or float arithmetic
          // Add | Subtract | Multiply | Divide
          if (action.equals("Add")) {
            var.add(varVal);
          } else if (action.equals("Subtract")) {
            var.subtract(varVal);
          } else if (action.equals("Multiply")) {
            var.multiply(varVal);
          } else if (action.equals("Divide")) {
            var.divide(varVal);
          }
        }
      }
      // set displayfeedback
      //<displayfeedback feedbacktype = "Response" linkrefid = "Correct"/>
View Full Code Here


      Element decvar = (Element) iter.next();
      varName = decvar.attributeValue("varname"); // dtd CDATA 'SCORE'
      if (varName == null) varName = "SCORE";
      String varType = decvar.attributeValue("vartype");
      if (varType == null) varType = "Integer"; // default
      Variable v = null;
      if (varType.equals("Integer") || varType.equals("Decimal")) {
        String def = decvar.attributeValue("defaultval");
        String min = decvar.attributeValue("minvalue");
        String max = decvar.attributeValue("maxvalue");
        String cut = decvar.attributeValue("cutvalue");
View Full Code Here

TOP

Related Classes of org.olat.ims.qti.container.Variable

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.