Search in sources :

Example 1 with CompleteAssessmentTestSessionEvent

use of org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent in project OpenOLAT by OpenOLAT.

the class CorrectionAssessmentItemListController method doSaveTests.

private void doSaveTests(UserRequest ureq) {
    List<AssessmentTestSession> rows = new ArrayList<>(model.getLastSessions().values());
    AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
    fireEvent(ureq, new CompleteAssessmentTestSessionEvent(rows, assessmentTest, AssessmentEntryStatus.done));
}
Also used : ResolvedAssessmentTest(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest) AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) AssessmentTestSession(org.olat.ims.qti21.AssessmentTestSession) ArrayList(java.util.ArrayList) CompleteAssessmentTestSessionEvent(org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent)

Example 2 with CompleteAssessmentTestSessionEvent

use of org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent in project OpenOLAT by OpenOLAT.

the class CorrectionIdentityAssessmentItemListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("select".equals(cmd)) {
                CorrectionIdentityAssessmentItemRow row = tableModel.getObject(se.getIndex());
                doSelect(ureq, row);
            }
        }
    } else if (saveButton == source) {
        List<AssessmentTestSession> sessions = Collections.singletonList(candidateSession);
        AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
        fireEvent(ureq, new CompleteAssessmentTestSessionEvent(sessions, assessmentTest, AssessmentEntryStatus.done));
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : ResolvedAssessmentTest(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest) AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) CorrectionIdentityAssessmentItemRow(org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) CompleteAssessmentTestSessionEvent(org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent) List(java.util.List) ArrayList(java.util.ArrayList)

Example 3 with CompleteAssessmentTestSessionEvent

use of org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent in project openolat by klemens.

the class CorrectionAssessmentItemListController method doSaveTests.

private void doSaveTests(UserRequest ureq) {
    List<AssessmentTestSession> rows = new ArrayList<>(model.getLastSessions().values());
    AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
    fireEvent(ureq, new CompleteAssessmentTestSessionEvent(rows, assessmentTest, AssessmentEntryStatus.done));
}
Also used : ResolvedAssessmentTest(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest) AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) AssessmentTestSession(org.olat.ims.qti21.AssessmentTestSession) ArrayList(java.util.ArrayList) CompleteAssessmentTestSessionEvent(org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent)

Example 4 with CompleteAssessmentTestSessionEvent

use of org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent in project openolat by klemens.

the class CorrectionIdentityAssessmentItemListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            if ("select".equals(cmd)) {
                CorrectionIdentityAssessmentItemRow row = tableModel.getObject(se.getIndex());
                doSelect(ureq, row);
            }
        }
    } else if (saveButton == source) {
        List<AssessmentTestSession> sessions = Collections.singletonList(candidateSession);
        AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
        fireEvent(ureq, new CompleteAssessmentTestSessionEvent(sessions, assessmentTest, AssessmentEntryStatus.done));
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : ResolvedAssessmentTest(uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest) AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) CorrectionIdentityAssessmentItemRow(org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) CompleteAssessmentTestSessionEvent(org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent) List(java.util.List) ArrayList(java.util.ArrayList)

Example 5 with CompleteAssessmentTestSessionEvent

use of org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent in project openolat by klemens.

the class CorrectionIdentityListController method doSaveTests.

private void doSaveTests(UserRequest ureq) {
    Set<Integer> selections = tableEl.getMultiSelectedIndex();
    List<AssessmentTestSession> rows = new ArrayList<>(selections.size());
    for (Integer i : selections) {
        CorrectionIdentityRow row = tableModel.getObject(i.intValue());
        if (row != null) {
            rows.add(row.getCandidateSession());
        }
    }
    AssessmentTest assessmentTest = model.getResolvedAssessmentTest().getRootNodeLookup().extractIfSuccessful();
    fireEvent(ureq, new CompleteAssessmentTestSessionEvent(rows, assessmentTest, AssessmentEntryStatus.done));
}
Also used : AssessmentTest(uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest) AssessmentTestSession(org.olat.ims.qti21.AssessmentTestSession) ArrayList(java.util.ArrayList) CompleteAssessmentTestSessionEvent(org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent) CorrectionIdentityRow(org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityRow)

Aggregations

ArrayList (java.util.ArrayList)6 CompleteAssessmentTestSessionEvent (org.olat.modules.assessment.ui.event.CompleteAssessmentTestSessionEvent)6 AssessmentTest (uk.ac.ed.ph.jqtiplus.node.test.AssessmentTest)6 AssessmentTestSession (org.olat.ims.qti21.AssessmentTestSession)4 ResolvedAssessmentTest (uk.ac.ed.ph.jqtiplus.resolution.ResolvedAssessmentTest)4 List (java.util.List)2 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)2 CorrectionIdentityAssessmentItemRow (org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityAssessmentItemRow)2 CorrectionIdentityRow (org.olat.ims.qti21.ui.assessment.model.CorrectionIdentityRow)2