Package org.olat.ims.qti.process

Examples of org.olat.ims.qti.process.Resolver


  /**
   *
   *
   */
  public List getQTIItemObjectList() {
    Resolver resolver = new ImsRepositoryResolver(repositoryEntryKey);
    Document doc = resolver.getQTIDocument();
    Element root = doc.getRootElement();
    List items = root.selectNodes("//item");
   
    ArrayList itemList = new ArrayList();

View Full Code Here


    iqm = IQManager.getInstance();

    myContent = new VelocityContainer("olatmodiqrun", VELOCITY_ROOT + "/qti.html", translator, this);
   
    // Check if fibautocompl.js and fibautocompl.css exists for enhance FIB autocomplete feature
     Resolver autcompResolver = null;
    if (resolver == null){
      RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftkey, true);
       autcompResolver = new ImsRepositoryResolver(re.getKey());
    } else {
      autcompResolver = this.resolver;
    }
     
    if (autcompResolver != null && autcompResolver.hasAutocompleteFiles()) {
      // Add Autocomplte JS and CSS file to header
      StringBuilder sb = new StringBuilder();
      // must be like <script type="text/javascript" src="/olat/secstatic/qti/74579818809617/_unzipped_/fibautocompl.js"></script>
      sb.append("<script type=\"text/javascript\" src=\"").append(autcompResolver.getStaticsBaseURI()).append("/").append(ImsRepositoryResolver.QTI_FIB_AUTOCOMPLETE_JS_FILE).append("\"></script>\n");
      // must be like <link rel="StyleSheet" href="/olat/secstatic/qti/74579818809617/_unzipped_/fibautocompl.css" type="text/css" media="screen, print">
      sb.append("<link rel=\"StyleSheet\" href=\"").append(autcompResolver.getStaticsBaseURI()).append("/").append(ImsRepositoryResolver.QTI_FIB_AUTOCOMPLETE_CSS_FILE).append("\" type=\"text/css\" media=\"screen\" >\n");
      JSAndCSSComponent autoCompleteJsCss = new JSAndCSSComponent("auto_complete_js_css", this.getClass(), null, null, true, sb.toString());
      myContent.put("autoCompleteJsCss", autoCompleteJsCss);
    }
    closeButton = LinkFactory.createButton("close", myContent, this);
   
View Full Code Here

    sb.append(buffer);
  }
 
  private void displayItem(StringOutput sb, Renderer renderer, URLBuilder ubu, ItemContext itc, AssessmentInstance ai) {
    StringBuilder buffer = new StringBuilder(1000);
    Resolver resolver = ai.getResolver();
    RenderInstructions ri = new RenderInstructions();
    ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
    ri.put(RenderInstructions.KEY_LOCALE, renderer.getTranslator().getLocale());
    StringOutput soCommandURI = new StringOutput(50);
    ubu.buildURI(soCommandURI, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "sflash" });
    ri.put(RenderInstructions.KEY_APPLET_SUBMIT_URI, soCommandURI.toString());
    if (itc.getItemInput() != null)
View Full Code Here

    if (ai.isDisplayTitles())
      sb.append("<h3>" + sc.getTitle() + "</h3>");
    Objectives objectives = sc.getObjectives();
    if (objectives != null) {
      StringBuilder sbTmp = new StringBuilder();
      Resolver resolver = ai.getResolver();
      RenderInstructions ri = new RenderInstructions();
      ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
      objectives.render(sbTmp, ri);
      sb.append(sbTmp);
    }
    // if Menu not visible, or if visible but not selectable, and itemPage sequence (one question per page) 
    // show button to navigate to the first question of the current section     
View Full Code Here

  private void displayAssessmentInfo(StringOutput sb, AssessmentContext ac, AssessmentInstance ai, IQComponent comp, URLBuilder ubu, Translator translator) {
    Objectives objectives = ac.getObjectives();
    if (objectives != null) {
      StringBuilder sbTmp = new StringBuilder();
      Resolver resolver = ai.getResolver();
      RenderInstructions ri = new RenderInstructions();
      ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
      objectives.render(sbTmp, ri);
      sb.append(sbTmp);
    }
    //if Menu not visible, or if visible but not selectable show button to navigate to the first section panel     
    IQMenuDisplayConf menuDisplayConfig = comp.getMenuDisplayConf();
View Full Code Here

    }       
  }

  private void displayFeedback(StringOutput sb, GenericQTIElement feedback, AssessmentInstance ai, Locale locale) {
    StringBuilder sbTmp = new StringBuilder();
    Resolver resolver = ai.getResolver();
    RenderInstructions ri = new RenderInstructions();
    ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
    ri.put(RenderInstructions.KEY_LOCALE, locale);
    feedback.render(sbTmp, ri);
    sb.append(sbTmp);
  }
View Full Code Here

 
  /**
   * @see org.olat.repository.handlers.RepositoryHandler#getLaunchController(org.olat.core.id.OLATResourceable java.lang.String, org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public MainLayoutController getLaunchController(OLATResourceable res, String initialViewIdentifier, UserRequest ureq, WindowControl wControl) {
    Resolver resolver = new ImsRepositoryResolver(res);
    IQSecurityCallback secCallback = new IQPreviewSecurityCallback();
    MainLayoutController runController = res.getResourceableTypeName().equals(SurveyFileResource.TYPE_NAME) ?
      IQManager.getInstance().createIQDisplayController(res, resolver, AssessmentInstance.QMD_ENTRY_TYPE_SURVEY, secCallback, ureq, wControl)
      IQManager.getInstance().createIQDisplayController(res, resolver, AssessmentInstance.QMD_ENTRY_TYPE_SELF, secCallback, ureq, wControl);
      // use on column layout
View Full Code Here

   * @param ureq
   * @param wControl
   * @return Controller
   */
  public Controller getLaunchController(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    Resolver resolver = new ImsRepositoryResolver(res);
    IQSecurityCallback secCallback = new IQPreviewSecurityCallback();
    Controller runController =
      IQManager.getInstance().createIQDisplayController(res, resolver, AssessmentInstance.QMD_ENTRY_TYPE_SELF, secCallback, ureq, wControl);
    // use on column layout
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, null, null, runController.getInitialComponent(), null);
View Full Code Here

   * @param ureq
   * @param wControl
   * @return Controller
   */
  public Controller getLaunchController(OLATResourceable res, UserRequest ureq, WindowControl wControl) {
    Resolver resolver = new ImsRepositoryResolver(res);
    IQSecurityCallback secCallback = new IQPreviewSecurityCallback();
    Controller runController = IQManager.getInstance().createIQDisplayController(res, resolver, AssessmentInstance.QMD_ENTRY_TYPE_SURVEY, secCallback, ureq, wControl);
    // use on column layout
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, null, null, runController.getInitialComponent(), null);
    layoutCtr.addDisposableChildController(runController); // dispose content on layout dispose
View Full Code Here

  private static void addStaticsPath(Element el_in, AssessmentInstance ai) {
    Element el_staticspath = (Element) el_in.selectSingleNode(STATICS_PATH);
    if (el_staticspath == null) {
      DocumentFactory df = DocumentFactory.getInstance();
      el_staticspath = df.createElement(STATICS_PATH);
      Resolver resolver = ai.getResolver();
      el_staticspath.addAttribute("ident", resolver.getStaticsBaseURI());
      el_in.add(el_staticspath);
    }
  }
View Full Code Here

TOP

Related Classes of org.olat.ims.qti.process.Resolver

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.