Search in sources :

Example 1 with FlowStatic

use of uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic in project OpenOLAT by OpenOLAT.

the class KPrimEditorController method wrapAnswer.

private void wrapAnswer(UserRequest ureq, SimpleAssociableChoice choice) {
    List<FlowStatic> choiceFlow = choice.getFlowStatics();
    String choiceContent = itemBuilder.getHtmlHelper().flowStaticString(choiceFlow);
    String choiceId = "answer" + count++;
    RichTextElement choiceEl = uifactory.addRichTextElementForQTI21(choiceId, "form.imd.answer", choiceContent, 8, -1, itemContainer, answersCont, ureq.getUserSession(), getWindowControl());
    choiceEl.getEditorConfiguration().setSimplestTextModeAllowed(TextMode.oneLine);
    choiceEl.setUserObject(choice);
    choiceEl.setEnabled(!readOnly);
    choiceEl.setVisible(!readOnly);
    answersCont.add("choiceId", choiceEl);
    String choiceRoId = "answerro" + count++;
    FlowFormItem choiceReadOnlyEl = new FlowFormItem(choiceRoId, itemFile);
    choiceReadOnlyEl.setFlowStatics(choiceFlow);
    choiceReadOnlyEl.setMapperUri(mapperUri);
    answersCont.add(choiceRoId, choiceReadOnlyEl);
    FormLink upLink = uifactory.addFormLink("up-".concat(choiceId), "up", "", null, answersCont, Link.NONTRANSLATED);
    upLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_up");
    upLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(upLink);
    answersCont.add("up-".concat(choiceId), upLink);
    FormLink downLink = uifactory.addFormLink("down-".concat(choiceId), "down", "", null, answersCont, Link.NONTRANSLATED);
    downLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_down");
    downLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(downLink);
    answersCont.add("down-".concat(choiceId), downLink);
    choiceWrappers.add(new KprimWrapper(choice, choiceEl, choiceReadOnlyEl, upLink, downLink));
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) FlowStatic(uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic) FlowFormItem(org.olat.ims.qti21.ui.components.FlowFormItem) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 2 with FlowStatic

use of uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic in project OpenOLAT by OpenOLAT.

the class SingleChoiceEditorController method wrapAnswer.

private void wrapAnswer(UserRequest ureq, SimpleChoice choice) {
    List<FlowStatic> choiceFlow = choice.getFlowStatics();
    String choiceContent = itemBuilder.getHtmlHelper().flowStaticString(choiceFlow);
    String choiceId = "answer" + count++;
    RichTextElement choiceEl = uifactory.addRichTextElementForQTI21(choiceId, "form.imd.answer", choiceContent, 8, -1, itemContainer, answersCont, ureq.getUserSession(), getWindowControl());
    choiceEl.setEnabled(!readOnly);
    choiceEl.setVisible(!readOnly);
    choiceEl.getEditorConfiguration().setSimplestTextModeAllowed(TextMode.oneLine);
    choiceEl.setUserObject(choice);
    answersCont.add("choiceId", choiceEl);
    String choiceRoId = "answerro" + count++;
    FlowFormItem choiceReadOnlyEl = new FlowFormItem(choiceRoId, itemFile);
    choiceReadOnlyEl.setFlowStatics(choiceFlow);
    choiceReadOnlyEl.setMapperUri(mapperUri);
    answersCont.add(choiceRoId, choiceReadOnlyEl);
    FormLink removeLink = uifactory.addFormLink("rm-".concat(choiceId), "rm", "", null, answersCont, Link.NONTRANSLATED);
    removeLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete");
    removeLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(removeLink);
    answersCont.add("rm-".concat(choiceId), removeLink);
    FormLink addLink = uifactory.addFormLink("add-".concat(choiceId), "add", "", null, answersCont, Link.NONTRANSLATED);
    addLink.setIconLeftCSS("o_icon o_icon-lg o_icon_add");
    addLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(addLink);
    answersCont.add("add-".concat(choiceId), addLink);
    FormLink upLink = uifactory.addFormLink("up-".concat(choiceId), "up", "", null, answersCont, Link.NONTRANSLATED);
    upLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_up");
    upLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(upLink);
    answersCont.add("up-".concat(choiceId), upLink);
    FormLink downLink = uifactory.addFormLink("down-".concat(choiceId), "down", "", null, answersCont, Link.NONTRANSLATED);
    downLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_down");
    downLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(downLink);
    answersCont.add("down-".concat(choiceId), downLink);
    choiceWrappers.add(new SimpleChoiceWrapper(choice, choiceEl, choiceReadOnlyEl, removeLink, addLink, upLink, downLink));
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) FlowStatic(uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic) FlowFormItem(org.olat.ims.qti21.ui.components.FlowFormItem) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 3 with FlowStatic

