Package org.olat.core.gui.formelements

Examples of org.olat.core.gui.formelements.StaticTextElement


   * @param name
   */
  public ChangeMessageForm(String name, Translator translator) {
    super(name, translator);
    //
    StaticTextElement userInfo = new StaticTextElement("form.chngmsg.infolabel", translate("form.chngmsg.info"));
    userMsg = new TextAreaElement("form.chngmsg.usermsg", 7, 80);
    chkbx = new CheckBoxElement("form.chngmsg.informlearners", true);
    addFormElement("userInfo", userInfo);
    addFormElement("userMsg", userMsg);
    addFormElement("learnerYes", chkbx);
View Full Code Here


  /**
   * Initialize the form.
   */
  public void init() {
    addFormElement("size", new StaticTextElement("fr.size",
        new Long(file.length() / 1024).toString() + " KB"));

    DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale());
    addFormElement("last", new StaticTextElement("fr.last", df.format(new Date(file.lastModified()))));
   
    String resType = res.getResourceableTypeName();
    if (resType.equals(TestFileResource.TYPE_NAME) || resType.equals(SurveyFileResource.TYPE_NAME)) addQTIDetails();
    else if (resType.equals(ImsCPFileResource.TYPE_NAME) || resType.equals(ScormCPFileResource.TYPE_NAME)) addIMSCPDetails();
   
View Full Code Here

   

    // extract title
    Element el_assess = (Element)doc.selectSingleNode("questestinterop/assessment");
    String title = el_assess.attributeValue("title");
    if (title != null) addFormElement("qti.title", new StaticTextElement("qti.title", title));
    else addFormElement("qti.title", new StaticTextElement("qti.title", "-"));
   
    // extract objectives
    HTMLTextAreaElement htmlTA = new HTMLTextAreaElement("qti.objectives", 10, 60);
    htmlTA.setReadOnly(true);
    Element el_objectives = (Element)doc.selectSingleNode("//questestinterop/assessment/objectives");
    if (el_objectives != null) {
      Element el_mat = (Element)el_objectives.selectSingleNode("material/mattext");
      if (el_mat != null)
        htmlTA.setValue(el_mat.getTextTrim());
    } else htmlTA.setValue("-");
    addFormElement("qti.objectives", htmlTA);
   
    // extract num of questions
    List items = doc.selectNodes("//item");
    if (items.size() > 0)
      addFormElement("qti.questions", new StaticTextElement("qti.questions", "" + items.size()));
    else addFormElement("qti.questions", new StaticTextElement("qti.questions", "-"));
   
    // extract time limit
    Element el_duration = (Element)el_assess.selectSingleNode("duration");
    if (el_duration != null) {
      long dur = QTIHelper.parseISODuration(el_duration.getTextTrim());
      long min = dur / 1024 / 60;
      long sec = (dur - (min * 60 * 1024)) / 1024;
      addFormElement("qti.timelimit", new StaticTextElement("qti.timelimit", min + "' " + sec + "''"));
    } else addFormElement("qti.timelimit", new StaticTextElement("qti.timelimit", "-"));

  }
View Full Code Here

TOP

Related Classes of org.olat.core.gui.formelements.StaticTextElement

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.