Package org.olat.ims.qti.editor.beecom.objects

Examples of org.olat.ims.qti.editor.beecom.objects.Control


    qtiState.put("QUESTION.RESPONSES.ASTEXT", asTexts);
    qtiState.put("QUESTION.RESPONSES.FEEDBACK", feedbacks);
    // feedback
    qtiState.put("FEEDBACK.MASTERY", QTIEditHelper.getFeedbackMasteryText(item));
    qtiState.put("FEEDBACK.FAIL", QTIEditHelper.getFeedbackFailText(item));
    Control control = (Control) QTIEditHelper.getControl(item);
    qtiState.put("FEEDBACK.ENABLED", control.getFeedback() == 1 ? Boolean.TRUE : Boolean.FALSE);
    //
    qnm.setQtiState(qtiState);
    //
    return qnm;
  }
View Full Code Here


      String feedbackChanges = "";
      String oldFeedbackMastery = (String) qtiState.get("FEEDBACK.MASTERY");
      String newFeedbackMastery = QTIEditHelper.getFeedbackMasteryText(item);
      String oldFeedbackFail = (String) qtiState.get("FEEDBACK.FAIL");
      String newFeedbackFail = QTIEditHelper.getFeedbackFailText(item);
      Control control = (Control) QTIEditHelper.getControl(item);
      Boolean oldHasFeedback = (Boolean) qtiState.get("FEEDBACK.ENABLED");
      Boolean newHasFeedback = control != null ? new Boolean(control.getFeedback() == 1) : null;
      //
      List asTexts = (List) qtiState.get("QUESTION.RESPONSES.ASTEXT");
      List feedbacks = (List) qtiState.get("QUESTION.RESPONSES.FEEDBACK");
      String oldResp = null;
      String newResp = null;
