Package org.olat.ims.qti.export.helper

Examples of org.olat.ims.qti.export.helper.QTIItemObject


 
  private Map getQTIItemConfigs(List qtiItemObjectList){
    Map itConfigs = new HashMap();
   
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject item = (QTIItemObject) iter.next();
      if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)){
        if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null){
          QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)){
        if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null){
          QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ );
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)){
        if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null){
          QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)){
        if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null){
          QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
          itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)){
        if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null){
          QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
          itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        }
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.A)){
        QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
        itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.R)){
        QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.C)){
        QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ );
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.B)){
        QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
        itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
      }
      else{
        throw new OLATRuntimeException(null,"Can not resolve QTIItem type", null);
View Full Code Here


    StringBuilder hR1 = new StringBuilder();
    StringBuilder hR2 = new StringBuilder();
   
    int i = 1;
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject item = (QTIItemObject) iter.next();
     
      if(displayItem(qeif.getExportItemConfig(item))){
        hR1.append(emb);
        hR1.append(escape(item.getItemTitle()));
        hR1.append(emb);
       
        if (qeif.getExportItemConfig(item).hasResponseCols()){
          List responseColumnHeaders = item.getResponseColumnHeaders();
          for (Iterator iterator = responseColumnHeaders.iterator(); iterator.hasNext();) {
            // HeaderRow1
            hR1.append(sep);
            // HeaderRow2
            String columnHeader = (String) iterator.next();
View Full Code Here

    sb.append(car+car);
    sb.append(legend);
    sb.append(car+car);
    int y = 1;
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject element = (QTIItemObject) iter.next();
     
      sb.append(element.getItemIdent());
      sb.append(sep);
      sb.append(emb);
      sb.append(escape(element.getItemTitle()));
      sb.append(emb);
      sb.append(car);
     
      sb.append(sep+sep);
      sb.append("minValue");sb.append(sep);
      sb.append(element.getItemMinValue());
      sb.append(car);
     
      sb.append(sep+sep);
      sb.append("maxValue");sb.append(sep);
      sb.append(element.getItemMaxValue());
      sb.append(car);
     
      sb.append(sep+sep);
      sb.append("cutValue");sb.append(sep);
      sb.append(element.getItemCutValue());
      sb.append(car);
     
      List responseLabelMaterials = element.getResponseLabelMaterials();
     
      for (int i = 0; i < element.getResponseIdentifier().size() ; i++) {
        sb.append(sep+sep);
        sb.append(y);
        sb.append("_");
        sb.append(element.getItemType());
        sb.append(i+1);
        sb.append(sep);
        sb.append(element.getResponseIdentifier().get(i));
        sb.append(sep);
       
        if(responseLabelMaterials != null){
          String s = (String)responseLabelMaterials.get(i);
          if(tagless){
View Full Code Here

 
  private void setDefaultQTIItemConfigs(){
    Map itConfigs = new HashMap();
   
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject item = (QTIItemObject) iter.next();
      if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)){
        if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null){
          QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)){
        if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null){
          QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ );
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)){
        if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null){
          QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)){
        if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null){
          QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
          itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)){
        if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null){
          QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
          itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        }
      }
      //if cannot find the type via the ItemParser, look for the QTIItemObject type
      else if (item.getItemType().equals(QTIItemObject.TYPE.A)){
        QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
        itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
     
      else if (item.getItemType().equals(QTIItemObject.TYPE.R)){
        QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.C)){
        QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.B)){
        QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
        itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
      }
      else{
        throw new OLATRuntimeException(null,"Can not resolve QTIItem type='" + item.getItemType() + "'", null);
      }
    }
    mapWithExportItemConfigs =  itConfigs;
  }
View Full Code Here

      List assessIDresults = stripNextAssessID(qtiResults);
   
      qef.openResultSet(new QTIExportSet((QTIResult)assessIDresults.get(0)));
     
      for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
        QTIItemObject element = (QTIItemObject) iter.next();
       
        QTIResult qtir;
        qtir = element.extractQTIResult(assessIDresults);
        qef.visit(qeif.getExportItem(qtir,element));

      }
      qef.closeResultSet();
    }
