Search in sources :

Example 41 with AssessmentItemBuilder

use of org.olat.ims.qti21.model.xml.AssessmentItemBuilder in project OpenOLAT by OpenOLAT.

the class AssessmentItemEditorController method initMatchTrueFalseEditors.

private AssessmentItemBuilder initMatchTrueFalseEditors(UserRequest ureq, AssessmentItem item) {
    MatchAssessmentItemBuilder matchItemBuilder = new MatchAssessmentItemBuilder(item, qtiService.qtiSerializer());
    itemEditor = new TrueFalseEditorController(ureq, getWindowControl(), matchItemBuilder, rootDirectory, rootContainer, itemFile, restrictedEdit, readOnly);
    listenTo(itemEditor);
    scoreEditor = new MatchScoreController(ureq, getWindowControl(), matchItemBuilder, itemRef, itemFile, false, restrictedEdit, readOnly);
    listenTo(scoreEditor);
    feedbackEditor = new FeedbacksEditorController(ureq, getWindowControl(), matchItemBuilder, rootDirectory, rootContainer, itemFile, FeedbacksEnabler.standardFeedbacks(), restrictedEdit, readOnly);
    listenTo(feedbackEditor);
    tabbedPane.addTab(translate("form.match"), itemEditor);
    tabbedPane.addTab(translate("form.score"), scoreEditor);
    tabbedPane.addTab(translate("form.feedback"), feedbackEditor);
    return matchItemBuilder;
}
Also used : MatchScoreController(org.olat.ims.qti21.ui.editor.interactions.MatchScoreController) TrueFalseEditorController(org.olat.ims.qti21.ui.editor.interactions.TrueFalseEditorController) MatchAssessmentItemBuilder(org.olat.ims.qti21.model.xml.interactions.MatchAssessmentItemBuilder)

Example 42 with AssessmentItemBuilder

use of org.olat.ims.qti21.model.xml.AssessmentItemBuilder in project OpenOLAT by OpenOLAT.

the class AssessmentItemEditorController method initFIBEditors.

private AssessmentItemBuilder initFIBEditors(UserRequest ureq, QTI21QuestionType preferedType, AssessmentItem item) {
    FIBAssessmentItemBuilder fibItemBuilder = new FIBAssessmentItemBuilder(item, qtiService.qtiSerializer());
    itemEditor = new FIBEditorController(ureq, getWindowControl(), preferedType, fibItemBuilder, rootDirectory, rootContainer, itemFile, restrictedEdit, readOnly);
    listenTo(itemEditor);
    scoreEditor = new FIBScoreController(ureq, getWindowControl(), fibItemBuilder, itemRef, restrictedEdit, readOnly);
    listenTo(scoreEditor);
    feedbackEditor = new FeedbacksEditorController(ureq, getWindowControl(), fibItemBuilder, rootDirectory, rootContainer, itemFile, FeedbacksEnabler.standardFeedbacks(), restrictedEdit, readOnly);
    listenTo(feedbackEditor);
    tabbedPane.addTab(translate("form.fib"), itemEditor);
    tabbedPane.addTab(translate("form.score"), scoreEditor);
    tabbedPane.addTab(translate("form.feedback"), feedbackEditor);
    return fibItemBuilder;
}
Also used : FIBAssessmentItemBuilder(org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder) FIBScoreController(org.olat.ims.qti21.ui.editor.interactions.FIBScoreController) FIBEditorController(org.olat.ims.qti21.ui.editor.interactions.FIBEditorController)

Example 43 with AssessmentItemBuilder

use of org.olat.ims.qti21.model.xml.AssessmentItemBuilder in project OpenOLAT by OpenOLAT.

the class AssessmentItemEditorController method initEssayEditors.

private AssessmentItemBuilder initEssayEditors(UserRequest ureq, AssessmentItem item) {
    EssayAssessmentItemBuilder essayItemBuilder = new EssayAssessmentItemBuilder(item, qtiService.qtiSerializer());
    itemEditor = new EssayEditorController(ureq, getWindowControl(), essayItemBuilder, rootDirectory, rootContainer, itemFile, restrictedEdit, readOnly);
    listenTo(itemEditor);
    scoreEditor = new MinimalScoreController(ureq, getWindowControl(), essayItemBuilder, itemRef, restrictedEdit, readOnly, "Test editor QTI 2.1 in detail#details_testeditor_score");
    listenTo(scoreEditor);
    feedbackEditor = new FeedbacksEditorController(ureq, getWindowControl(), essayItemBuilder, rootDirectory, rootContainer, itemFile, FeedbacksEnabler.lobFeedbacks(), restrictedEdit, readOnly);
    listenTo(feedbackEditor);
    tabbedPane.addTab(translate("form.essay"), itemEditor);
    tabbedPane.addTab(translate("form.score"), scoreEditor);
    tabbedPane.addTab(translate("form.feedback"), feedbackEditor);
    return essayItemBuilder;
}
Also used : EssayEditorController(org.olat.ims.qti21.ui.editor.interactions.EssayEditorController) EssayAssessmentItemBuilder(org.olat.ims.qti21.model.xml.interactions.EssayAssessmentItemBuilder)

Example 44 with AssessmentItemBuilder

use of org.olat.ims.qti21.model.xml.AssessmentItemBuilder in project OpenOLAT by OpenOLAT.

