use of org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent in project openolat by klemens.
the class FIBEditorController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (readOnly)
return;
// title
itemBuilder.setTitle(titleEl.getValue());
// set the question with the text entries
String questionText = textEl.getRawValue();
extractSolution(questionText);
itemBuilder.setQuestion(questionText);
fireEvent(ureq, new AssessmentItemEvent(AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED, itemBuilder.getAssessmentItem(), QTI21QuestionType.fib));
itemBuilder.extractQuestions();
itemBuilder.extractEntriesSettingsFromResponseDeclaration();
String question = itemBuilder.getQuestion();
textEl.setValue(question);
}
use of org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent in project openolat by klemens.
the class FIBScoreController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (restrictedEdit || readOnly)
return;
super.formOK(ureq);
String maxScoreValue = maxScoreEl.getValue();
Double maxScore = Double.parseDouble(maxScoreValue);
itemBuilder.setMaxScore(maxScore);
itemBuilder.setMinScore(new Double(0d));
if (assessmentModeEl.isOneSelected() && assessmentModeEl.isSelected(1)) {
itemBuilder.setScoreEvaluationMode(ScoreEvaluation.perAnswer);
for (FIBEntryWrapper wrapper : wrappers) {
String pointsStr = wrapper.getPointsEl().getValue();
Double points = new Double(pointsStr);
wrapper.getEntry().setScore(points);
}
} else {
itemBuilder.setScoreEvaluationMode(ScoreEvaluation.allCorrectAnswers);
}
fireEvent(ureq, new AssessmentItemEvent(AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED, itemBuilder.getAssessmentItem(), null));
}
use of org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent in project openolat by klemens.
the class HottextEditorController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (readOnly)
return;
// title
itemBuilder.setTitle(titleEl.getValue());
if (!restrictedEdit) {
// set the question with the text entries
String questionText = textEl.getRawValue();
itemBuilder.setQuestion(questionText);
}
fireEvent(ureq, new AssessmentItemEvent(AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED, itemBuilder.getAssessmentItem(), QTI21QuestionType.hottext));
}
use of org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent in project openolat by klemens.
the class ChoiceScoreController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (restrictedEdit || readOnly)
return;
super.formOK(ureq);
String maxScoreValue = maxScoreEl.getValue();
Double maxScore = Double.parseDouble(maxScoreValue);
itemBuilder.setMaxScore(maxScore);
String minScoreValue = minScoreEl.getValue();
Double minScore = Double.parseDouble(minScoreValue);
itemBuilder.setMinScore(minScore);
if (maxChoicesEl != null && maxChoicesEl.isOneSelected()) {
int maxChoices = Integer.parseInt(maxChoicesEl.getSelectedKey());
itemBuilder.setMaxChoices(maxChoices);
}
if (minChoicesEl != null && minChoicesEl.isOneSelected()) {
int minChoices = Integer.parseInt(minChoicesEl.getSelectedKey());
itemBuilder.setMinChoices(minChoices);
}
if (assessmentModeEl.isOneSelected() && assessmentModeEl.isSelected(1)) {
itemBuilder.setScoreEvaluationMode(ScoreEvaluation.perAnswer);
itemBuilder.clearMapping();
for (ChoiceWrapper wrapper : wrappers) {
String pointsStr = wrapper.getPointsEl().getValue();
Double points = new Double(pointsStr);
itemBuilder.setMapping(wrapper.getChoice().getIdentifier(), points);
}
} else {
itemBuilder.setScoreEvaluationMode(ScoreEvaluation.allCorrectAnswers);
itemBuilder.clearMapping();
}
fireEvent(ureq, new AssessmentItemEvent(AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED, itemBuilder.getAssessmentItem(), null));
}
use of org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent in project openolat by klemens.
the class DrawingEditorController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (readOnly)
return;
// title
itemBuilder.setTitle(titleEl.getValue());
File objectImg = null;
if (backgroundImage != null) {
objectImg = backgroundImage;
} else if (initialBackgroundImage != null) {
objectImg = initialBackgroundImage;
}
if (objectImg != null) {
String filename = objectImg.getName();
String mimeType = WebappHelper.getMimeType(filename);
Size size = imageService.getSize(new LocalFileImpl(objectImg), null);
int height = -1;
int width = -1;
if (size != null) {
height = size.getHeight();
width = size.getWidth();
}
itemBuilder.setBackground(filename, mimeType, height, width);
}
// question
String questionText = textEl.getRawValue();
itemBuilder.setQuestion(questionText);
fireEvent(ureq, new AssessmentItemEvent(AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED, itemBuilder.getAssessmentItem(), QTI21QuestionType.drawing));
}
Aggregations