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;
}
}
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);
}
}
}
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;
}
}
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);
}
}
}
Aggregations