use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class AccessConfigurationController method editMethod.
private void editMethod(UserRequest ureq, AccessInfo infos) {
OfferAccess link = infos.getLink();
removeAsListenerAndDispose(editMethodCtrl);
AccessMethodHandler handler = acModule.getAccessMethodHandler(link.getMethod().getType());
if (handler != null) {
editMethodCtrl = handler.editConfigurationController(ureq, getWindowControl(), link);
}
if (editMethodCtrl != null) {
listenTo(editMethodCtrl);
String title = handler.getMethodName(getLocale());
cmc = new CloseableModalController(getWindowControl(), translate("close"), editMethodCtrl.getInitialComponent(), true, title);
cmc.activate();
listenTo(cmc);
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class AccessConfigurationController method addMethod.
protected void addMethod(UserRequest ureq, AccessMethod method) {
boolean confirmationEmail = confirmationEmailEl.isVisible() && confirmationEmailEl.isAtLeastSelected(1);
Offer offer = acService.createOffer(resource, displayName);
offer.setConfirmationEmail(confirmationEmail);
OfferAccess link = acService.createOfferAccess(offer, method);
removeAsListenerAndDispose(newMethodCtrl);
AccessMethodHandler handler = acModule.getAccessMethodHandler(link.getMethod().getType());
if (handler != null) {
newMethodCtrl = handler.createConfigurationController(ureq, getWindowControl(), link);
}
if (newMethodCtrl != null) {
listenTo(newMethodCtrl);
String title = handler.getMethodName(getLocale());
cmc = new CloseableModalController(getWindowControl(), translate("close"), newMethodCtrl.getInitialComponent(), true, title);
cmc.activate();
listenTo(cmc);
} else {
OfferAccess newLink = acService.saveOfferAccess(link);
addConfiguration(newLink);
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class IQConfigurationController method doChangeSelfTest.
private void doChangeSelfTest(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(searchController);
String[] types = new String[] { TestFileResource.TYPE_NAME, ImsQTI21Resource.TYPE_NAME };
searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, types, translate("command.chooseTest"));
listenTo(searchController);
cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent());
listenTo(searchController);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class IQConfigurationController method doChooseTestAndSurvey.
private void doChooseTestAndSurvey(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(searchController);
if (type.equals(AssessmentInstance.QMD_ENTRY_TYPE_SURVEY)) {
searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, SurveyFileResource.TYPE_NAME, translate("command.chooseSurvey"));
} else {
// test and selftest use same repository resource type
searchController = new ReferencableEntriesSearchController(getWindowControl(), ureq, new String[] { TestFileResource.TYPE_NAME, ImsQTI21Resource.TYPE_NAME }, translate("command.chooseTest"));
}
listenTo(searchController);
cmc = new CloseableModalController(getWindowControl(), translate("close"), searchController.getInitialComponent(), true, translate("command.chooseRepFile"));
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doConfirmExtraTime.
private void doConfirmExtraTime(UserRequest ureq) {
List<IdentityRef> identities = getSelectedIdentities();
if (identities == null || identities.isEmpty()) {
showWarning("warning.users.extra.time");
return;
}
List<AssessmentTestSession> testSessions = new ArrayList<>(identities.size());
for (IdentityRef identity : identities) {
List<AssessmentTestSessionStatistics> sessionsStatistics = qtiService.getAssessmentTestSessionsStatistics(getCourseRepositoryEntry(), courseNode.getIdent(), identity);
if (!sessionsStatistics.isEmpty()) {
if (sessionsStatistics.size() > 1) {
Collections.sort(sessionsStatistics, new AssessmentTestSessionDetailsComparator());
}
AssessmentTestSession lastSession = sessionsStatistics.get(0).getTestSession();
if (lastSession != null && lastSession.getFinishTime() == null) {
testSessions.add(lastSession);
}
}
}
if (testSessions == null || testSessions.isEmpty()) {
showWarning("warning.users.extra.time");
return;
}
extraTimeCtrl = new ConfirmExtraTimeController(ureq, getWindowControl(), getCourseRepositoryEntry(), testSessions);
listenTo(extraTimeCtrl);
String title = translate("extra.time");
cmc = new CloseableModalController(getWindowControl(), null, extraTimeCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
Aggregations