Search in sources :

Example 1 with OpenSubDetailsEvent

use of org.olat.course.assessment.OpenSubDetailsEvent in project OpenOLAT by OpenOLAT.

the class AssessmentIdentityCourseNodeController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == detailsEditController) {
        // reset SCORM test
        if (event == Event.CHANGED_EVENT) {
            assessmentForm.reloadData();
            fireEvent(ureq, event);
        } else if (event == Event.DONE_EVENT) {
            fireEvent(ureq, Event.DONE_EVENT);
        } else if (event instanceof OpenSubDetailsEvent) {
            removeAsListenerAndDispose(subDetailsController);
            OpenSubDetailsEvent detailsEvent = (OpenSubDetailsEvent) event;
            subDetailsController = detailsEvent.getSubDetailsController();
            listenTo(subDetailsController);
            stackPanel.pushController(translate("sub.details"), subDetailsController);
        }
    } else if (assessmentForm == source) {
        if (detailsEditController instanceof AssessmentFormCallback) {
            if (AssessmentFormEvent.ASSESSMENT_DONE.equals(event.getCommand())) {
                ((AssessmentFormCallback) detailsEditController).assessmentDone(ureq);
            } else if (AssessmentFormEvent.ASSESSMENT_REOPEN.equals(event.getCommand())) {
                ((AssessmentFormCallback) detailsEditController).assessmentReopen(ureq);
            }
        }
        fireEvent(ureq, event);
    }
    super.event(ureq, source, event);
}
Also used : OpenSubDetailsEvent(org.olat.course.assessment.OpenSubDetailsEvent)

Example 2 with OpenSubDetailsEvent

use of org.olat.course.assessment.OpenSubDetailsEvent in project OpenOLAT by OpenOLAT.

the class QTI12ResultDetailsController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == tableCtr) {
        TableEvent tEvent = (TableEvent) event;
        if (tEvent.getActionId().equals("sel")) {
            QTIResultSet resultSet = tableModel.getObject(tEvent.getRowId());
            try {
                removeAsListenerAndDispose(xsltDetailsCtr);
                xsltDetailsCtr = new QTI12XSLTResultDetailsController(ureq, getWindowControl(), assessedIdentity, type, resultSet);
                listenTo(xsltDetailsCtr);
                fireEvent(ureq, new OpenSubDetailsEvent(xsltDetailsCtr));
            } catch (Exception e) {
                logError("", e);
                showError("error.resreporting.na");
            }
        } else if (tEvent.getActionId().equals("ret")) {
            updateTableModel();
            if (tableModel.isTestRunning()) {
                String fullname = UserManager.getInstance().getUserDisplayName(assessedIdentity);
                String title = translate("retrievetest.confirm.title");
                String text = translate("retrievetest.confirm.text", new String[] { fullname });
                retrieveConfirmationCtr = activateYesNoDialog(ureq, title, text, retrieveConfirmationCtr);
            }
        }
    } else if (source == retrieveConfirmationCtr) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            if (tableModel.isTestRunning()) {
                IQRetrievedEvent retrieveEvent = new IQRetrievedEvent(assessedIdentity, courseResourceableId, nodeIdent);
                CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(retrieveEvent, retrieveEvent);
                doRetrieveTest();
            }
            updateTableModel();
        }
        removeAsListenerAndDispose(retrieveConfirmationCtr);
        retrieveConfirmationCtr = null;
    }
}
Also used : OpenSubDetailsEvent(org.olat.course.assessment.OpenSubDetailsEvent) TableEvent(org.olat.core.gui.components.table.TableEvent) IQRetrievedEvent(org.olat.modules.iq.IQRetrievedEvent)

Example 3 with OpenSubDetailsEvent

use of org.olat.course.assessment.OpenSubDetailsEvent in project openolat by klemens.

the class AssessmentIdentityCourseNodeController method event.

@Override
protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == detailsEditController) {
        // reset SCORM test
        if (event == Event.CHANGED_EVENT) {
            assessmentForm.reloadData();
            fireEvent(ureq, event);
        } else if (event == Event.DONE_EVENT) {
            fireEvent(ureq, Event.DONE_EVENT);
        } else if (event instanceof OpenSubDetailsEvent) {
            removeAsListenerAndDispose(subDetailsController);
            OpenSubDetailsEvent detailsEvent = (OpenSubDetailsEvent) event;
            subDetailsController = detailsEvent.getSubDetailsController();
            listenTo(subDetailsController);
            stackPanel.pushController(translate("sub.details"), subDetailsController);
        }
    } else if (assessmentForm == source) {
        if (detailsEditController instanceof AssessmentFormCallback) {
            if (AssessmentFormEvent.ASSESSMENT_DONE.equals(event.getCommand())) {
                ((AssessmentFormCallback) detailsEditController).assessmentDone(ureq);
            } else if (AssessmentFormEvent.ASSESSMENT_REOPEN.equals(event.getCommand())) {
                ((AssessmentFormCallback) detailsEditController).assessmentReopen(ureq);
            }
        }
        fireEvent(ureq, event);
    }
    super.event(ureq, source, event);
}
Also used : OpenSubDetailsEvent(org.olat.course.assessment.OpenSubDetailsEvent)

Example 4 with OpenSubDetailsEvent

use of org.olat.course.assessment.OpenSubDetailsEvent in project openolat by klemens.

the class QTI12ResultDetailsController method event.

/**
 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
 */
@Override
public void event(UserRequest ureq, Controller source, Event event) {
    if (source == tableCtr) {
        TableEvent tEvent = (TableEvent) event;
        if (tEvent.getActionId().equals("sel")) {
            QTIResultSet resultSet = tableModel.getObject(tEvent.getRowId());
            try {
                removeAsListenerAndDispose(xsltDetailsCtr);
                xsltDetailsCtr = new QTI12XSLTResultDetailsController(ureq, getWindowControl(), assessedIdentity, type, resultSet);
                listenTo(xsltDetailsCtr);
                fireEvent(ureq, new OpenSubDetailsEvent(xsltDetailsCtr));
            } catch (Exception e) {
                logError("", e);
                showError("error.resreporting.na");
            }
        } else if (tEvent.getActionId().equals("ret")) {
            updateTableModel();
            if (tableModel.isTestRunning()) {
                String fullname = UserManager.getInstance().getUserDisplayName(assessedIdentity);
                String title = translate("retrievetest.confirm.title");
                String text = translate("retrievetest.confirm.text", new String[] { fullname });
                retrieveConfirmationCtr = activateYesNoDialog(ureq, title, text, retrieveConfirmationCtr);
            }
        }
    } else if (source == retrieveConfirmationCtr) {
        if (DialogBoxUIFactory.isYesEvent(event)) {
            if (tableModel.isTestRunning()) {
                IQRetrievedEvent retrieveEvent = new IQRetrievedEvent(assessedIdentity, courseResourceableId, nodeIdent);
                CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(retrieveEvent, retrieveEvent);
                doRetrieveTest();
            }
            updateTableModel();
        }
        removeAsListenerAndDispose(retrieveConfirmationCtr);
        retrieveConfirmationCtr = null;
    }
}
Also used : OpenSubDetailsEvent(org.olat.course.assessment.OpenSubDetailsEvent) TableEvent(org.olat.core.gui.components.table.TableEvent) IQRetrievedEvent(org.olat.modules.iq.IQRetrievedEvent)

Aggregations

OpenSubDetailsEvent (org.olat.course.assessment.OpenSubDetailsEvent)4 TableEvent (org.olat.core.gui.components.table.TableEvent)2 IQRetrievedEvent (org.olat.modules.iq.IQRetrievedEvent)2