Package org.dom4j

Examples of org.dom4j.Element.attribute()


            Element e = (Element)node;
            if(localName == null) {
                result.addAll(e.attributes());
            }
            else {
                Attribute attr = e.attribute(e.getQName().getDocumentFactory().createQName(localName, "", namespaceUri));
                if(attr != null) {
                    result.add(attr);
                }
            }
        }
View Full Code Here


      Element response_lid = presentationXML.element("response_lid");
      if (response_lid == null && flow != null) {
        response_lid = flow.element("response_lid");
      }
      String identQuestion = response_lid.attribute("ident").getText();
      instance.setIdent(identQuestion);
      String shuffle = response_lid.element("render_choice").attributeValue("shuffle");
      if (shuffle == null) shuffle = "Yes";
      instance.setShuffle(shuffle.equals("Yes"));
View Full Code Here

    }
    // Extract min, max and cut value
    Float minValue = null, maxValue = null, cutValue = null;
    Element decvar = (Element) doc.selectSingleNode("questestinterop/assessment/outcomes_processing/outcomes/decvar");
    if (decvar != null) {
      Attribute minval = decvar.attribute("minvalue");
      if (minval != null) {
        String mv = minval.getValue();
        try {
          minValue = new Float(Float.parseFloat(mv));
        } catch (NumberFormatException e1) {
View Full Code Here

          minValue = new Float(Float.parseFloat(mv));
        } catch (NumberFormatException e1) {
          // if not correct in qti file -> ignore
        }
      }
      Attribute maxval = decvar.attribute("maxvalue");
      if (maxval != null) {
        String mv = maxval.getValue();
        try {
          maxValue = new Float(Float.parseFloat(mv));
        } catch (NumberFormatException e1) {
View Full Code Here

          maxValue = new Float(Float.parseFloat(mv));
        } catch (NumberFormatException e1) {
          // if not correct in qti file -> ignore
        }
      }
      Attribute cutval = decvar.attribute("cutvalue");
      if (cutval != null) {
        String cv = cutval.getValue();
        try {
          cutValue = new Float(Float.parseFloat(cv));
        } catch (NumberFormatException e1) {
View Full Code Here

    // Response
    List responses = instance.getResponses();
    EssayResponse response = new EssayResponse();
    Element response_str = (Element)presentationXML.selectSingleNode(".//response_str"); // export uses flow

    String ident = response_str.attribute("ident").getValue();
    response.setIdent(ident);
   
    Element render_fib = response_str.element("render_fib");
    response.setColumns(render_fib.attribute("columns"));
    response.setRows(render_fib.attribute("rows"));
View Full Code Here

    String ident = response_str.attribute("ident").getValue();
    response.setIdent(ident);
   
    Element render_fib = response_str.element("render_fib");
    response.setColumns(render_fib.attribute("columns"));
    response.setRows(render_fib.attribute("rows"));

    responses.add(response);
    instance.setResponses(responses);
View Full Code Here

    String ident = response_str.attribute("ident").getValue();
    response.setIdent(ident);
   
    Element render_fib = response_str.element("render_fib");
    response.setColumns(render_fib.attribute("columns"));
    response.setRows(render_fib.attribute("rows"));

    responses.add(response);
    instance.setResponses(responses);

    // No resprocessing since used only in survey mode
View Full Code Here

        if (mat != null)
        fibresponse.setContent(mat);
        fibresponse.setType(FIBResponse.TYPE_CONTENT);
        responses.add(fibresponse);
      } else if (name.equalsIgnoreCase("response_str")) {
        String ident = content.attribute("ident").getValue();
        Element render_fib = content.element("render_fib");
        content.element("render_fib").element("flow_label");
        fibresponse.setType(FIBResponse.TYPE_BLANK);
        fibresponse.setIdent(ident);
        fibresponse.setSizeFromColumns(render_fib.attribute("columns"));
View Full Code Here

        String ident = content.attribute("ident").getValue();
        Element render_fib = content.element("render_fib");
        content.element("render_fib").element("flow_label");
        fibresponse.setType(FIBResponse.TYPE_BLANK);
        fibresponse.setIdent(ident);
        fibresponse.setSizeFromColumns(render_fib.attribute("columns"));
        fibresponse.setMaxLengthFromMaxChar(render_fib.attribute("maxchars"));
        List el_varequals = el_resprocessing.selectNodes(".//varequal[@respident='" + ident + "']");
        List processedSolutions = new ArrayList(); // list of already process strings
        if (el_varequals != null) {
          String correctBlank = "";
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.