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