use of org.olat.core.gui.render.StringOutput in project OpenOLAT by OpenOLAT.
the class FIBAssessmentItemBuilder method extractQuestions.
public String extractQuestions() {
try (StringOutput sb = new StringOutput()) {
List<Block> blocks = assessmentItem.getItemBody().getBlocks();
for (Block block : blocks) {
serializeJqtiObject(block, sb);
}
question = sb.toString();
} catch (IOException e) {
log.error("", e);
}
return question;
}
use of org.olat.core.gui.render.StringOutput in project OpenOLAT by OpenOLAT.
the class AssessmentSessionAuditOLog method logCandidateEvent.
@Override
public void logCandidateEvent(CandidateEvent candidateEvent, Map<Identifier, AssessmentResponse> candidateResponseMap) {
try {
StringOutput sb = new StringOutput(255);
AuditLogFormatter.log(candidateEvent, candidateResponseMap, sb);
log.audit("", sb.toString());
} catch (IOException e) {
log.error("", e);
}
}
use of org.olat.core.gui.render.StringOutput in project OpenOLAT by OpenOLAT.
the class AssessmentSessionAuditOLog method logCandidateOutcomes.
@Override
public void logCandidateOutcomes(AssessmentTestSession candidateSession, Map<Identifier, String> outcomes) {
try {
StringOutput sb = new StringOutput(255);
AuditLogFormatter.logOutcomes(outcomes, sb);
log.audit("", sb.toString());
} catch (IOException e) {
log.error("", e);
}
}
use of org.olat.core.gui.render.StringOutput in project OpenOLAT by OpenOLAT.
the class AssessmentSessionAuditOLog method logCorrection.
@Override
public void logCorrection(AssessmentTestSession candidateSession, AssessmentItemSession itemSession, Identity coach) {
try {
StringOutput sb = new StringOutput(255);
sb.append("Test session ").append(candidateSession.getKey()).append(" (assessed identity=");
if (candidateSession.getIdentity() != null) {
sb.append(candidateSession.getIdentity().getKey()).append("/").append(candidateSession.getIdentity().getName());
} else {
sb.append(candidateSession.getAnonymousIdentifier());
}
sb.append(" ");
AuditLogFormatter.logCorrection(itemSession, coach, sb);
log.audit("", sb.toString());
} catch (IOException e) {
log.error("", e);
}
}
use of org.olat.core.gui.render.StringOutput in project OpenOLAT by OpenOLAT.
the class AssessmentObjectComponentRenderer method renderBlock.
public void renderBlock(AssessmentRenderer renderer, StringOutput sb, AssessmentObjectComponent component, ResolvedAssessmentItem resolvedAssessmentItem, ItemSessionState itemSessionState, Block block, URLBuilder ubu, Translator translator) {
switch(block.getQtiClassName()) {
case AssociateInteraction.QTI_CLASS_NAME:
case ChoiceInteraction.QTI_CLASS_NAME:
case DrawingInteraction.QTI_CLASS_NAME:
case ExtendedTextInteraction.QTI_CLASS_NAME:
case GapMatchInteraction.QTI_CLASS_NAME:
case GraphicAssociateInteraction.QTI_CLASS_NAME:
case GraphicGapMatchInteraction.QTI_CLASS_NAME:
case GraphicOrderInteraction.QTI_CLASS_NAME:
case HotspotInteraction.QTI_CLASS_NAME:
case SelectPointInteraction.QTI_CLASS_NAME:
case HottextInteraction.QTI_CLASS_NAME:
case MatchInteraction.QTI_CLASS_NAME:
case MediaInteraction.QTI_CLASS_NAME:
case OrderInteraction.QTI_CLASS_NAME:
case PositionObjectInteraction.QTI_CLASS_NAME:
case SliderInteraction.QTI_CLASS_NAME:
case UploadInteraction.QTI_CLASS_NAME:
{
renderInteraction(renderer, sb, (FlowInteraction) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
case CustomInteraction.QTI_CLASS_NAME:
{
renderCustomInteraction(renderer, sb, (CustomInteraction<?>) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
case PositionObjectStage.QTI_CLASS_NAME:
{
renderPositionObjectStage(renderer, sb, (PositionObjectStage) block, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
break;
}
// never rendered
case TemplateBlock.QTI_CLASS_NAME:
break;
case InfoControl.QTI_CLASS_NAME:
{
renderInfoControl(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (InfoControl) block, ubu, translator);
break;
}
case FeedbackBlock.QTI_CLASS_NAME:
{
FeedbackBlock feedbackBlock = (FeedbackBlock) block;
if (component.isFeedback(feedbackBlock, itemSessionState)) {
sb.append("<div class='o_info feedbackBlock '").append(getAtClass(feedbackBlock)).append(">");
feedbackBlock.getBlocks().forEach((child) -> renderBlock(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
sb.append("</div>");
}
break;
}
// never rendered automatically
case RubricBlock.QTI_CLASS_NAME:
break;
case Math.QTI_CLASS_NAME:
{
renderMath(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (Math) block);
break;
}
case Div.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Div) block).getFlows().forEach((flow) -> renderFlow(renderer, sb, component, resolvedAssessmentItem, itemSessionState, flow, ubu, translator));
renderEndTag(sb, block);
break;
case Ul.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Ul) block).getLis().forEach((li) -> renderLi(renderer, sb, component, resolvedAssessmentItem, itemSessionState, li, ubu, translator));
renderEndTag(sb, block);
break;
case Ol.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Ol) block).getLis().forEach((li) -> renderLi(renderer, sb, component, resolvedAssessmentItem, itemSessionState, li, ubu, translator));
renderEndTag(sb, block);
break;
case Dl.QTI_CLASS_NAME:
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
((Dl) block).getDlElements().forEach((dlElement) -> renderDlElement(renderer, sb, component, resolvedAssessmentItem, itemSessionState, dlElement, ubu, translator));
renderEndTag(sb, block);
break;
case Table.QTI_CLASS_NAME:
renderTable(renderer, sb, component, resolvedAssessmentItem, itemSessionState, (Table) block, ubu, translator);
break;
case Object.QTI_CLASS_NAME:
System.out.println("1");
break;
default:
{
renderStartHtmlTag(sb, component, resolvedAssessmentItem, block, null);
if (block instanceof AtomicBlock) {
AtomicBlock atomicBlock = (AtomicBlock) block;
atomicBlock.getInlines().forEach((child) -> renderInline(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
} else if (block instanceof SimpleBlock) {
SimpleBlock simpleBlock = (SimpleBlock) block;
simpleBlock.getBlocks().forEach((child) -> renderBlock(renderer, sb, component, resolvedAssessmentItem, itemSessionState, child, ubu, translator));
}
renderEndTag(sb, block);
}
}
}
Aggregations