Examples of Info


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

   * @param translator
   */
  public IQStatus(Translator translator) {
    this.translator = translator;
    this.formatter = Formatter.getInstance(translator.getLocale());
    info = new Info();
  }
View Full Code Here

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

   * @param renderer
   * @return rendered form
   */
  public StringOutput buildForm(IQComponent comp, Translator translator, Renderer renderer, URLBuilder ubu) {
    StringOutput sb = new StringOutput();
    Info info = comp.getAssessmentInstance().getNavigator().getInfo();
    AssessmentInstance ai = comp.getAssessmentInstance();
    int status = info.getStatus();
    int message = info.getMessage();
    boolean renderItems = info.isRenderItems();
    AssessmentContext act = ai.getAssessmentContext();

    // first treat messages and errors
    if (info.containsMessage()) {
      switch (message) {
        case QTIConstants.MESSAGE_ITEM_SUBMITTED :         
          //item hints?
          if (info.isHint()) {
            Hint el_hint = info.getCurrentOutput().getHint();
            if (el_hint.getFeedbackstyle() == Hint.FEEDBACKSTYLE_INCREMENTAL) {
              // increase the hint level so we know which hint to display
              ItemContext itc = act.getCurrentSectionContext().getCurrentItemContext();
              int nLevel = itc.getHintLevel() + 1;
              int numofhints = el_hint.getChildCount();
              if (nLevel > numofhints) nLevel = numofhints;
              itc.setHintLevel(nLevel);
              //<!ELEMENT hint (qticomment? , hintmaterial+)>
             
              displayFeedback(sb, (GenericQTIElement)el_hint.getChildAt(nLevel-1), ai, translator.getLocale());
            } else {
              displayFeedback(sb, el_hint, ai, translator.getLocale());
            }
          }
          //item solution?
          if (info.isSolution()) {
            Solution el_solution = info.getCurrentOutput().getSolution();
            displayFeedback(sb, el_solution, ai, translator.getLocale());
          }
          // item fb?
          if (info.isFeedback()) {
            if (info.getCurrentOutput().hasItem_Responses()) {
              int fbcount = info.getCurrentOutput().getFeedbackCount();
              int i=0;
              while (i < fbcount) {
                Element el_anschosen = info.getCurrentOutput().getItemAnswerChosen(i);
                if (el_anschosen != null) {
                  sb.append("<br /><br /><i>");
                  displayFeedback(sb, new Material(el_anschosen), ai, translator.getLocale());
                  sb.append("</i>");
                }
                Element el_resp= info.getCurrentOutput().getItemFeedback(i);
                displayFeedback(sb, new ItemFeedback(el_resp), ai, translator.getLocale());
                i++;
              }
            }
          }
          if(!comp.getMenuDisplayConf().isEnabledMenu() && comp.getMenuDisplayConf().isItemPageSequence() && !info.isRenderItems()) {
            //if item was submitted and sequence is pageSequence and menu not enabled and isRenderItems returns false show section info
            SectionContext sc = ai.getAssessmentContext().getCurrentSectionContext();
            displaySectionInfo(sb, sc, ai, comp, ubu, translator);
          }
          break;

        case QTIConstants.MESSAGE_SECTION_SUBMITTED :
          //  provide section feedback if enabled and existing
          //SectionContext sc = act.getCurrentSectionContext();         
          if (info.isFeedback()) {
            Output outp = info.getCurrentOutput();
            GenericQTIElement el_feedback = outp.getEl_response();
            if (el_feedback != null) displayFeedback(sb, el_feedback, ai, translator.getLocale());
          }
          if(!comp.getMenuDisplayConf().isEnabledMenu() && !comp.getMenuDisplayConf().isItemPageSequence()) {
            SectionContext sc = ai.getAssessmentContext().getCurrentSectionContext();
            displaySectionInfo(sb, sc, ai, comp, ubu, translator);
          }
          break;

        case QTIConstants.MESSAGE_ASSESSMENT_SUBMITTED :
          //  provide assessment feedback if enabled and existing
          if (info.isFeedback()) {
            Output outp = info.getCurrentOutput();
            GenericQTIElement el_feedback = outp.getEl_response();
            if (el_feedback != null) displayFeedback(sb, el_feedback, ai, translator.getLocale());
          }
          break;

        case QTIConstants.MESSAGE_SECTION_INFODEMANDED : // for menu item navigator
          // provide some stats maybe
          SectionContext sc = ai.getAssessmentContext().getCurrentSectionContext();
          displaySectionInfo(sb, sc, ai, comp, ubu, translator);
          break;

        case QTIConstants.MESSAGE_ASSESSMENT_INFODEMANDED : // at the start of the test
          displayAssessmentInfo(sb, act, ai, comp, ubu, translator);
          break;
      }
    }

    if (renderItems) {
      boolean displayForm = true;
      // First check wether we need to render a form.
      // No form is needed if the current item has a matapplet object to be displayed.
      // Matapplets will send their response back directly.
      SectionContext sct = act.getCurrentSectionContext();
      ItemContext itc = null;
      if (sct != null && !ai.isSectionPage()) {
        itc = sct.getCurrentItemContext();
        if (itc != null) {
          Item item = itc.getQtiItem();
          if (item.getQTIIdent().startsWith("QTIEDIT:FLA:")) displayForm = false;
        }
      }
     
      sb.append("<form action=\"");
      ubu.buildURI(sb, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "sitse" });
     
      sb.append("\" id=\"ofo_iq_item\" method=\"post\">");

      if (!ai.isSectionPage()) {
        if (itc != null) displayItem(sb, renderer, ubu, itc, ai);
      } else {
        if (sct != null && sct.getItemContextCount() != 0)
          displayItems(sb, renderer, ubu, sct, ai);
      }
     
      sb.append("<div class=\"b_button_group\"><input class=\"b_button\" type=\"submit\" name=\"olat_fosm\" value=\"");
      if (ai.isSectionPage())
        sb.append(StringEscapeUtils.escapeHtml(translator.translate("submitMultiAnswers")));
      else
        sb.append(StringEscapeUtils.escapeHtml(translator.translate("submitSingleAnswer")));
      sb.append("\"");
      if (!displayForm) sb.append(" style=\"display: none;\"");
      sb.append(" /></div></form>");
    }

    if (status == QTIConstants.ASSESSMENT_FINISHED) {
      if (info.isFeedback()) {
        Output outp = info.getCurrentOutput();
        GenericQTIElement el_feedback = outp.getEl_response();
        if (el_feedback != null) displayFeedback(sb, el_feedback, ai, null);
      }
    }
    return sb;