use of uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic in project openolat by klemens.

the class SingleChoiceEditorController method wrapAnswer.

private void wrapAnswer(UserRequest ureq, SimpleChoice choice) {
    List<FlowStatic> choiceFlow = choice.getFlowStatics();
    String choiceContent = itemBuilder.getHtmlHelper().flowStaticString(choiceFlow);
    String choiceId = "answer" + count++;
    RichTextElement choiceEl = uifactory.addRichTextElementForQTI21(choiceId, "form.imd.answer", choiceContent, 8, -1, itemContainer, answersCont, ureq.getUserSession(), getWindowControl());
    choiceEl.setEnabled(!readOnly);
    choiceEl.setVisible(!readOnly);
    choiceEl.getEditorConfiguration().setSimplestTextModeAllowed(TextMode.oneLine);
    choiceEl.setUserObject(choice);
    answersCont.add("choiceId", choiceEl);
    String choiceRoId = "answerro" + count++;
    FlowFormItem choiceReadOnlyEl = new FlowFormItem(choiceRoId, itemFile);
    choiceReadOnlyEl.setFlowStatics(choiceFlow);
    choiceReadOnlyEl.setMapperUri(mapperUri);
    answersCont.add(choiceRoId, choiceReadOnlyEl);
    FormLink removeLink = uifactory.addFormLink("rm-".concat(choiceId), "rm", "", null, answersCont, Link.NONTRANSLATED);
    removeLink.setIconLeftCSS("o_icon o_icon-lg o_icon_delete");
    removeLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(removeLink);
    answersCont.add("rm-".concat(choiceId), removeLink);
    FormLink addLink = uifactory.addFormLink("add-".concat(choiceId), "add", "", null, answersCont, Link.NONTRANSLATED);
    addLink.setIconLeftCSS("o_icon o_icon-lg o_icon_add");
    addLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(addLink);
    answersCont.add("add-".concat(choiceId), addLink);
    FormLink upLink = uifactory.addFormLink("up-".concat(choiceId), "up", "", null, answersCont, Link.NONTRANSLATED);
    upLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_up");
    upLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(upLink);
    answersCont.add("up-".concat(choiceId), upLink);
    FormLink downLink = uifactory.addFormLink("down-".concat(choiceId), "down", "", null, answersCont, Link.NONTRANSLATED);
    downLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_down");
    downLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(downLink);
    answersCont.add("down-".concat(choiceId), downLink);
    choiceWrappers.add(new SimpleChoiceWrapper(choice, choiceEl, choiceReadOnlyEl, removeLink, addLink, upLink, downLink));
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) FlowStatic(uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic) FlowFormItem(org.olat.ims.qti21.ui.components.FlowFormItem) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 4 with FlowStatic

use of uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic in project openolat by klemens.

the class TrueFalseEditorController method wrapSource.

