Examples of Navigator


Examples of org.olat.ims.qti.navigator.Navigator

      String wfCommand = event.getCommand();
      logAudit(ureq);
      // process workflow
      if (qticomp == null || qticomp.getAssessmentInstance() == null) { throw new RuntimeException("AssessmentInstance not valid."); }
      AssessmentInstance ai = qticomp.getAssessmentInstance();
      Navigator navig = ai.getNavigator();
      if (wfCommand.equals("sitse")) { // submitItemorSection
        navig.submitItems(iqm.getItemsInput(ureq)); //
        if (ai.isClosed()) { // do all the finishing stuff
          event(ureq, source, new Event(QTIConstants.QTI_WF_SUBMIT));
          return;
        }
      } else if (wfCommand.equals("sflash")) { // submit flash answer
        navig.submitItems(iqm.getItemsInput(ureq)); //
        if (ai.isClosed()) { // do all the finishing stuff
          event(ureq, source, new Event(QTIConstants.QTI_WF_SUBMIT));
          return;
        }
      } else if (wfCommand.equals("git")) { // goToItem
        String seid = ureq.getParameter("seid");
        String itid = ureq.getParameter("itid");
        if (seid!=null && seid.length()!=0 && itid!=null && itid.length()!=0) {
          int sectionPos = Integer.parseInt(seid);
          int itemPos = Integer.parseInt(itid);
          navig.goToItem(sectionPos, itemPos);
        }
      } else if (wfCommand.equals("gse")) { // goToSection
        String seid = ureq.getParameter("seid");
        if (seid!=null && seid.length()!=0) {
          int sectionPos = Integer.parseInt(seid);
          navig.goToSection(sectionPos);
        }
      } else if (wfCommand.equals(QTIConstants.QTI_WF_SUBMIT)) { // submit
                                                                  // Assessment
        navig.submitAssessment();
        // Persist data in all cases: test, selftest, surveys except previews
        // In case of survey, data will be anonymized when reading from the
        // table (using the archiver)
        if (!qtistatus.isPreview()) {
          iqm.persistResults(ai, callingResId, callingResDetail, ureq);
          getWindowControl().setInfo(translator.translate("status.results.saved"));
        } else {
          getWindowControl().setInfo(translator.translate("status.results.notsaved"));
        }

        if (!qtistatus.isSurvey()) { // for test and self-assessment, generate
                                      // detailed results
          Document docResReporting = iqm.getResultsReporting(ai, ureq);
          if (!iqsec.isPreview()) {
            FilePersister.createResultsReporting(docResReporting, ureq.getIdentity(), ai.getFormattedType(), ai.getAssessID());
            // Send score and passed to parent controller. Maybe it is necessary
            // to save some data there
            // Do this now and not later, maybe user will never click on
            // 'close'...
            AssessmentContext ac = ai.getAssessmentContext();
            fireEvent(ureq, new IQSubmittedEvent(ac.getScore(), ac.isPassed(), ai.getAssessID()));
          }
         
          Boolean showResultsOnFinishObj = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_RESULT_ON_FINISH);
          boolean showResultsOnFinish = showResultsOnFinishObj==null || showResultsOnFinishObj!=null && showResultsOnFinishObj.booleanValue();
          if (ai.getSummaryType() == AssessmentInstance.SUMMARY_NONE || !showResultsOnFinish) {
            // do not display results reporting
            myContent.contextPut("displayreporting", Boolean.FALSE);
          } else { // display results reporting
            String resReporting = iqm.transformResultsReporting(docResReporting, ureq.getLocale(), ai.getSummaryType() );
            myContent.contextPut("resreporting", resReporting);
            myContent.contextPut("displayreporting", Boolean.TRUE);
          }
          myContent.setPage(VELOCITY_ROOT + "/result.html");
        } else {
          // Send also finished event in case of survey
          fireEvent(ureq, new IQSubmittedEvent());
        }
      } else if (wfCommand.equals(QTIConstants.QTI_WF_CANCEL)) { // cancel
                                                                  // assessment
        navig.cancelAssessment();
      } else if (wfCommand.equals(QTIConstants.QTI_WF_SUSPEND)) { // suspend
                                                                  // assessment
        // just close the controller
        fireEvent(ureq, Event.DONE_EVENT);
        return;
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

       
        // we should expect to fail
        doc.acceptVisitor(new NameValidator(false));
       
        doc = SourceNodeGenaratorVisitor.extractSourceNodes(doc);
        doc.acceptVisitor(new Navigator(true, new SourceFixer()));
        NameInSourceResolverVisitor.resolveElements(doc, env);
       
        // now we pass
        doc.acceptVisitor(new NameValidator(true));       
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

     * @param doc
     * @return
     */
    public static MappingDocument extractSourceNodes(MappingDocument doc) {
        SourceNodeGenaratorVisitor real = new SourceNodeGenaratorVisitor();
        doc.acceptVisitor(new Navigator(true, real));
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

   
    private static void planWalk(MappingDocument doc, MappingVisitor visitor)
        throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
   
        try {
            Navigator walker = new Navigator(true, visitor);
            doc.acceptVisitor(walker);
        } catch (TeiidRuntimeException e) {
            if (e.getCause() instanceof QueryPlannerException) {
                throw (QueryPlannerException)e.getCause();
            }          
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

        }
    }
   
    public static MappingDocument execute(MappingDocument doc) {
        HandleNillableVisitor visitor = new HandleNillableVisitor();
        doc.acceptVisitor(new Navigator(true, visitor));
        return doc;
    }   
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

   
    private static void planWalk(MappingDocument doc, MappingVisitor visitor)
        throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
       
        try {
            Navigator walker = new Navigator(true, visitor);
            doc.acceptVisitor(walker);
        } catch (TeiidRuntimeException e) {
            if (e.getCause() instanceof QueryPlannerException) {
                throw (QueryPlannerException)e.getCause();
            }
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

    public static void validateAndCollectCriteriaElements(MappingDocument doc, XMLPlannerEnvironment planEnv)
        throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
       
        try {
            ValidateMappedCriteriaVisitor visitor = new ValidateMappedCriteriaVisitor(planEnv);
            doc.acceptVisitor(new Navigator(true, visitor));
        } catch (TeiidRuntimeException e) {
            if (e.getCause() instanceof QueryPlannerException) {
                throw (QueryPlannerException)e.getCause();
            }
            else if (e.getCause() instanceof QueryMetadataException) {
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

        throws QueryMetadataException, TeiidComponentException {

        NameInSourceResolverVisitor real = new NameInSourceResolverVisitor(planEnv);
       
        try {
            MappingVisitor visitor = new Navigator(true, real);
            doc.acceptVisitor(visitor);
        } catch (TeiidRuntimeException e) {
            if (e.getCause() instanceof QueryMetadataException) {
                throw (QueryMetadataException)e.getCause();
            }
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

        }
    }
       
    public static MappingDocument markExcludedNodes(MappingDocument doc, HashSet keepNodes) {
        MarkExcludeVisitor visitor = new MarkExcludeVisitor(keepNodes);
        doc.acceptVisitor(new Navigator(true, visitor));
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.Navigator

      
    private static void planWalk(MappingDocument doc, MappingVisitor visitor)
        throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
   
        try {
            Navigator walker = new Navigator(true, visitor) {
               
                /*
                 * Special walking of children so that we can safely remove nodes
                 */
                @Override
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.