View Full Code Here

Examples of org.torquebox.core.datasource.DataSourceInfoList.Info

            binderBuilder.setInitialMode( Mode.ACTIVE );
            binderBuilder.install();

            String adapterName = (String) dbMeta.getConfiguration().get( "adapter" );
            Info dsInfo = new DataSourceInfoList.Info( dbMeta.getConfigurationName(), jndiName, adapterName, dataSourceServiceName, adapter );

            DataSourceXAVerifierService verifierService = new DataSourceXAVerifierService( dsInfo, phaseContext.getServiceRegistry(), jndiName );
            ServiceName verifierServiceName = dataSourceServiceName.append( "xa-verifier" );
            phaseContext.getServiceTarget().addService( verifierServiceName, verifierService )
                    .addDependency( DependencyType.OPTIONAL, dataSourceServiceName, DataSource.class, verifierService.getDataSourceInjector() )
View Full Code Here

Examples of org.vorbis.jcraft.jorbis.Info

    private void init_jorbis() {
        oggSyncState_ = new SyncState();
        oggStreamState_ = new StreamState();
        oggPage_ = new Page();
        oggPacket_ = new Packet();
        vorbisInfo = new Info();
        vorbisComment = new Comment();
        vorbisDspState = new DspState();
        vorbisBlock = new Block(vorbisDspState);
        buffer = null;
        bytes = 0;
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwatcher.Info

    * @throws Exception Can be of any type
    */
   private void pollingExample(Preferences prefs) throws Exception {
      log.info("Start polling test");
     
      I_Info info = new Info(prefs);
      DbWriter processor = new DbWriter(info);
     
      long sleep = info.getLong("example.sleep", 0L);
      if (sleep > 0) {
         log.info("Sleeping for '" + sleep / 1000 + " seconds");
         Thread.sleep(sleep);
      }
      else {
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwatcher.Info

         LogManager.getLogManager().readConfiguration();

         Preferences prefs = loadArgs(args);
         if (prefs == null)
            return;
         Info info = new Info(prefs);
         StressGenerator example = new StressGenerator(info);
         example.run();
     
      }
      catch (Throwable e) {
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwatcher.Info

    * @throws Exception Can be of any type
    */
   private void pollingExample(Preferences prefs) throws Exception {
      log.info("Start polling test");
     
      I_Info info = new Info(prefs);
      DbWatcher processor = new DbWatcher(info);
      processor.startAlertProducers();

      boolean interactive = info.getBoolean("interactive", true);
      if (interactive) {
         // Manually trigger db checking ...
         BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
         while (true) {
            System.out.print("Hit 'q' to exit, 't' to trigger an event > ");
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwatcher.Info

         LogManager.getLogManager().readConfiguration();

         Preferences prefs = loadArgs(args);
         if (prefs == null)
            return;
         Info info = new Info(prefs);
         DbWatcherTester example = new DbWatcherTester(info);
         example.run();
     
      }
      catch (Throwable e) {
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwatcher.Info

      super.tearDown();
   }

   public void testRemoveEntry() {
      I_Info[] infos = {
                         new Info("id"),
                         new PropertiesInfo(new Properties()),
                         new ClientPropertiesInfo(new HashMap()),
                         /* new DbInfo(new HashMap()), */
                         new OwnGlobalInfo()
                       };
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwatcher.Info

     * Default ctor.
     */
    public TestInfoObjects() {
       super();
       Preferences prefs = Preferences.userRoot();
       this.info = new Info(prefs);
       XMLUnit.setIgnoreWhitespace(true);
    }
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.