use of org.olat.modules.portfolio.ui.editor.ValidationMessage in project OpenOLAT by OpenOLAT.
the class EvaluationFormController method validate.
@Override
public boolean validate(UserRequest ureq, List<ValidationMessage> messages) {
boolean allFiled = true;
for (EvaluationFormElementWrapper elementWrapper : elementWrapperList) {
if (elementWrapper.isTextInput()) {
TextInputWrapper wrapper = elementWrapper.getTextInputWrapper();
if (wrapper != null && !hasResponse(wrapper.getId())) {
allFiled &= false;
}
} else if (elementWrapper.isFileUpload()) {
FileUploadWrapper wrapper = elementWrapper.getFileUploadWrapper();
if (wrapper != null && !hasResponse(wrapper.getId())) {
allFiled &= false;
}
} else if (elementWrapper.getSliders() != null && elementWrapper.getSliders().size() > 0) {
for (SliderWrapper slider : elementWrapper.getSliders()) {
if (slider != null && !hasResponse(slider.getId())) {
allFiled &= false;
}
}
}
}
if (!allFiled) {
String msg = translate("warning.form.not.completed");
messages.add(new ValidationMessage(Level.warning, msg));
}
return validateFormLogic(ureq);
}
use of org.olat.modules.portfolio.ui.editor.ValidationMessage in project openolat by klemens.
the class PageRunController method doConfirmPublish.
private void doConfirmPublish(UserRequest ureq) {
List<ValidationMessage> messages = new ArrayList<>();
pageCtrl.validateElements(ureq, messages);
String title = translate("publish.confirm.title");
String text = translate("publish.confirm.descr", new String[] { StringHelper.escapeHtml(page.getTitle()) });
if (messages.size() > 0) {
StringBuilder sb = new StringBuilder();
sb.append("<p>").append(text).append("</p>");
for (ValidationMessage message : messages) {
sb.append("<p class='o_warning'>").append(message.getMessage()).append("</p>");
}
text = sb.toString();
}
confirmPublishCtrl = activateYesNoDialog(ureq, title, text, confirmPublishCtrl);
}
use of org.olat.modules.portfolio.ui.editor.ValidationMessage in project OpenOLAT by OpenOLAT.
the class EvaluationFormController method doConfirmDone.
private void doConfirmDone(UserRequest ureq) {
for (EvaluationFormElementWrapper elementWrapper : elementWrapperList) {
if (elementWrapper.isTextInput()) {
TextInputWrapper wrapper = elementWrapper.getTextInputWrapper();
String value = wrapper.getTextEl().getValue();
saveNumericalResponse(null, value, wrapper.getId());
}
}
StringBuilder sb = new StringBuilder();
sb.append("<p>").append(translate("confirm.done")).append("</p>");
List<ValidationMessage> messages = new ArrayList<>();
validate(ureq, messages);
if (messages.size() > 0) {
for (ValidationMessage message : messages) {
sb.append("<p class='o_warning'>").append(message.getMessage()).append("</p>");
}
}
confirmDoneCtrl = activateYesNoDialog(ureq, null, sb.toString(), confirmDoneCtrl);
}
use of org.olat.modules.portfolio.ui.editor.ValidationMessage in project OpenOLAT by OpenOLAT.
the class PageRunController method doConfirmPublish.
private void doConfirmPublish(UserRequest ureq) {
List<ValidationMessage> messages = new ArrayList<>();
pageCtrl.validateElements(ureq, messages);
String title = translate("publish.confirm.title");
String text = translate("publish.confirm.descr", new String[] { StringHelper.escapeHtml(page.getTitle()) });
if (messages.size() > 0) {
StringBuilder sb = new StringBuilder();
sb.append("<p>").append(text).append("</p>");
for (ValidationMessage message : messages) {
sb.append("<p class='o_warning'>").append(message.getMessage()).append("</p>");
}
text = sb.toString();
}
confirmPublishCtrl = activateYesNoDialog(ureq, title, text, confirmPublishCtrl);
}
use of org.olat.modules.portfolio.ui.editor.ValidationMessage in project openolat by klemens.
the class EvaluationFormController method doConfirmDone.
private void doConfirmDone(UserRequest ureq) {
for (EvaluationFormElementWrapper elementWrapper : elementWrapperList) {
if (elementWrapper.isTextInput()) {
TextInputWrapper wrapper = elementWrapper.getTextInputWrapper();
String value = wrapper.getTextEl().getValue();
saveNumericalResponse(null, value, wrapper.getId());
}
}
StringBuilder sb = new StringBuilder();
sb.append("<p>").append(translate("confirm.done")).append("</p>");
List<ValidationMessage> messages = new ArrayList<>();
validate(ureq, messages);
if (messages.size() > 0) {
for (ValidationMessage message : messages) {
sb.append("<p class='o_warning'>").append(message.getMessage()).append("</p>");
}
}
confirmDoneCtrl = activateYesNoDialog(ureq, null, sb.toString(), confirmDoneCtrl);
}
Aggregations