the class AssessmentItemEditorController method initDrawingEditors.

private AssessmentItemBuilder initDrawingEditors(UserRequest ureq, AssessmentItem item) {
    DrawingAssessmentItemBuilder uploadItemBuilder = new DrawingAssessmentItemBuilder(item, qtiService.qtiSerializer());
    itemEditor = new DrawingEditorController(ureq, getWindowControl(), uploadItemBuilder, rootDirectory, rootContainer, itemFile, restrictedEdit, readOnly);
    listenTo(itemEditor);
    scoreEditor = new MinimalScoreController(ureq, getWindowControl(), uploadItemBuilder, itemRef, restrictedEdit, readOnly, "Test and Questionnaire Editor in Detail#details_testeditor_fragetypen_ft");
    listenTo(scoreEditor);
    feedbackEditor = new FeedbacksEditorController(ureq, getWindowControl(), uploadItemBuilder, rootDirectory, rootContainer, itemFile, FeedbacksEnabler.lobFeedbacks(), restrictedEdit, readOnly);
    listenTo(feedbackEditor);
    tabbedPane.addTab(translate("form.drawing"), itemEditor);
    tabbedPane.addTab(translate("form.score"), scoreEditor);
    tabbedPane.addTab(translate("form.feedback"), feedbackEditor);
    return uploadItemBuilder;
}
Also used : DrawingEditorController(org.olat.ims.qti21.ui.editor.interactions.DrawingEditorController) DrawingAssessmentItemBuilder(org.olat.ims.qti21.model.xml.interactions.DrawingAssessmentItemBuilder)

Example 45 with AssessmentItemBuilder

use of org.olat.ims.qti21.model.xml.AssessmentItemBuilder in project OpenOLAT by OpenOLAT.

the class FIBScoreController method sync.

@Override
public void sync(UserRequest ureq, AssessmentItemBuilder assessmentItemBuilder) {
    if (itemBuilder == assessmentItemBuilder) {
        List<AbstractEntry> entries = itemBuilder.getOrderedTextEntries();
        for (AbstractEntry entry : entries) {
            FIBEntryWrapper wrapper = getTextEntryWrapper(entry);
            if (wrapper == null) {
                wrappers.add(createTextEntryWrapper(entry));
            }
        }
        // remove removed entry
        for (Iterator<FIBEntryWrapper> wrapperIt = wrappers.iterator(); wrapperIt.hasNext(); ) {
            Identifier responseIdentifier = wrapperIt.next().getEntry().getResponseIdentifier();
            if (itemBuilder.getTextEntry(responseIdentifier.toString()) == null) {
                wrapperIt.remove();
            }
        }
        // reorder the wrappers
        Map<AbstractEntry, FIBEntryWrapper> wrapperMap = new HashMap<>();
        for (FIBEntryWrapper wrapper : wrappers) {
            wrapperMap.put(wrapper.getEntry(), wrapper);
        }
        List<FIBEntryWrapper> reorderedWrappers = new ArrayList<>();
        for (AbstractEntry entry : entries) {
            FIBEntryWrapper wrapper = wrapperMap.get(entry);
            if (wrapper != null) {
                reorderedWrappers.add(wrapper);
                wrapperMap.remove(entry);
            }
        }
        if (wrapperMap.size() > 0) {
            // paranoid security
            for (FIBEntryWrapper wrapper : wrapperMap.values()) {
                if (!reorderedWrappers.contains(wrapper)) {
                    reorderedWrappers.add(wrapper);
                }
            }
        }
        wrappers.clear();
        wrappers.addAll(reorderedWrappers);
    }
}
Also used : AbstractEntry(org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder.AbstractEntry) Identifier(uk.ac.ed.ph.jqtiplus.types.Identifier) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList)

Aggregations

EssayAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.EssayAssessmentItemBuilder)28 FIBAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder)28 KPrimAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.KPrimAssessmentItemBuilder)28 MultipleChoiceAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.MultipleChoiceAssessmentItemBuilder)28 SingleChoiceAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.SingleChoiceAssessmentItemBuilder)28 MatchAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.MatchAssessmentItemBuilder)26 AssessmentItemBuilder (org.olat.ims.qti21.model.xml.AssessmentItemBuilder)24 SimpleChoiceAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.SimpleChoiceAssessmentItemBuilder)18 EssayQuestion (org.olat.ims.qti.editor.beecom.objects.EssayQuestion)14 ChoiceQuestion (org.olat.ims.qti.editor.beecom.objects.ChoiceQuestion)12 EssayResponse (org.olat.ims.qti.editor.beecom.objects.EssayResponse)12 Question (org.olat.ims.qti.editor.beecom.objects.Question)12 AssessmentItem (uk.ac.ed.ph.jqtiplus.node.item.AssessmentItem)12 ChoiceResponse (org.olat.ims.qti.editor.beecom.objects.ChoiceResponse)10 FIBResponse (org.olat.ims.qti.editor.beecom.objects.FIBResponse)10 Response (org.olat.ims.qti.editor.beecom.objects.Response)10 File (java.io.File)8 HashMap (java.util.HashMap)8 DrawingAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.DrawingAssessmentItemBuilder)8 HotspotAssessmentItemBuilder (org.olat.ims.qti21.model.xml.interactions.HotspotAssessmentItemBuilder)8