View Full Code Here

    if (layout != null) {
      ((ChoiceQuestion) q).setFlowLabelClass(layout.getSelectedKey() == "h" ? ChoiceQuestion.BLOCK : ChoiceQuestion.LIST);
    }
    if (!isSurvey && !isRestrictedEditMode) {
      q.setShuffle(shuffle.getSelected() == 0);
      Control itemControl = (Control) item.getItemcontrols().get(0);
      itemControl.setFeedback(itemControl.getFeedback() == Control.CTRL_UNDEF ? Control.CTRL_NO : itemControl.getFeedback());
      itemControl.setHint(showHints.getSelected() == 0 ? Control.CTRL_YES : Control.CTRL_NO);
      itemControl.setSolution(showSolution.getSelected() == 0 ? Control.CTRL_YES : Control.CTRL_NO);
      q.setHintText(conditionalCommentFilter.filter(hint.getRawValue())); // trust authors, don't to XSS filtering
      q.setSolutionText(conditionalCommentFilter.filter(solution.getRawValue())); // trust authors, don't to XSS filtering
      if (limitTime.getSelectedKey().equals("y")) {
        item.setDuration(new Duration(1000 * timeSec.getIntValue() + 1000 * 60 * timeMin.getIntValue()));
      } else {
View Full Code Here

      } else {
        shuffle.select("n", true);
      }

      // Hints
      Control itemControl = (Control) item.getItemcontrols().get(0);
      showHints = uifactory.addRadiosHorizontal("showHints", "form.imd.solutionhints.show", formLayout, yesnoKeys, yesnoValues);
      showHints.addActionListener(this, FormEvent.ONCHANGE);
     
      hint = uifactory.addRichTextElementForStringData("hint", "form.imd.solutionhints", item.getQuestion().getHintText(), 8, -1, false,
          true, qti.getBaseDir(), null, formLayout, ureq.getUserSession(), getWindowControl());
      // set upload dir to the media dir
      hint.getEditorConfiguration().setFileBrowserUploadRelPath("media");
      if (itemControl.isHint()) {
        showHints.select("y", true);
      } else {
        showHints.select("n", true);
        hint.setVisible(false);
      }

      // Solution
      showSolution = uifactory.addRadiosHorizontal("showSolution", "form.imd.correctsolution.show", formLayout, yesnoKeys, yesnoValues);
      showSolution.addActionListener(this, FormEvent.ONCHANGE);
      solution = uifactory.addRichTextElementForStringData("solution", "form.imd.correctsolution", item.getQuestion().getSolutionText(), 8,
          -1, false, true, qti.getBaseDir(), null, formLayout, ureq.getUserSession(), getWindowControl());
      // set upload dir to the media dir
      hint.getEditorConfiguration().setFileBrowserUploadRelPath("media");
      if (itemControl.isSolution()) {
        showSolution.select("y", true);
      } else {
        showSolution.select("n", true);
        solution.setVisible(false);
      }
View Full Code Here

  public Object parse(Element element) {
    //assert element.getName().equalsIgnoreCase("assessmentcontrol")
    //      || element.getName().equalsIgnoreCase("sectioncontrol")
    //      || element.getName().equalsIgnoreCase("itemcontrol");
         
    Control control = null;
    // attributes
    String feedbackswitch = element.attribute("feedbackswitch").getValue();
    String hintswitch = element.attribute("hintswitch").getValue();
    String solutionswitch = element.attribute("solutionswitch").getValue();
    control = new Control(feedbackswitch, hintswitch, solutionswitch);
    return control;
  }
View Full Code Here

      List sectioncontrols = new ArrayList();
      for(Iterator i= sectioncontrolsXML.iterator();i.hasNext();) {
        sectioncontrols.add(parserManager.parse((Element)i.next()));
      }
      if (sectioncontrols.size() == 0) {
        sectioncontrols.add(new Control());
      }
      section.setSectioncontrols(sectioncontrols);
   
      // SELECTION ORDERING
      SelectionOrdering selectionOrdering = (SelectionOrdering)parserManager.parse(element.element("selection_ordering"));
View Full Code Here

    for(Iterator i= assessmentcontrolsXML.iterator();i.hasNext();) {
      assessmentcontrols.add(parserManager.parse((Element)i.next()));
      assessment.setInheritControls(true);
    }
    if (assessmentcontrols.size() == 0) {
      assessmentcontrols.add(new Control());
      assessment.setInheritControls(false);
    }
    assessment.setAssessmentcontrols(assessmentcontrols);

    // OUTCOMES PROCESSING
View Full Code Here

    List itemcontrols = new ArrayList();
    for (Iterator i = itemcontrolsXML.iterator(); i.hasNext();) {
      itemcontrols.add(parserManager.parse((Element) i.next()));
    }
    if (itemcontrols.size() == 0) {
      itemcontrols.add(new Control());
    }
    item.setItemcontrols(itemcontrols);

    //OBJECTIVES
    Element mattext = (Element)element.selectSingleNode("./objectives/material/mattext");
View Full Code Here

    Item newItem = new Item();
    newItem.setIdent(EDITOR_IDENT+":"+ITEM_TYPE_SC+":"+String.valueOf(CodeHelper.getRAMUniqueID()));
    newItem.setTitle(trans.translate("editor.newquestion"));
    newItem.setLabel("");
    // conrols
    Control control = new Control();
    ArrayList controls = new ArrayList();
    controls.add(control);
    newItem.setItemcontrols(controls);

    // pepare question
View Full Code Here

    newItem.setIdent(EDITOR_IDENT+":"+ITEM_TYPE_MC+":"+String.valueOf(CodeHelper.getRAMUniqueID()));
    newItem.setTitle(trans.translate("editor.newquestion"));
    newItem.setLabel("");

    // conrols
    Control control = new Control();
    ArrayList controls = new ArrayList();
    controls.add(control);
    newItem.setItemcontrols(controls);
   
    // pepare question
View Full Code Here

TOP

Related Classes of org.olat.ims.qti.editor.beecom.objects.Control

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.