private void wrapSource(UserRequest ureq, SimpleAssociableChoice choice, List<SourceWrapper> wrappers) {
    List<FlowStatic> choiceFlow = choice.getFlowStatics();
    String choiceContent = itemBuilder.getHtmlHelper().flowStaticString(choiceFlow);
    String choiceId = "answer" + count++;
    RichTextElement choiceEl = uifactory.addRichTextElementForQTI21Match(choiceId, "form.imd.answer", choiceContent, 4, -1, itemContainer, answersCont, ureq.getUserSession(), getWindowControl());
    choiceEl.setUserObject(choice);
    choiceEl.setEnabled(!readOnly);
    choiceEl.setVisible(!readOnly);
    answersCont.add("choiceId", choiceEl);
    String choiceRoId = "answerro" + count++;
    FlowFormItem choiceReadOnlyEl = new FlowFormItem(choiceRoId, itemFile);
    choiceReadOnlyEl.setFlowStatics(choiceFlow);
    choiceReadOnlyEl.setMapperUri(mapperUri);
    answersCont.add(choiceRoId, choiceReadOnlyEl);
    FormLink deleteButton = uifactory.addFormLink("del_" + (count++), "delete", "delete", null, answersCont, Link.NONTRANSLATED);
    deleteButton.setIconLeftCSS("o_icon o_icon_delete_item");
    deleteButton.setVisible(!restrictedEdit && !readOnly);
    deleteButton.setI18nKey("");
    SourceWrapper wrapper = new SourceWrapper(choice, choiceEl, choiceReadOnlyEl, deleteButton);
    deleteButton.setUserObject(wrapper);
    wrappers.add(wrapper);
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) FlowStatic(uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic) FlowFormItem(org.olat.ims.qti21.ui.components.FlowFormItem) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Example 5 with FlowStatic

use of uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic in project openolat by klemens.

the class KPrimEditorController method wrapAnswer.

private void wrapAnswer(UserRequest ureq, SimpleAssociableChoice choice) {
    List<FlowStatic> choiceFlow = choice.getFlowStatics();
    String choiceContent = itemBuilder.getHtmlHelper().flowStaticString(choiceFlow);
    String choiceId = "answer" + count++;
    RichTextElement choiceEl = uifactory.addRichTextElementForQTI21(choiceId, "form.imd.answer", choiceContent, 8, -1, itemContainer, answersCont, ureq.getUserSession(), getWindowControl());
    choiceEl.getEditorConfiguration().setSimplestTextModeAllowed(TextMode.oneLine);
    choiceEl.setUserObject(choice);
    choiceEl.setEnabled(!readOnly);
    choiceEl.setVisible(!readOnly);
    answersCont.add("choiceId", choiceEl);
    String choiceRoId = "answerro" + count++;
    FlowFormItem choiceReadOnlyEl = new FlowFormItem(choiceRoId, itemFile);
    choiceReadOnlyEl.setFlowStatics(choiceFlow);
    choiceReadOnlyEl.setMapperUri(mapperUri);
    answersCont.add(choiceRoId, choiceReadOnlyEl);
    FormLink upLink = uifactory.addFormLink("up-".concat(choiceId), "up", "", null, answersCont, Link.NONTRANSLATED);
    upLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_up");
    upLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(upLink);
    answersCont.add("up-".concat(choiceId), upLink);
    FormLink downLink = uifactory.addFormLink("down-".concat(choiceId), "down", "", null, answersCont, Link.NONTRANSLATED);
    downLink.setIconLeftCSS("o_icon o_icon-lg o_icon_move_down");
    downLink.setEnabled(!restrictedEdit && !readOnly);
    answersCont.add(downLink);
    answersCont.add("down-".concat(choiceId), downLink);
    choiceWrappers.add(new KprimWrapper(choice, choiceEl, choiceReadOnlyEl, upLink, downLink));
}
Also used : RichTextElement(org.olat.core.gui.components.form.flexible.elements.RichTextElement) FlowStatic(uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic) FlowFormItem(org.olat.ims.qti21.ui.components.FlowFormItem) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink)

Aggregations

FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)10 RichTextElement (org.olat.core.gui.components.form.flexible.elements.RichTextElement)10 FlowFormItem (org.olat.ims.qti21.ui.components.FlowFormItem)10 FlowStatic (uk.ac.ed.ph.jqtiplus.node.content.basic.FlowStatic)10