Package org.olat.ims.qti.container

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


    }
    else // ok, eval the whole assessment here each time (so after a submitted item, one sees overall progress)
      //getAssessmentContext().eval();
      getInfo().setMessage(QTIConstants.MESSAGE_ITEM_SUBMITTED);
      getInfo().setRenderItems(false);
      ItemContext itc = getAssessmentContext().getCurrentSectionContext().getCurrentItemContext();
      // check on section feedbacks
      Output outp = itc.getOutput();
      if (outp != null) getInfo().setCurrentOutput(outp);
     
     
      // check on item feedback
      if (itc.isFeedback()) { // feedback allowed
        getInfo().setFeedback(itc.getOutput().hasItem_Responses());
      }
      if (itc.isHints()) { // hints allowed
        if (itc.getOutput().getHint() != null) { // feedback existing on item
          getInfo().setHint(true);
        }
      }
      if (itc.isSolutions()) { // solution allowed
        if (itc.getOutput().getSolution() != null) { // solution existing on item
          getInfo().setSolution(true);
        }
      }
     
    }
View Full Code Here


  public void goToItem(int sectionPos, int itemPos) {
    if (getInfo().getStatus() != QTIConstants.ASSESSMENT_RUNNING) throw new RuntimeException("assessment is NOT running yet or anymore");
    clearInfo();
    AssessmentContext ac = getAssessmentContext();
    SectionContext sc = ac.getSectionContext(sectionPos);
    ItemContext target = sc.getItemContext(itemPos);
    // check if targeted item is still open
   
    if (!ac.isOpen()) {
      getInfo().setError(QTIConstants.ERROR_ASSESSMENT_OUTOFTIME);
      getInfo().setRenderItems(false)
    } else if (!sc.isOpen()) {
      getInfo().setError(QTIConstants.ERROR_SECTION_OUTOFTIME);
      getInfo().setRenderItems(false)
    } else if (!target.isOpen()) {
      getInfo().setError(QTIConstants.ERROR_ITEM_OUTOFTIME);
      getInfo().setRenderItems(false)
    else {
      getInfo().setStatus(QTIConstants.ASSESSMENT_RUNNING);
      getInfo().setRenderItems(true);
View Full Code Here

      } else if (st == QTIConstants.ERROR_SUBMITTEDITEM_OUTOFTIME) {
        getInfo().setError(st);
        getInfo().setRenderItems(true); // still continue to next item
      }
    } else { // ok, display feedback
      ItemContext itc = getAssessmentContext().getCurrentSectionContext().getCurrentItemContext();
      Output outp = itc.getOutput();
      if (outp != null) getInfo().setCurrentOutput(outp);
      // check on item feedback
      if (itc.isFeedback()) { // feedback allowed
        getInfo().setFeedback(itc.getOutput().hasItem_Responses());
      }
      getInfo().setMessage(QTIConstants.MESSAGE_ITEM_SUBMITTED);
      getInfo().setRenderItems(true);
    }
View Full Code Here

TOP

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

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.