use of org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent in project openolat by klemens.
the class EssayEditorController method formOK.
@Override
protected void formOK(UserRequest ureq) {
if (readOnly)
return;
// title
itemBuilder.setTitle(titleEl.getValue());
// question
String questionText = textEl.getRawValue();
itemBuilder.setQuestion(questionText);
itemBuilder.setPlaceholder(placeholderEl.getValue());
if (!restrictedEdit) {
itemBuilder.setExpectedLength(getValue(lengthEl));
itemBuilder.setExpectedLines(getValue(heightEl));
// min. max. words
itemBuilder.setMinStrings(getValue(minWordsEl));
itemBuilder.setMaxStrings(getValue(maxWordsEl));
}
fireEvent(ureq, new AssessmentItemEvent(AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED, itemBuilder.getAssessmentItem(), QTI21QuestionType.essay));
}
use of org.olat.ims.qti21.ui.editor.events.AssessmentItemEvent in project openolat by klemens.
the class MinimalScoreController 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));
fireEvent(ureq, new AssessmentItemEvent(AssessmentItemEvent.ASSESSMENT_ITEM_CHANGED, itemBuilder.getAssessmentItem()));
}
Aggregations