Search in sources :

Example 1 with IQRetrievedEvent

use of org.olat.modules.iq.IQRetrievedEvent 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 2 with IQRetrievedEvent

use of org.olat.modules.iq.IQRetrievedEvent in project OpenOLAT by OpenOLAT.

the class QTI12PullTestsToolController method doRetrieveTests.

private void doRetrieveTests(List<Identity> assessedIdentities) {
    ICourse course = CourseFactory.loadCourse(courseEnv.getCourseResourceableId());
    for (Identity assessedIdentity : assessedIdentities) {
        if (courseNode.isQTI12TestRunning(assessedIdentity, courseEnv)) {
            IQRetrievedEvent retrieveEvent = new IQRetrievedEvent(assessedIdentity, courseEnv.getCourseResourceableId(), courseNode.getIdent());
            CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(retrieveEvent, retrieveEvent);
            retrieveTest(assessedIdentity, course);
        }
    }
}
Also used : IQRetrievedEvent(org.olat.modules.iq.IQRetrievedEvent) ICourse(org.olat.course.ICourse) Identity(org.olat.core.id.Identity)

Example 3 with IQRetrievedEvent

use of org.olat.modules.iq.IQRetrievedEvent 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)

Example 4 with IQRetrievedEvent

use of org.olat.modules.iq.IQRetrievedEvent in project openolat by klemens.

the class QTI12PullTestsToolController method doRetrieveTests.

private void doRetrieveTests(List<Identity> assessedIdentities) {
    ICourse course = CourseFactory.loadCourse(courseEnv.getCourseResourceableId());
    for (Identity assessedIdentity : assessedIdentities) {
        if (courseNode.isQTI12TestRunning(assessedIdentity, courseEnv)) {
            IQRetrievedEvent retrieveEvent = new IQRetrievedEvent(assessedIdentity, courseEnv.getCourseResourceableId(), courseNode.getIdent());
            CoordinatorManager.getInstance().getCoordinator().getEventBus().fireEventToListenersOf(retrieveEvent, retrieveEvent);
            retrieveTest(assessedIdentity, course);
        }
    }
}
Also used : IQRetrievedEvent(org.olat.modules.iq.IQRetrievedEvent) ICourse(org.olat.course.ICourse) Identity(org.olat.core.id.Identity)

Aggregations

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