Search in sources :

Example 6 with Objectives

use of org.olat.ims.qti.container.qtielements.Objectives in project openolat by klemens.

the class IQComponentRenderer method displaySectionInfo.

private void displaySectionInfo(StringOutput sb, SectionContext sc, AssessmentInstance ai, IQComponent comp, URLBuilder ubu, Translator translator) {
    // display the sectionInfo
    if (sc == null)
        return;
    if (ai.isDisplayTitles())
        sb.append("<h3>" + sc.getTitle() + "</h3>");
    Objectives objectives = sc.getObjectives();
    if (objectives != null) {
        StringBuilder sbTmp = new StringBuilder();
        Resolver resolver = ai.getResolver();
        RenderInstructions ri = new RenderInstructions();
        ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
        objectives.render(sbTmp, ri);
        sb.append(sbTmp);
    }
    // if Menu not visible, or if visible but not selectable, and itemPage sequence (one question per page)
    // show button to navigate to the first question of the current section
    IQMenuDisplayConf menuDisplayConfig = comp.getMenuDisplayConf();
    if (!menuDisplayConfig.isEnabledMenu() && menuDisplayConfig.isItemPageSequence()) {
        sb.append("<a class=\"btn btn-default\" onclick=\"return o2cl()\" href=\"");
        ubu.buildURI(sb, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "git" });
        AssessmentContext ac = ai.getAssessmentContext();
        int sectionPos = ac.getCurrentSectionContextPos();
        sb.append("?itid=" + 0 + "&seid=" + sectionPos);
        String title = translator.translate("next");
        sb.append("\" title=\"" + StringEscapeUtils.escapeHtml(title) + "\">");
        sb.append("<span>").append(title).append("</span>");
        sb.append("</a>");
    }
}
Also used : RenderInstructions(org.olat.ims.qti.container.qtielements.RenderInstructions) AssessmentContext(org.olat.ims.qti.container.AssessmentContext) Resolver(org.olat.ims.qti.process.Resolver) Objectives(org.olat.ims.qti.container.qtielements.Objectives) Hint(org.olat.ims.qti.container.qtielements.Hint)

Example 7 with Objectives

use of org.olat.ims.qti.container.qtielements.Objectives in project openolat by klemens.

the class IQComponentRenderer method displayAssessmentInfo.

private void displayAssessmentInfo(StringOutput sb, AssessmentContext ac, AssessmentInstance ai, IQComponent comp, URLBuilder ubu, Translator translator) {
    Objectives objectives = ac.getObjectives();
    if (objectives != null) {
        StringBuilder sbTmp = new StringBuilder();
        Resolver resolver = ai.getResolver();
        RenderInstructions ri = new RenderInstructions();
        ri.put(RenderInstructions.KEY_STATICS_PATH, resolver.getStaticsBaseURI() + "/");
        objectives.render(sbTmp, ri);
        sb.append(sbTmp);
    }
    // if Menu not visible, or if visible but not selectable show button to navigate to the first section panel
    IQMenuDisplayConf menuDisplayConfig = comp.getMenuDisplayConf();
    if (!menuDisplayConfig.isEnabledMenu()) {
        sb.append("<a class=\"btn btn-default\" onclick=\"return o2cl()\" href=\"");
        ubu.buildURI(sb, new String[] { VelocityContainer.COMMAND_ID }, new String[] { "gse" });
        sb.append("?seid=" + 0);
        String title = translator.translate("next");
        sb.append("\" title=\"" + StringEscapeUtils.escapeHtml(title) + "\">");
        sb.append("<span>").append(title).append("</span>");
        sb.append("</a>");
    }
}
Also used : RenderInstructions(org.olat.ims.qti.container.qtielements.RenderInstructions) Resolver(org.olat.ims.qti.process.Resolver) Objectives(org.olat.ims.qti.container.qtielements.Objectives)

Example 8 with Objectives

use of org.olat.ims.qti.container.qtielements.Objectives in project openolat by klemens.

the class AssessmentContext method setUp.

