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

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


      } else if (cmd.equals("addchoice")) {
        ChoiceQuestion question = (ChoiceQuestion) item.getQuestion();
        List choices = question.getResponses();
        ChoiceResponse newChoice = new ChoiceResponse();
        newChoice.getContent().add(new Mattext(trnsltr.translate("newresponsetext")));
        newChoice.setCorrect(false);
        newChoice.setPoints(-1f); // default value is negative to make sure
        // people understand the meaning of this value
        choices.add(newChoice);
      } else if (cmd.equals("del")) {
View Full Code Here


      }
      // Collect the content of all MatElements in a single text element
      // (text/html) and save it (for Material objects with multiple elements
      // such as images, videos, text, breaks, etc. this can be regarded as
      // "lazy migration" to the new rich text style).
      Mattext textHtml = new Mattext(newHtml);
      // A single text/html element will be left over.
      List<QTIObject> elements = new ArrayList<QTIObject>(1);
      elements.add(textHtml);
      mat.setElements(elements);
      fireEvent(ureq, Event.DONE_EVENT);
View Full Code Here

    newItem.setItemcontrols(controls);

    // pepare question
    ChoiceQuestion question = new ChoiceQuestion();
    question.setLable(trans.translate("editor.newquestion"));
    question.getQuestion().getElements().add(new Mattext(
        trans.translate("editor.newquestiontext")));
    question.setType(Question.TYPE_SC);
    question.setSingleCorrect(true);
    question.setSingleCorrectScore(1);

    ChoiceResponse newChoice = new ChoiceResponse();
    newChoice.setCorrect(true);
    newChoice.getContent().add(new Mattext(trans.translate("editor.newresponsetext")));
    question.getResponses().add(newChoice);

    QTIEditHelper.setFeedbackMastery(newItem, "");
    QTIEditHelper.setFeedbackFail(newItem, "");
View Full Code Here

    newItem.setItemcontrols(controls);
   
    // pepare question
    ChoiceQuestion question = new ChoiceQuestion();
    question.setLable(trans.translate("editor.newquestion"));
    question.getQuestion().getElements().add(new Mattext(trans.translate("editor.newquestiontext")));
    question.setType(Question.TYPE_MC);
    question.setSingleCorrect(true);
    question.setSingleCorrectScore(1);
   
    ChoiceResponse newChoice = new ChoiceResponse();
    newChoice.getContent().add(new Mattext(trans.translate("editor.newresponsetext")));
    newChoice.setCorrect(true);
    newChoice.setPoints(1);
    question.getResponses().add(newChoice);
    newItem.setQuestion(question);
   
View Full Code Here

   
    // prepare question
    float maxValue = 1;
    ChoiceQuestion question = new ChoiceQuestion();
    question.setLable(trans.translate("editor.newquestion"));
    question.getQuestion().getElements().add(new Mattext(trans.translate("editor.newquestiontext")));
    question.setType(Question.TYPE_KPRIM);
    question.setSingleCorrect(false);
   
    // Kprim has always 4 answers, each of them score 1/4 of the maximum value
    ChoiceResponse newChoice = new ChoiceResponse();
    newChoice.getContent().add(new Mattext(trans.translate("editor.newresponsetext")));
    newChoice.setCorrect(false);
    newChoice.setPoints(maxValue/4);
    question.getResponses().add(newChoice);
    ChoiceResponse newChoice2 = new ChoiceResponse();
    newChoice2.getContent().add(new Mattext(trans.translate("editor.newresponsetext")));
    newChoice2.setCorrect(false);
    newChoice2.setPoints(maxValue/4);
    question.getResponses().add(newChoice2);
    ChoiceResponse newChoice3 = new ChoiceResponse();
    newChoice3.getContent().add(new Mattext(trans.translate("editor.newresponsetext")));
    newChoice3.setCorrect(false);
    newChoice3.setPoints(maxValue/4);
    question.getResponses().add(newChoice3);
    ChoiceResponse newChoice4 = new ChoiceResponse();
    newChoice4.getContent().add(new Mattext(trans.translate("editor.newresponsetext")));
    newChoice4.setCorrect(false);
    newChoice4.setPoints(maxValue/4);
    question.getResponses().add(newChoice4);
    question.setMaxValue(maxValue);
    newItem.setQuestion(question);
View Full Code Here

   
    QTIEditHelper.setFeedbackMastery(newItem, "");
    QTIEditHelper.setFeedbackFail(newItem, "")
   
    FIBQuestion fibquestion = new FIBQuestion();
    fibquestion.getQuestion().getElements().add(new Mattext(trans.translate("editor.newquestiontext")));
    fibquestion.setSingleCorrect(true);
    fibquestion.setSingleCorrectScore(1);

    FIBResponse response = new FIBResponse();
    response.setType(FIBResponse.TYPE_CONTENT);
    Material mat = new Material();
    mat.add(new Mattext(trans.translate("editor.newtextelement")));
    response.setContent(mat);
    fibquestion.getResponses().add(response);
    newItem.setQuestion(fibquestion);

    return newItem;
View Full Code Here

   
    QTIEditHelper.setFeedbackMastery(newItem, "");
    QTIEditHelper.setFeedbackFail(newItem, "")
   
    EssayQuestion essayquestion = new EssayQuestion();
    essayquestion.getQuestion().getElements().add(new Mattext(trans.translate("editor.newquestiontext")));
    essayquestion.setSingleCorrect(true);
    essayquestion.setSingleCorrectScore(1);

    EssayResponse response = new EssayResponse();
    Material mat = new Material();
    mat.add(new Mattext(trans.translate("editor.newtextelement")));
    response.setContent(mat);
    essayquestion.getResponses().add(response);
    newItem.setQuestion(essayquestion);

    return newItem;
View Full Code Here

        Element el_material = (Element) iter.next();
        Material mat = (Material) parserManager.parse(el_material);
        content.getElements().addAll(mat.getElements());
      }
      // assure material always has some content
      if (content.getElements().size() == 0) content.getElements().add(new Mattext("[blank]"));
      choice.setContent(content);
      choices.add(choice);
    }
    return choices;
  }
View Full Code Here

      List matList = feedback.getMaterials();
      if (matList.size() > 0) {
        Material mat = (Material) feedback.getMaterials().get(0);
        if (mat == null) {
          mat = new Material();
          mat.getElements().add(new Mattext(feedbackString));
          feedback.getMaterials().add(mat);
        } else if (mat.getElements().size() > 0) {
          mat.getElements().set(0, new Mattext(feedbackString));
        } else {
          mat.getElements().add(new Mattext(feedbackString));
        }
      } else {
        Material mat = new Material();
        mat.getElements().add(new Mattext(feedbackString));
        feedback.getMaterials().add(mat);
      }
    } else {
      Feedback newFeedback = new Feedback();
      newFeedback.setIdent(sIdent);
      newFeedback.setView("All");
      Mattext newMattext = new Mattext(feedbackString);

      ArrayList newMattextL = new ArrayList();
      newMattextL.add(newMattext);

      Material material = new Material();
View Full Code Here

   */
  public Object parse(Element element) {
    //assert element.getName().equalsIgnoreCase("mattext");
    String text = element.getTextTrim();
    if(text != null && text.length() > 0) {
      return new Mattext(text);
    }
    return null;
  }
View Full Code Here

TOP

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

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.