use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project OpenOLAT by OpenOLAT.
the class AssessmentItemBuilder method extractModalFeedbacks.
private void extractModalFeedbacks() {
List<ModalFeedback> feedbacks = assessmentItem.getModalFeedbacks();
for (ModalFeedback feedback : feedbacks) {
ModalFeedbackBuilder feedbackBuilder = new ModalFeedbackBuilder(assessmentItem, feedback);
ModalFeedbackType feedbackType = feedbackBuilder.getType();
if (feedbackType != null && feedbackType != ModalFeedbackType.unkown) {
switch(feedbackType) {
case correct:
correctFeedback = feedbackBuilder;
break;
case incorrect:
incorrectFeedback = feedbackBuilder;
break;
case correctSolution:
correctSolutionFeedback = feedbackBuilder;
break;
case empty:
emptyFeedback = feedbackBuilder;
break;
case answered:
answeredFeedback = feedbackBuilder;
break;
case hint:
hint = feedbackBuilder;
break;
case additional:
additionalFeedbacks.add(feedbackBuilder);
break;
case unkown:
log.error("Unkown feedback:");
break;
}
}
}
}
use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project OpenOLAT by OpenOLAT.
the class AssessmentItemBuilder method appendAdditionalFeedback.
protected void appendAdditionalFeedback(ModalFeedbackBuilder feedback, List<ModalFeedback> modalFeedbacks, List<ResponseRule> responseRules) {
Identifier feedbackIdentifier = feedback.getIdentifier();
ModalFeedback modalFeedback = AssessmentItemFactory.createModalFeedback(assessmentItem, feedbackIdentifier, feedback.getTitle(), feedback.getText());
modalFeedbacks.add(modalFeedback);
Cardinality cardinality = null;
Identifier responseIdentifier = null;
if (this instanceof ResponseIdentifierForFeedback) {
responseIdentifier = ((ResponseIdentifierForFeedback) this).getResponseIdentifier();
cardinality = assessmentItem.getResponseDeclaration(responseIdentifier).getCardinality();
}
ResponseCondition feedbackCondition = AssessmentItemFactory.createModalFeedbackRuleWithConditions(assessmentItem.getResponseProcessing(), feedbackIdentifier, responseIdentifier, cardinality, feedback.getFeedbackConditons());
responseRules.add(feedbackCondition);
}
use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project OpenOLAT by OpenOLAT.
the class AssessmentItemBuilder method appendModalFeedback.
protected void appendModalFeedback(ModalFeedbackBuilder feedbackBuilder, String inCorrect, List<ModalFeedback> modalFeedbacks, List<ResponseRule> responseRules) {
ModalFeedback modalFeedback = AssessmentItemFactory.createModalFeedback(assessmentItem, feedbackBuilder.getIdentifier(), feedbackBuilder.getTitle(), feedbackBuilder.getText());
modalFeedbacks.add(modalFeedback);
ResponseCondition feedbackCondition = AssessmentItemFactory.createModalFeedbackBasicRule(assessmentItem.getResponseProcessing(), feedbackBuilder.getIdentifier(), inCorrect, hint != null);
responseRules.add(feedbackCondition);
}
use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project openolat by klemens.
the class AssessmentItemBuilder method build.
public final void build() {
List<OutcomeDeclaration> outcomeDeclarations = assessmentItem.getOutcomeDeclarations();
outcomeDeclarations.clear();
ResponseProcessing responseProcessing = assessmentItem.getResponseProcessing();
List<ResponseRule> responseRules = responseProcessing.getResponseRules();
responseRules.clear();
List<ResponseDeclaration> responseDeclarations = assessmentItem.getResponseDeclarations();
responseDeclarations.clear();
List<ModalFeedback> modalFeedbacks = assessmentItem.getModalFeedbacks();
modalFeedbacks.clear();
buildItemBody();
buildResponseAndOutcomeDeclarations();
buildModalFeedbacksAndHints(outcomeDeclarations, responseRules);
buildMinMaxScores(outcomeDeclarations, responseRules);
buildMainScoreRule(outcomeDeclarations, responseRules);
buildHint(outcomeDeclarations, responseRules);
}
use of uk.ac.ed.ph.jqtiplus.node.item.ModalFeedback in project openolat by klemens.
the class AssessmentItemBuilder method extractModalFeedbacks.
private void extractModalFeedbacks() {
List<ModalFeedback> feedbacks = assessmentItem.getModalFeedbacks();
for (ModalFeedback feedback : feedbacks) {
ModalFeedbackBuilder feedbackBuilder = new ModalFeedbackBuilder(assessmentItem, feedback);
ModalFeedbackType feedbackType = feedbackBuilder.getType();
if (feedbackType != null && feedbackType != ModalFeedbackType.unkown) {
switch(feedbackType) {
case correct:
correctFeedback = feedbackBuilder;
break;
case incorrect:
incorrectFeedback = feedbackBuilder;
break;
case correctSolution:
correctSolutionFeedback = feedbackBuilder;
break;
case empty:
emptyFeedback = feedbackBuilder;
break;
case answered:
answeredFeedback = feedbackBuilder;
break;
case hint:
hint = feedbackBuilder;
break;
case additional:
additionalFeedbacks.add(feedbackBuilder);
break;
case unkown:
log.error("Unkown feedback:");
break;
}
}
}
}
Aggregations