Examples of Question


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

    }

    // Update item
    item.setTitle(newTitle);
    item.setObjectives(newObjectives); // trust authors, don't to XSS filtering
    Question q = item.getQuestion();
    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 {
        item.setDuration(null);
      }
View Full Code Here

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

    RichTextConfiguration richTextConfig = desc.getEditorConfiguration();
    // set upload dir to the media dir
    richTextConfig.setFileBrowserUploadRelPath("media");

    // Layout/Alignment
    Question q = item.getQuestion();
    // alignment of KPRIM is only horizontal
    if (q instanceof ChoiceQuestion && item.getQuestion().getType() != Question.TYPE_KPRIM) {
      String[] layoutKeys = new String[] { "h", "v" };
      String[] layoutValues = new String[] { translate("form.imd.layout.horizontal"), translate("form.imd.layout.vertical") };
      //layout = uifactory.addDropdownSingleselect("form.imd.layout", formLayout, layoutKeys, layoutValues, null);
View Full Code Here

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

      //
      String oldObjectives = (String) qtiState.get("OBJECTIVES");
      String newObjectives = item.getObjectives();
      String objectChange = null;
      //
      Question question = item.getQuestion();
      boolean isFIB = question.getType() == Question.TYPE_FIB;
      boolean isESSAY = question.getType() == Question.TYPE_ESSAY;
      String oldHinttext = (String) qtiState.get("QUESTION.HINTTEXT");
      String newHinttext = question.getHintText();
      String hinttextChange = null;
      //
      String oldQuestion = (String) qtiState.get("QUESTION.MATERIAL.ASTEXT");
      String newQuestion = question.getQuestion().renderAsText();
      String questionChange = null;
      // feedback
      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;
      String oldFeedback = null;
      String newFeedback = null;
      String responsesChanges = "";
      List responses = question.getResponses();
      int i = 0;
      boolean nothingToDo = false;
      for (Iterator iter = responses.iterator(); iter.hasNext();) {
        nothingToDo = false;
        Response resp = (Response) iter.next();
View Full Code Here

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

   
    // FEEDBACKS
    List feedbacksXML = element.elements("itemfeedback");
    List feedbacks = new ArrayList();
    item.setItemfeedbacks(feedbacks);
    Question question = item.getQuestion();
    for (Iterator i = feedbacksXML.iterator(); i.hasNext();) {
      Element el_feedback = (Element)i.next();
      if (el_feedback.element("solution") != null) { // fetch solution
        Element el_solution = el_feedback.element("solution");
        question.setSolutionText(getMaterialAsString(el_solution));
      } else if (el_feedback.element("hint") != null) { // fetch hint
        Element el_hint = el_feedback.element("hint");
        question.setHintText(getMaterialAsString(el_hint));
      } else {
        QTIObject tmpObj = (QTIObject) parserManager.parse(el_feedback);
        if (tmpObj != null) feedbacks.add(tmpObj);
      }
    }
View Full Code Here

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

        // Item qtiItem =
        // (Item)xstream.fromXML(xstream.toXML(selectedNode.getUnderlyingQTIObject()));
        Item toClone = (Item) selectedNode.getUnderlyingQTIObject();
        Item qtiItem = (Item) XStreamHelper.xstreamClone(toClone);
        // copy flow label class too, olat-2791
        Question orgQuestion = toClone.getQuestion();
        if (orgQuestion instanceof ChoiceQuestion) {
          String flowLabelClass = ((ChoiceQuestion)orgQuestion).getFlowLabelClass();
          Question copyQuestion =  qtiItem.getQuestion();
          if (copyQuestion instanceof ChoiceQuestion) {
            ((ChoiceQuestion)copyQuestion).setFlowLabelClass(flowLabelClass);
          } else {
            throw new AssertException("Could not copy flow-label-class, wrong type of copy question , must be 'ChoiceQuestion' but is " +copyQuestion);
          }
View Full Code Here

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

          } else if (node instanceof ItemNode) {
            ItemNode in = (ItemNode) node;
            SectionNode sn = (SectionNode) in.getParent();
            String parentSectkey = ((Section) ((SectionNode) in.getParent()).getUnderlyingQTIObject()).getIdent();
            Item item = (Item) in.getUnderlyingQTIObject();
            Question question = item.getQuestion();
            String itemKey = item.getIdent();
            String prefixKey = "null/" + itemKey;
            String questionIdent = question != null ? question.getQuestion().getId() : "null";
            String key = prefixKey + "/" + questionIdent + "/null";
            StringBuilder changeMessage = new StringBuilder();
            boolean hasChanges = false;

            if (!itemMap.containsKey(itemKey)) {
              Memento questMem = null;
              Memento respMem = null;
              if (history.containsKey(key)) {
                // question changed!
                questMem = (Memento) history.get(key);
                hasChanges = true;
              }
              // if(!hasChanges){
              // check if a response changed
              // new prefix for responses
              prefixKey += "/null/";
              // list contains org.olat.ims.qti.editor.beecom.objects.Response
              List responses = question != null ? question.getResponses() : null;
              if (responses != null && responses.size() > 0) {
                // check for changes in each response
                for (Iterator iter = responses.iterator(); iter.hasNext();) {
                  Response resp = (Response) iter.next();
                  if (history.containsKey(prefixKey + resp.getIdent())) {
View Full Code Here

Examples of org.openblend.fejstbuk.domain.Question

            throw new IllegalArgumentException(e);
        }
    }

    public Question addQuestion(User owner, String question) {
        Question q = new Question();
        q.setQuestion(question);
        q.setUser(owner);
        q.setTimestamp(new Date());
        em.persist(q);
        addLinked(owner, q);
        return q;
    }
View Full Code Here

Examples of org.opendope.questions.Question

    db.setStoreItemID(storeItemID);
    xp.setDataBinding(db);
    xPathsPart.getJaxbElement().getXpath().add(xp);
   
    // question
    Question q = new Question();
    q.setId(key);
    q.setText(key + "?");
    Response r = new Response();
    r.setFree( new Response.Free() );
    questionsPart.getJaxbElement().getQuestions().getQuestion().add(q);
  }
View Full Code Here

Examples of org.osforce.connect.entity.knowledge.Question

      model.put("album", album);
    } else if(StringUtils.equals(Photo.NAME, activity.getEntity())) {
      Photo photo = photoService.getPhoto(activity.getLinkedId());
      model.put("photo", photo);
    } else if(StringUtils.equals(Question.NAME, activity.getEntity())) {
      Question question = questionService.getQuestion(activity.getLinkedId());
      model.put("question", question);
    } else if(StringUtils.equals(Answer.NAME, activity.getEntity())) {
      Answer answer = answerService.getAnswer(activity.getLinkedId());
      model.put("answer", answer);
    } else if(StringUtils.equals(File.NAME, activity.getEntity())) {
View Full Code Here

Examples of org.speakright.core.render.Question

@SuppressWarnings("serial")
public class QuestionFlow extends FlowBase {
  protected Question m_quest;
 
  public QuestionFlow() {
    m_quest = new Question();
  }
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.