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;
}
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;
}
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;
}
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;
}
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);
}
}
Aggregations