@UiHandler("explanaionButton") public void ClickOnExplanationButton(ClickEvent clickEvent) { if (explanaionButton.getStyleName().equals(oeStyle.hintsActiveButton())) { explanationContainer.add(getHTML(collectionItemDo.getResource().getExplanation())); explanationContainer.addStyleName(oeStyle.explanationTextBorder()); explanaionButton.setStyleName(oeStyle.hintsInActiveButton()); startExplanationDataLogEvent(collectionItemDo.getResource().getExplanation()); } }
@UiHandler("hintsButton") public void ClickOnHintButton(ClickEvent clickEvent) { if (hintsButton.getStyleName().equals(oeStyle.hintsActiveButton())) { if (collectionItemDo.getResource().getHints().size() > hintsLength) { startHintDataLogEvent(getQuestionHintsDo(hintsLength).getHintId()); hintsContainer.add( getHTML(getQuestionHintsDo(hintsLength).getHintText(), oeStyle.hintsText())); hintsButton.setText( "" + i18n.GL0317() + " (" + ((collectionItemDo.getResource().getHints().size() - hintsLength) - 1) + " Left)"); hintsButton .getElement() .setAttribute( "alt", " " + i18n.GL0317() + " (" + collectionItemDo.getResource().getHints().size() + " Left)"); hintsButton .getElement() .setAttribute( "title", " " + i18n.GL0317() + " (" + collectionItemDo.getResource().getHints().size() + " Left)"); hintsLength++; if (collectionItemDo.getResource().getHints().size() == hintsLength) { hintsButton.setStyleName(oeStyle.hintsInActiveButton()); } } else { hintsButton.setStyleName(oeStyle.hintsInActiveButton()); } } }
private void renderQuestionView() { hintsLength = 0; if (collectionItemDo != null && collectionItemDo.getResource() != null) { String titlelbl1 = InfoUtil.removeQuestionTagsOnBoldClick( StringUtil.isEmpty(collectionItemDo.getResource().getQuestionText()) ? "" : collectionItemDo.getResource().getQuestionText()); openEndedQuestionText.setHTML(removeHtmlTags(titlelbl1)); openEndedQuestionText .getElement() .setAttribute( "alt", StringUtil.removeAllHtmlCss( StringUtil.isEmpty(collectionItemDo.getResource().getQuestionText()) ? "" : collectionItemDo.getResource().getQuestionText())); openEndedQuestionText .getElement() .setAttribute( "title", StringUtil.removeAllHtmlCss( StringUtil.isEmpty(collectionItemDo.getResource().getQuestionText()) ? "" : collectionItemDo.getResource().getQuestionText())); if (collectionItemDo.getResource().getHints() != null && collectionItemDo.getResource().getHints().size() > 0) { hintsButton.setText( " " + i18n.GL0317() + " (" + collectionItemDo.getResource().getHints().size() + " Left)"); hintsButton .getElement() .setAttribute( "alt", " " + i18n.GL0317() + " (" + collectionItemDo.getResource().getHints().size() + " Left)"); hintsButton .getElement() .setAttribute( "title", " " + i18n.GL0317() + " (" + collectionItemDo.getResource().getHints().size() + " Left)"); } else { hintsButton.setStyleName(oeStyle.hintsInActiveButton()); } if (collectionItemDo.getResource().getExplanation() != null && collectionItemDo.getResource().getExplanation().trim().length() > 0) { } else { explanaionButton.setStyleName(oeStyle.hintsInActiveButton()); } if (!StringUtil.isEmpty(getQuestionImage())) { openEndedQuestionImage.setUrl(getQuestionImage()); } } }