View Full Code Here

    StringBuilder hR1 = new StringBuilder();
    StringBuilder hR2 = new StringBuilder();

    int i = 1;
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject item = (QTIItemObject) iter.next();
      if(displayItem(qeif.getExportItemConfig(item))){
        hR1.append(emb);
        hR1.append(escape(item.getItemTitle()));
        hR1.append(emb);
   
        if (qeif.getExportItemConfig(item).hasResponseCols()){
          List responseColumnHeaders = item.getResponseColumnHeaders();
          for (Iterator iterator = responseColumnHeaders.iterator(); iterator.hasNext();) {
            // HeaderRow1
            hR1.append(sep);
              // HeaderRow2
              String columnHeader = (String) iterator.next();
            hR2.append(i);
            hR2.append("_");
            hR2.append(columnHeader);
            hR2.append(sep);
          }
        }
       
        if(qeif.getExportItemConfig(item).hasPositionsOfResponsesCol()){
          if(item.hasPositionsOfResponses()){
            // HeaderRow1
            hR1.append(sep);
              // HeaderRow2
              hR2.append(i);
              hR2.append("_");
View Full Code Here

    sb.append(car+car);
    sb.append(legend);
    sb.append(car+car);
    int y = 1;
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject element = (QTIItemObject) iter.next();
     
      sb.append(element.getItemIdent());
      sb.append(sep);
      sb.append(emb);
      sb.append(escape(element.getItemTitle()));
      sb.append(emb);
      sb.append(car);
     
      List responseLabelMaterials = element.getResponseLabelMaterials();
     
      for (int i = 0; i < element.getResponseIdentifier().size() ; i++) {
        sb.append(sep+sep);
        sb.append(y);
        sb.append("_");
        sb.append(element.getItemType());
        sb.append(i+1);
        sb.append(sep);
        sb.append(element.getResponseIdentifier().get(i));
        sb.append(sep);
       
        if(responseLabelMaterials != null){
          String s = (String)responseLabelMaterials.get(i);
          if(tagless){
View Full Code Here

 
  private void setDefaultQTIItemConfigs(){
    Map itConfigs = new HashMap();
   
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject item = (QTIItemObject) iter.next();
      if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)){
        if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null){
          QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)){
        if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null){
          QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ );
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)){
        if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null){
          QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)){
        if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null){
          QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
          itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)){
        if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null){
          QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
          itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        }
      }     
      //if cannot find the type via the ItemParser, look for the QTIItemObject type
      else if (item.getItemType().equals(QTIItemObject.TYPE.A)){
        QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
        itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
     
      else if (item.getItemType().equals(QTIItemObject.TYPE.R)){
        QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.C)){
        QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.B)){
        QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
        itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
      }
      else{
        throw new OLATRuntimeException(null,"Can not resolve QTIItem type='" + item.getItemType() + "'", null);
      }
    }
    mapWithExportItemConfigs =  itConfigs;
  }
View Full Code Here

 
  private Map getQTIItemConfigs(){
    Map itConfigs = new HashMap();
   
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject item = (QTIItemObject) iter.next();
      if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_SCQ)){
        if (itConfigs.get(QTIExportSCQItemFormatConfig.class) == null){
          QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_MCQ)){
        if (itConfigs.get(QTIExportMCQItemFormatConfig.class) == null){
          QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ );
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_KPRIM)){
        if (itConfigs.get(QTIExportKPRIMItemFormatConfig.class) == null){
          QTIExportKPRIMItemFormatConfig confKPRIM = new QTIExportKPRIMItemFormatConfig(true, false, false, false);
          itConfigs.put(QTIExportKPRIMItemFormatConfig.class, confKPRIM);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_ESSAY)){
        if (itConfigs.get(QTIExportEssayItemFormatConfig.class) == null){
          QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
          itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
        }
      }
      else if (item.getItemIdent().startsWith(ItemParser.ITEM_PREFIX_FIB)){
        if (itConfigs.get(QTIExportFIBItemFormatConfig.class) == null){
          QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
          itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
        }
      }
      //if cannot find the type via the ItemParser, look for the QTIItemObject type
      else if (item.getItemType().equals(QTIItemObject.TYPE.A)){
        QTIExportEssayItemFormatConfig confEssay = new QTIExportEssayItemFormatConfig(true, false);
        itConfigs.put(QTIExportEssayItemFormatConfig.class, confEssay);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.R)){
        QTIExportSCQItemFormatConfig confSCQ = new QTIExportSCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportSCQItemFormatConfig.class, confSCQ);
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.C)){
        QTIExportMCQItemFormatConfig confMCQ = new QTIExportMCQItemFormatConfig(true, false, false, false);
        itConfigs.put(QTIExportMCQItemFormatConfig.class, confMCQ );
      }
      else if (item.getItemType().equals(QTIItemObject.TYPE.B)){
        QTIExportFIBItemFormatConfig confFIB = new QTIExportFIBItemFormatConfig(true, false, false);
        itConfigs.put(QTIExportFIBItemFormatConfig.class, confFIB);
      }
      else{
        throw new OLATRuntimeException(null,"Can not resolve QTIItem type", null);
View Full Code Here

    StringBuilder hR1 = new StringBuilder();
    StringBuilder hR2 = new StringBuilder();
   
    int i = 1;
    for (Iterator iter = qtiItemObjectList.iterator(); iter.hasNext();) {
      QTIItemObject item = (QTIItemObject) iter.next();
     
      if(displayItem(qeif.getExportItemConfig(item))){
        hR1.append(emb);
        hR1.append(escape(item.getItemTitle()));
        hR1.append(emb);
       
        if (qeif.getExportItemConfig(item).hasResponseCols()){
          List responseColumnHeaders = item.getResponseColumnHeaders();
          for (Iterator iterator = responseColumnHeaders.iterator(); iterator.hasNext();) {
            // HeaderRow1
            hR1.append(sep);           
            // HeaderRow2
            String columnHeader = (String) iterator.next();
View Full Code Here

TOP

Related Classes of org.olat.ims.qti.export.helper.QTIItemObject

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.