Search in sources :

Example 1 with ItemBodyResultFormItem

use of org.olat.ims.qti21.ui.components.ItemBodyResultFormItem in project OpenOLAT by OpenOLAT.

the class QTI21ItemBodyController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    ItemBodyResultFormItem questionItem = new ItemBodyResultFormItem("question", resolvedAssessmentItem);
    questionItem.setItemSessionState(itemSessionController.getItemSessionState());
    questionItem.setCandidateSessionContext(new TerminatedStaticCandidateSessionContext(new InMemoryAssessmentTestSession()));
    questionItem.setResourceLocator(inputResourceLocator);
    questionItem.setAssessmentObjectUri(assessmentObjectUri);
    questionItem.setMapperUri(mapperUri);
    formLayout.add(questionItem);
}
Also used : ItemBodyResultFormItem(org.olat.ims.qti21.ui.components.ItemBodyResultFormItem) TerminatedStaticCandidateSessionContext(org.olat.ims.qti21.ui.assessment.TerminatedStaticCandidateSessionContext) InMemoryAssessmentTestSession(org.olat.ims.qti21.model.InMemoryAssessmentTestSession)

Example 2 with ItemBodyResultFormItem

use of org.olat.ims.qti21.ui.components.ItemBodyResultFormItem in project OpenOLAT by OpenOLAT.

the class UnkownItemEditorController method initForm.

@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
    setFormWarning("warning.alien.assessment.item");
    convertLink = uifactory.addFormLink("convert.alien", formLayout, Link.BUTTON);
    convertLink.setEnabled(canConvert());
    if (formLayout instanceof FormLayoutContainer) {
        FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
        String title = StringHelper.escapeHtml(item.getTitle());
        layoutCont.contextPut("title", title);
        String responseId = "responseBody" + CodeHelper.getRAMUniqueID();
        ItemBodyResultFormItem formItem = new ItemBodyResultFormItem(responseId, resolvedAssessmentItem);
        formLayout.add(responseId, formItem);
        layoutCont.contextPut("responseId", responseId);
        formItem.setLabel("form.imd.descr", null);
        formItem.setItemSessionState(itemSessionController.getItemSessionState());
        formItem.setCandidateSessionContext(new TerminatedStaticCandidateSessionContext(new InMemoryAssessmentTestSession()));
        formItem.setResourceLocator(inputResourceLocator);
        formItem.setAssessmentObjectUri(assessmentObjectUri);
        formItem.setMapperUri(mapperUri);
    }
}
Also used : ItemBodyResultFormItem(org.olat.ims.qti21.ui.components.ItemBodyResultFormItem) TerminatedStaticCandidateSessionContext(org.olat.ims.qti21.ui.assessment.TerminatedStaticCandidateSessionContext) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) InMemoryAssessmentTestSession(org.olat.ims.qti21.model.InMemoryAssessmentTestSession)

Example 3 with ItemBodyResultFormItem

use of org.olat.ims.qti21.ui.components.ItemBodyResultFormItem in project OpenOLAT by OpenOLAT.

the class AssessmentResultController method initFormItemInteractions.

private InteractionResults initFormItemInteractions(FormLayoutContainer layoutCont, ItemSessionState sessionState, ResolvedAssessmentItem resolvedAssessmentItem) {
    FormItem responseFormItem = null;
    if (options.isUserSolutions()) {
        // response
        String responseId = "responseItem" + count++;
        ItemBodyResultFormItem formItem = new ItemBodyResultFormItem(responseId, resolvedAssessmentItem);
        initInteractionResultFormItem(formItem, sessionState);
        layoutCont.add(responseId, formItem);
        responseFormItem = formItem;
    }
    // solution
    FormItem solutionFormItem = null;
    if (options.isCorrectSolutions()) {
        String solutionId = "solutionItem" + count++;
        ItemBodyResultFormItem formItem = new ItemBodyResultFormItem(solutionId, resolvedAssessmentItem);
        formItem.setShowSolution(true);
        initInteractionResultFormItem(formItem, sessionState);
        layoutCont.add(solutionId, formItem);
        solutionFormItem = formItem;
    }
    return new InteractionResults(responseFormItem, solutionFormItem);
}
Also used : ItemBodyResultFormItem(org.olat.ims.qti21.ui.components.ItemBodyResultFormItem) FeedbackResultFormItem(org.olat.ims.qti21.ui.components.FeedbackResultFormItem) ItemBodyResultFormItem(org.olat.ims.qti21.ui.components.ItemBodyResultFormItem) FormItem(org.olat.core.gui.components.form.flexible.FormItem)

