use of uk.ac.ed.ph.jqtiplus.value.IdentifierValue in project openolat by klemens.
the class AssessmentObjectComponentRenderer method renderTestItemModalFeedback_feedbackModal.
/**
* Render the feedback modal generated by OpenOLAT editor.
*
* @param renderer
* @param sb
* @param modalFeedback
* @param component
* @param resolvedAssessmentItem
* @param itemSessionState
* @param ubu
* @param translator
*/
private void renderTestItemModalFeedback_feedbackModal(AssessmentRenderer renderer, StringOutput sb, ModalFeedback modalFeedback, AssessmentObjectComponent component, ResolvedAssessmentItem resolvedAssessmentItem, ItemSessionState itemSessionState, URLBuilder ubu, Translator translator) {
sb.append("<div class='modalFeedback o_info clearfix");
Value feedbackBasic = itemSessionState.getOutcomeValue(QTI21Constants.FEEDBACKBASIC_IDENTIFIER);
if (feedbackBasic != null && feedbackBasic.hasBaseType(BaseType.IDENTIFIER) && feedbackBasic instanceof IdentifierValue) {
IdentifierValue identifierValue = (IdentifierValue) feedbackBasic;
if (AssessmentItemFactory.matchAdditionalFeedback(resolvedAssessmentItem.getRootNodeLookup().extractAssumingSuccessful(), modalFeedback)) {
sb.append(" o_additional_modal_feedback");
} else if (QTI21Constants.CORRECT_IDENTIFIER_VALUE.equals(identifierValue)) {
sb.append(" o_correct_modal_feedback");
} else if (QTI21Constants.INCORRECT_IDENTIFIER_VALUE.equals(identifierValue)) {
sb.append(" o_incorrect_modal_feedback");
} else if (QTI21Constants.EMPTY_IDENTIFIER_VALUE.equals(identifierValue)) {
sb.append(" o_empty_modal_feedback");
}
}
sb.append("'>");
Attribute<?> title = modalFeedback.getAttributes().get("title");
if (title != null && title.getValue() != null) {
String feedbackTitle = title.getValue().toString();
if (StringHelper.containsNonWhitespace(feedbackTitle)) {
sb.append("<h4>");
if (modalFeedback.getIdentifier() != null && QTI21Constants.HINT_IDENTIFIER.equals(modalFeedback.getIdentifier())) {
sb.append("<i class='o_icon o_icon_help'> </i> ");
}
sb.append(StringHelper.escapeHtml(feedbackTitle)).append("</h4>");
}
}
modalFeedback.getFlowStatics().forEach((flow) -> renderFlow(renderer, sb, component, resolvedAssessmentItem, itemSessionState, flow, ubu, translator));
sb.append("</div>");
}
Aggregations