/**
 * Method setUp.
 *
 * @param assessInstance
 */
public void setUp(AssessmentInstance assessInstance) {
    this.assessInstance = assessInstance;
    init();
    Document el_questestinterop = assessInstance.getResolver().getQTIDocument();
    el_assessment = (Element) el_questestinterop.selectSingleNode("questestinterop/assessment");
    ident = el_assessment.attributeValue("ident");
    title = el_assessment.attributeValue("title");
    Element dur = (Element) el_assessment.selectSingleNode("duration");
    if (dur == null) {
        // no limit
        durationLimit = -1;
    } else {
        String sdur = dur.getText();
        durationLimit = QTIHelper.parseISODuration(sdur);
        // Assesst Designer fix
        if (durationLimit == 0)
            durationLimit = -1;
    }
    // get objectives
    Element el_objectives = (Element) el_assessment.selectSingleNode("objectives");
    if (el_objectives != null)
        objectives = new Objectives(el_objectives);
    // set feedback, hint, and solutions switches
    // <!ENTITY % I_FeedbackSwitch " feedbackswitch (Yes | No ) 'Yes'">
    // <!ENTITY % I_HintSwitch " hintswitch (Yes | No ) 'Yes'">
    // <!ENTITY % I_SolutionSwitch " solutionswitch (Yes | No ) 'Yes'">
    // <!ELEMENT assessment (qticomment? , duration? , qtimetadata* ,
    // objectives* , assessmentcontrol* , rubric* , presentation_material? ,
    // outcomes_processing* , assessproc_extension? , assessfeedback* ,
    // selection_ordering? , reference? , (sectionref | section)+)>
    // <!ELEMENT assessmentcontrol (qticomment?)>
    Element el_control = (Element) el_assessment.selectSingleNode("assessmentcontrol");
    if (el_control != null) {
        String feedbackswitch = el_control.attributeValue("feedbackswitch");
        String hintswitch = el_control.attributeValue("hintswitch");
        String solutionswitch = el_control.attributeValue("solutionswitch");
        boolean feedback = (feedbackswitch == null) ? true : feedbackswitch.equals("Yes");
        boolean hints = (hintswitch == null) ? true : hintswitch.equals("Yes");
        boolean solutions = (solutionswitch == null) ? true : solutionswitch.equals("Yes");
        switches = new Switches(feedback, hints, solutions);
    }
    // scoring model and outcomes processing
    Element el_outpro = (Element) el_assessment.selectSingleNode("outcomes_processing");
    if (el_outpro != null) {
        // get the scoring model: we need it later for calculating the score
        // <!ENTITY % I_ScoreModel " scoremodel CDATA #IMPLIED">
        scoremodel = el_outpro.attributeValue("scoremodel");
        // may be null -> then assume SumOfScores
        // set the cutvalue if given (only variable score)
        cutvalue = QTIHelper.getFloatAttribute(el_outpro, "outcomes/decvar[@varname='SCORE']", "cutvalue");
        List el_oft = el_outpro.selectNodes("outcomes_feedback_test");
        if (el_oft.size() != 0) {
            feedbacktesting = true;
        }
    }
    initSections(el_assessment, switches);
    init();
}
Also used : Element(org.dom4j.Element) Objectives(org.olat.ims.qti.container.qtielements.Objectives) ArrayList(java.util.ArrayList) List(java.util.List) Document(org.dom4j.Document)

Aggregations

Objectives (org.olat.ims.qti.container.qtielements.Objectives)8 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Element (org.dom4j.Element)4 RenderInstructions (org.olat.ims.qti.container.qtielements.RenderInstructions)4 Resolver (org.olat.ims.qti.process.Resolver)4 Iterator (java.util.Iterator)2 Random (java.util.Random)2 Document (org.dom4j.Document)2 AssessmentContext (org.olat.ims.qti.container.AssessmentContext)2 Hint (org.olat.ims.qti.container.qtielements.Hint)2 ExpressionBuilder (org.olat.ims.qti.process.elements.ExpressionBuilder)2