use of org.olat.core.gui.components.countdown.CountDownComponent in project openolat by klemens.
the class AssessmentModeGuardController method createGuard.
private ResourceGuard createGuard(TransientAssessmentMode mode) {
String id = Long.toString(CodeHelper.getRAMUniqueID());
Link goButton = LinkFactory.createCustomLink("go-" + id, "go", "current.mode.start", Link.BUTTON, mainVC, this);
goButton.setElementCssClass("o_sel_assessment_start");
goButton.setCustomEnabledLinkCSS("btn btn-primary");
goButton.setCustomDisabledLinkCSS("o_disabled btn btn-default");
Link continueButton = LinkFactory.createCustomLink("continue-" + id, "continue", "current.mode.continue", Link.BUTTON, mainVC, this);
continueButton.setCustomEnabledLinkCSS("btn btn-primary");
continueButton.setCustomDisabledLinkCSS("o_disabled btn btn-default");
CountDownComponent countDown = new CountDownComponent("count-" + id, mode.getBegin(), getTranslator());
countDown.setI18nKey("current.mode.in");
ResourceGuard guard = new ResourceGuard(mode.getModeKey(), goButton, continueButton, countDown);
mainVC.put(goButton.getComponentName(), goButton);
mainVC.put(continueButton.getComponentName(), continueButton);
mainVC.put(countDown.getComponentName(), countDown);
goButton.setUserObject(guard);
continueButton.setUserObject(guard);
return guard;
}
use of org.olat.core.gui.components.countdown.CountDownComponent in project openolat by klemens.
the class BaseFullWebappController method lockResourceMessage.
private void lockResourceMessage(TransientAssessmentMode mode) {
if (lockResource != null && lockResource.getResourceableId().equals(mode.getResource().getResourceableId())) {
Translator trans = Util.createPackageTranslator(AssessmentModeGuardController.class, getLocale());
if (stickyMessageCmp.getDelegateComponent() instanceof CountDownComponent) {
CountDownComponent cmp = (CountDownComponent) stickyMessageCmp.getDelegateComponent();
cmp.setDate(mode.getEnd());
} else {
CountDownComponent cmp = new CountDownComponent("stickcountdown", mode.getEnd(), trans);
cmp.setI18nKey("assessment.countdown");
stickyMessageCmp.setDelegateComponent(cmp);
}
}
}
use of org.olat.core.gui.components.countdown.CountDownComponent in project OpenOLAT by OpenOLAT.
the class BaseFullWebappController method lockResourceMessage.
private void lockResourceMessage(TransientAssessmentMode mode) {
if (lockResource != null && lockResource.getResourceableId().equals(mode.getResource().getResourceableId())) {
Translator trans = Util.createPackageTranslator(AssessmentModeGuardController.class, getLocale());
if (stickyMessageCmp.getDelegateComponent() instanceof CountDownComponent) {
CountDownComponent cmp = (CountDownComponent) stickyMessageCmp.getDelegateComponent();
cmp.setDate(mode.getEnd());
} else {
CountDownComponent cmp = new CountDownComponent("stickcountdown", mode.getEnd(), trans);
cmp.setI18nKey("assessment.countdown");
stickyMessageCmp.setDelegateComponent(cmp);
}
}
}
use of org.olat.core.gui.components.countdown.CountDownComponent in project OpenOLAT by OpenOLAT.
the class AssessmentModeGuardController method createGuard.
private ResourceGuard createGuard(TransientAssessmentMode mode) {
String id = Long.toString(CodeHelper.getRAMUniqueID());
Link goButton = LinkFactory.createCustomLink("go-" + id, "go", "current.mode.start", Link.BUTTON, mainVC, this);
goButton.setElementCssClass("o_sel_assessment_start");
goButton.setCustomEnabledLinkCSS("btn btn-primary");
goButton.setCustomDisabledLinkCSS("o_disabled btn btn-default");
Link continueButton = LinkFactory.createCustomLink("continue-" + id, "continue", "current.mode.continue", Link.BUTTON, mainVC, this);
continueButton.setCustomEnabledLinkCSS("btn btn-primary");
continueButton.setCustomDisabledLinkCSS("o_disabled btn btn-default");
CountDownComponent countDown = new CountDownComponent("count-" + id, mode.getBegin(), getTranslator());
countDown.setI18nKey("current.mode.in");
ResourceGuard guard = new ResourceGuard(mode.getModeKey(), goButton, continueButton, countDown);
mainVC.put(goButton.getComponentName(), goButton);
mainVC.put(continueButton.getComponentName(), continueButton);
mainVC.put(countDown.getComponentName(), countDown);
goButton.setUserObject(guard);
continueButton.setUserObject(guard);
return guard;
}
Aggregations