Example 4 with ItemBodyResultFormItem

use of org.olat.ims.qti21.ui.components.ItemBodyResultFormItem in project OpenOLAT by OpenOLAT.

the class CorrectionIdentityInteractionsController method initFormExtendedTextInteraction.

private ItemBodyResultFormItem initFormExtendedTextInteraction(TestPlanNodeKey testPlanNodeKey, TestSessionState testSessionState, AssessmentTestSession assessmentTestSession, FormItemContainer layoutCont) {
    ItemSessionState sessionState = testSessionState.getItemSessionStates().get(testPlanNodeKey);
    String responseId = "responseItem_" + id + "_" + count++;
    ItemBodyResultFormItem responseFormItem = new ItemBodyResultFormItem(responseId, resolvedAssessmentItem);
    responseFormItem.setItemSessionState(sessionState);
    responseFormItem.setCandidateSessionContext(new TerminatedStaticCandidateSessionContext(assessmentTestSession));
    responseFormItem.setResolvedAssessmentTest(resolvedAssessmentTest);
    responseFormItem.setResourceLocator(inputResourceLocator);
    responseFormItem.setAssessmentObjectUri(assessmentObjectUri);
    responseFormItem.setMapperUri(mapperUri);
    layoutCont.add(responseFormItem);
    return responseFormItem;
}
Also used : ItemBodyResultFormItem(org.olat.ims.qti21.ui.components.ItemBodyResultFormItem) ItemSessionState(uk.ac.ed.ph.jqtiplus.state.ItemSessionState)

Example 5 with ItemBodyResultFormItem

use of org.olat.ims.qti21.ui.components.ItemBodyResultFormItem in project openolat by klemens.

the class CorrectionIdentityInteractionsController method initFormExtendedTextInteraction.

private ItemBodyResultFormItem initFormExtendedTextInteraction(TestPlanNodeKey testPlanNodeKey, TestSessionState testSessionState, AssessmentTestSession assessmentTestSession, FormItemContainer layoutCont) {
    ItemSessionState sessionState = testSessionState.getItemSessionStates().get(testPlanNodeKey);
    String responseId = "responseItem_" + id + "_" + count++;
    ItemBodyResultFormItem responseFormItem = new ItemBodyResultFormItem(responseId, resolvedAssessmentItem);
    responseFormItem.setItemSessionState(sessionState);
    responseFormItem.setCandidateSessionContext(new TerminatedStaticCandidateSessionContext(assessmentTestSession));
    responseFormItem.setResolvedAssessmentTest(resolvedAssessmentTest);
    responseFormItem.setResourceLocator(inputResourceLocator);
    responseFormItem.setAssessmentObjectUri(assessmentObjectUri);
    responseFormItem.setMapperUri(mapperUri);
    layoutCont.add(responseFormItem);
    return responseFormItem;
}
Also used : ItemBodyResultFormItem(org.olat.ims.qti21.ui.components.ItemBodyResultFormItem) ItemSessionState(uk.ac.ed.ph.jqtiplus.state.ItemSessionState)

Aggregations

ItemBodyResultFormItem (org.olat.ims.qti21.ui.components.ItemBodyResultFormItem)8 InMemoryAssessmentTestSession (org.olat.ims.qti21.model.InMemoryAssessmentTestSession)4 TerminatedStaticCandidateSessionContext (org.olat.ims.qti21.ui.assessment.TerminatedStaticCandidateSessionContext)4 FormItem (org.olat.core.gui.components.form.flexible.FormItem)2 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)2 FeedbackResultFormItem (org.olat.ims.qti21.ui.components.FeedbackResultFormItem)2 ItemSessionState (uk.ac.ed.ph.jqtiplus.state.ItemSessionState)2