Search in sources :

Example 1 with MathEntryInteraction

use of uk.ac.ed.ph.qtiworks.mathassess.MathEntryInteraction in project openolat by klemens.

the class AssessmentObjectComponentRenderer method renderCustomInteraction.

/**
 * Render the interaction or the PositionStageObject
 * @param renderer
 * @param sb
 * @param interaction
 * @param assessmentItem
 * @param itemSessionState
 * @param component
 * @param ubu
 * @param translator
 */
private void renderCustomInteraction(AssessmentRenderer renderer, StringOutput sb, CustomInteraction<?> interaction, ResolvedAssessmentItem resolvedAssessmentItem, ItemSessionState itemSessionState, AssessmentObjectComponent component, URLBuilder ubu, Translator translator) {
    Context ctx = new VelocityContext();
    ctx.put("interaction", interaction);
    String page;
    if (interaction instanceof MathEntryInteraction) {
        page = velocity_root.concat("/mathEntryInteraction.html");
    } else {
        page = velocity_root.concat("/unsupportedCustomInteraction.html");
    }
    renderVelocity(renderer, sb, interaction, ctx, page, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
}
Also used : Context(org.apache.velocity.context.Context) VelocityContext(org.apache.velocity.VelocityContext) VelocityContext(org.apache.velocity.VelocityContext) AssessmentRenderFunctions.contentAsString(org.olat.ims.qti21.ui.components.AssessmentRenderFunctions.contentAsString) MathEntryInteraction(uk.ac.ed.ph.qtiworks.mathassess.MathEntryInteraction)

Example 2 with MathEntryInteraction

use of uk.ac.ed.ph.qtiworks.mathassess.MathEntryInteraction in project OpenOLAT by OpenOLAT.

the class AssessmentObjectComponentRenderer method renderCustomInteraction.

/**
 * Render the interaction or the PositionStageObject
 * @param renderer
 * @param sb
 * @param interaction
 * @param assessmentItem
 * @param itemSessionState
 * @param component
 * @param ubu
 * @param translator
 */
private void renderCustomInteraction(AssessmentRenderer renderer, StringOutput sb, CustomInteraction<?> interaction, ResolvedAssessmentItem resolvedAssessmentItem, ItemSessionState itemSessionState, AssessmentObjectComponent component, URLBuilder ubu, Translator translator) {
    Context ctx = new VelocityContext();
    ctx.put("interaction", interaction);
    String page;
    if (interaction instanceof MathEntryInteraction) {
        page = velocity_root.concat("/mathEntryInteraction.html");
    } else {
        page = velocity_root.concat("/unsupportedCustomInteraction.html");
    }
    renderVelocity(renderer, sb, interaction, ctx, page, resolvedAssessmentItem, itemSessionState, component, ubu, translator);
}
Also used : Context(org.apache.velocity.context.Context) VelocityContext(org.apache.velocity.VelocityContext) VelocityContext(org.apache.velocity.VelocityContext) AssessmentRenderFunctions.contentAsString(org.olat.ims.qti21.ui.components.AssessmentRenderFunctions.contentAsString) MathEntryInteraction(uk.ac.ed.ph.qtiworks.mathassess.MathEntryInteraction)

Aggregations

VelocityContext (org.apache.velocity.VelocityContext)2 Context (org.apache.velocity.context.Context)2 AssessmentRenderFunctions.contentAsString (org.olat.ims.qti21.ui.components.AssessmentRenderFunctions.contentAsString)2 MathEntryInteraction (uk.ac.ed.ph.qtiworks.mathassess.MathEntryInteraction)2