Search in sources :

Example 26 with QTI21QuestionType

use of org.olat.ims.qti21.model.QTI21QuestionType in project openolat by klemens.

the class UnkownItemConversionConfirmationController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        layoutCont.contextPut("warnings", report.getWarnings());
        layoutCont.contextPut("questionType", translate("new." + report.getType().name()));
    }
    if (report.getAlternatives().size() > 0) {
        String[] theKeys = new String[report.getAlternatives().size()];
        String[] theValues = new String[theKeys.length];
        for (int i = 0; i < report.getAlternatives().size(); i++) {
            QTI21QuestionType alternative = report.getAlternatives().get(i);
            theKeys[i] = alternative.name();
            theValues[i] = translate("new." + alternative.name());
        }
        alternativeEl = uifactory.addDropdownSingleselect("questions.alternative", formLayout, theKeys, theValues, null);
        alternativeEl.setDomReplacementWrapperRequired(false);
    }
    uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
    uifactory.addFormSubmitButton("convert", formLayout);
}
Also used : FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) QTI21QuestionType(org.olat.ims.qti21.model.QTI21QuestionType)

Aggregations

QTI21QuestionType (org.olat.ims.qti21.model.QTI21QuestionType)20 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)12 ResolvedAssessmentItem (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentItem)12 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)6 File (java.io.File)4 FIBAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder)4 AssessmentItemRef (uk.ac.ed.ph.jqtiplus.node.test.AssessmentItemRef)4 BadResourceException (uk.ac.ed.ph.jqtiplus.provision.BadResourceException)4 FileOutputStream (java.io.FileOutputStream)2 IOException (java.io.IOException)2 OutputStream (java.io.OutputStream)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 Translator (org.olat.core.gui.translator.Translator)2 AssertException (org.olat.core.logging.AssertException)2 LocalImpl (org.olat.core.util.vfs.LocalImpl)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 VFSLeaf (org.olat.core.util.vfs.VFSLeaf)2